Verified Commit 365ee0a5 authored by Côme Chilliet's avatar Côme Chilliet
Browse files

:ambulance: fix(gpg) Fix crash when GPG ldap fields are empty

issue #5978
Showing with 5 additions and 2 deletions
+5 -2
...@@ -72,9 +72,12 @@ class pgpKeySelect extends simpleSelectManagement ...@@ -72,9 +72,12 @@ class pgpKeySelect extends simpleSelectManagement
$this->filter->elements['NAME']['autocomplete']['attribute'] = $attributes; $this->filter->elements['NAME']['autocomplete']['attribute'] = $attributes;
} }
static function filterSingleValue (array $value, $func) static function filterSingleValue ($value, $func)
{ {
if (count($value) == 0) { if (is_array($value)) {
$value = reset($value);
}
if (($value === FALSE) || ($value === '')) {
return ' '; return ' ';
} }
$return = static::$func($value[0]); $return = static::$func($value[0]);
......
Supports Markdown
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