Verified Commit 5ba9e3de authored by Côme Chilliet's avatar Côme Chilliet
Browse files

🚑 fix(supann) Fix PHP error on new users

PHP "Undefined index: count" in file:
 /usr/share/fusiondirectory/plugins/personal/supann/class_TaggedAttribute.inc
 (Line 33)

issue #6015
parent cae365ce
......@@ -30,14 +30,16 @@ class TaggedAttribute extends SetAttribute
{
$this->value = [];
$pattern = '/^'.preg_quote($this->getLdapName(), '/').';(.+)$/';
for ($i = 0; $i < $attrs['count']; $i++) {
if ($attrs[$i] == $this->getLdapName()) {
for ($j = 0; $j < $attrs[$attrs[$i]]['count']; $j++) {
$this->value[] = ';'.$attrs[$attrs[$i]][$j];
}
} elseif (preg_match($pattern, $attrs[$i], $m)) {
for ($j = 0; $j < $attrs[$attrs[$i]]['count']; $j++) {
$this->value[] = $m[1].';'.$attrs[$attrs[$i]][$j];
if (!empty($attrs)) {
for ($i = 0; $i < $attrs['count']; $i++) {
if ($attrs[$i] == $this->getLdapName()) {
for ($j = 0; $j < $attrs[$attrs[$i]]['count']; $j++) {
$this->value[] = ';'.$attrs[$attrs[$i]][$j];
}
} elseif (preg_match($pattern, $attrs[$i], $m)) {
for ($j = 0; $j < $attrs[$attrs[$i]]['count']; $j++) {
$this->value[] = $m[1].';'.$attrs[$attrs[$i]][$j];
}
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment