summaryrefslogtreecommitdiff
path: root/net/phpldapadmin/files/patch-lib_Attribute.php
blob: 4d3d129dd577a6b492deda7821a9c48783c8d4f3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
--- lib/Attribute.php.orig	2021-12-12 02:35:51 UTC
+++ lib/Attribute.php
@@ -133,9 +133,9 @@ class PLAAttribute {
 			debug_log('Entered (%%)',5,0,__FILE__,__LINE__,__METHOD__,$fargs,$this->name);
 
 		if ($real)
-			return $lower ? strtolower($this->name) : $this->name;
+			return $lower ? strtolower((string) $this->name) : $this->name;
 		else
-			return $lower ? strtolower($this->real_attr_name()) : $this->real_attr_name();
+			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);
 	}
 
 	/**