Changeset View
Changeset View
Standalone View
Standalone View
net/phpldapadmin/files/patch-lib_Attribute.php
--- lib/Attribute.php.orig 2021-12-12 02:35:51 UTC | --- lib/Attribute.php.orig 2021-12-12 02:35:51 UTC | ||||
+++ lib/Attribute.php | +++ lib/Attribute.php | ||||
@@ -12,7 +12,7 @@ | @@ -133,9 +133,9 @@ class PLAAttribute { | ||||
* @package phpLDAPadmin | debug_log('Entered (%%)',5,0,__FILE__,__LINE__,__METHOD__,$fargs,$this->name); | ||||
* @subpackage Templates | |||||
*/ | if ($real) | ||||
-class Attribute { | - return $lower ? strtolower($this->name) : $this->name; | ||||
+class PLAAttribute { | + return $lower ? strtolower((string) $this->name) : $this->name; | ||||
# Attribute Name | else | ||||
public $name; | - return $lower ? strtolower($this->real_attr_name()) : $this->real_attr_name(); | ||||
# Source of this attribute definition | + return $lower ? strtolower((string) $this->real_attr_name()) : $this->real_attr_name(); | ||||
} | |||||
public function getValues() { | |||||
@@ -389,7 +389,7 @@ class PLAAttribute { | |||||
if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) | |||||
debug_log('Entered (%%)',5,1,__FILE__,__LINE__,__METHOD__,$fargs); | |||||
- $this->type = strtolower($type); | |||||
+ $this->type = strtolower((string) $type); | |||||
} | |||||
public function getType() { | |||||
@@ -403,7 +403,7 @@ class PLAAttribute { | |||||
if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) | |||||
debug_log('Entered (%%)',5,1,__FILE__,__LINE__,__METHOD__,$fargs); | |||||
- $this->ldaptype = strtolower($type); | |||||
+ $this->ldaptype = strtolower((string) $type); | |||||
} | |||||
public function getLDAPtype() { | |||||
@@ -671,7 +671,7 @@ class PLAAttribute { | |||||
# Store our Aliases | |||||
foreach ($sattr->getAliases() as $alias) | |||||
- array_push($this->aliases,strtolower($alias)); | |||||
+ array_push($this->aliases,strtolower((string) $alias)); | |||||
if ($sattr->getIsSingleValue()) | |||||
$this->setMaxValueCount(1); | |||||
@@ -840,7 +840,7 @@ class PLAAttribute { | |||||
'type'=>'warn')); | |||||
} | |||||
- elseif (is_string($values) && (strlen($values) > 0)) | |||||
+ elseif (is_string($values) && (strlen((string) $values) > 0)) | |||||
$this->values = array($values); | |||||
} | |||||
@@ -877,7 +877,7 @@ class PLAAttribute { | |||||
if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) | |||||
debug_log('Entered (%%)',5,1,__FILE__,__LINE__,__METHOD__,$fargs,$this->name); | |||||
- return preg_replace('/;.*$/U','',$this->name); | |||||
+ return preg_replace('/;.*$/U','',is_null($this->name)? "":$this->name); | |||||
} | |||||
/** |