summaryrefslogtreecommitdiff
path: root/net/phpldapadmin/files/patch-htdocs_schema.php
blob: 191d2a2b16479ce7c37fd8658c9714f14c95b15f (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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
--- htdocs/schema.php.orig	2021-12-12 02:35:51 UTC
+++ htdocs/schema.php
@@ -25,7 +25,7 @@ $entry['value'] = get_request('viewvalue','GET');
 
 if (! is_null($entry['value'])) {
 	$entry['viewed'] = false;
-	$entry['value'] = strtolower($entry['value']);
+	$entry['value'] = strtolower((string) $entry['value']);
 }
 
 $schema_error_str = sprintf('%s <b>%s</b>.<br /><br /></div>%s<ul><li>%s</li><li>%s</li><li>%s</li><li>%s</li></ul>',
@@ -149,12 +149,12 @@ switch($entry['view']) {
 		echo '<br />';
 
 		foreach ($sattrs as $attr) {
-			if (isAjaxEnabled() || (is_null($entry['value']) || ! trim($entry['value']) || $entry['value']==$attr->getName())) {
-				if ((! is_null($entry['value']) && $entry['value']==$attr->getName()) || ! trim($entry['value']))
+			if (isAjaxEnabled() || (is_null($entry['value']) || ! trim((string) $entry['value']) || $entry['value']==$attr->getName())) {
+				if ((! is_null($entry['value']) && $entry['value']==$attr->getName()) || ! trim((string) $entry['value']))
 					$entry['viewed'] = true;
 
 				if (isAjaxEnabled() && $entry['value'])
-					printf('<div id="at%s" style="display: %s">',$attr->getName(),strcasecmp($entry['value'],$attr->getName()) ? 'none' : 'block');
+					printf('<div id="at%s" style="display: %s">',(string) $attr->getName(),strcasecmp((string) $entry['value'],(string) $attr->getName()) ? 'none' : 'block');
 				else
 					printf('<div id="at%s">',$attr->getName());
 
@@ -193,10 +193,10 @@ switch($entry['view']) {
 								printf('(%s)',_('none'));
 
 							else {
-								$href = htmlspecialchars(sprintf('%s&viewvalue=%s',$entry['href']['attributes'],strtolower($attr->getSupAttribute())));
+								$href = htmlspecialchars(sprintf('%s&viewvalue=%s',$entry['href']['attributes'],strtolower((string) $attr->getSupAttribute())));
 								if (isAjaxEnabled())
 									printf('<a href="cmd.php?%s" onclick="return ajSHOWSCHEMA(\'attributes\',\'at\',\'%s\');">%s</a>',
-										$href,strtolower($attr->getSupAttribute()),$attr->getSupAttribute());
+										$href,strtolower((string) $attr->getSupAttribute()),$attr->getSupAttribute());
 								else
 									printf('<a href="cmd.php?%s">%s</a>',$href,$attr->getSupAttribute());
 							}
@@ -287,10 +287,10 @@ switch($entry['view']) {
 
 							else
 								foreach ($attr->getAliases() as $alias) {
-									$href = htmlspecialchars(sprintf('%s&viewvalue=%s',$entry['href']['attributes'],strtolower($alias)));
+									$href = htmlspecialchars(sprintf('%s&viewvalue=%s',$entry['href']['attributes'],strtolower((string) $alias)));
 									if (isAjaxEnabled())
 										printf('<a href="cmd.php?%s" onclick="return ajSHOWSCHEMA(\'attributes\',\'at\',\'%s\');">%s</a>',
-											$href,strtolower($alias),$alias);
+											$href,strtolower((string) $alias),$alias);
 									else
 										printf('<a href="cmd.php?%s">%s</a>',$href,$alias);
 								}
@@ -306,10 +306,10 @@ switch($entry['view']) {
 
 							else
 								foreach ($attr->getUsedInObjectClasses() as $objectclass) {
-									$href = htmlspecialchars(sprintf('%s&viewvalue=%s',$entry['href']['objectclasses'],strtolower($objectclass)));
+									$href = htmlspecialchars(sprintf('%s&viewvalue=%s',$entry['href']['objectclasses'],strtolower((string) $objectclass)));
 									if (isAjaxEnabled())
 										printf('<a href="cmd.php?%s" onclick="return ajJUMP(\'%s\',\'%s\',\'%s\');">%s</a> ',
-											$href,$href,_('ObjectClasses'),strtolower($objectclass),$objectclass);
+											$href,$href,_('ObjectClasses'),strtolower((string) $objectclass),$objectclass);
 									else
 										printf('<a href="cmd.php?%s">%s</a> ',$href,$objectclass);
 								}
@@ -379,8 +379,8 @@ switch($entry['view']) {
 			$oid = $rule->getOID();
 			$desc = $rule->getName(false);
 
-			if (isAjaxEnabled() || (is_null($entry['value']) || ! trim($entry['value']) || $entry['value']==$rule->getName())) {
-				if ((! is_null($entry['value']) && $entry['value']==$rule->getName()) || ! trim($entry['value']))
+			if (isAjaxEnabled() || (is_null($entry['value']) || ! trim((string) $entry['value']) || $entry['value']==$rule->getName())) {
+				if ((! is_null($entry['value']) && $entry['value']==$rule->getName()) || ! trim((string) $entry['value']))
 					$entry['viewed'] = true;
 
 				if (null != $rule->getDescription())
@@ -391,7 +391,7 @@ switch($entry['view']) {
 
 				if (isAjaxEnabled() && $entry['value'])
 					printf('<tr class="%s" id="mr%s" style="display: %s">',$counter%2 ? 'odd' : 'even',$rule->getName(),
-						strcasecmp($entry['value'],$rule->getName()) ? 'none' : '');
+						strcasecmp((string) $entry['value'],(string) $rule->getName()) ? 'none' : '');
 				else
 					printf('<tr class="%s" id="mr%s">',$counter%2 ? 'odd' : 'even',$rule->getName());
 				printf('<td>%s</td>',$oid);
@@ -467,12 +467,12 @@ switch($entry['view']) {
 		echo '<br />';
 
 		foreach ($socs as $name => $oclass) {
-			if (isAjaxEnabled() || (is_null($entry['value']) || ! trim($entry['value']) || $entry['value']==$oclass->getName())) {
-				if ((! is_null($entry['value']) && $entry['value']==$oclass->getName()) || ! trim($entry['value']))
+			if (isAjaxEnabled() || (is_null($entry['value']) || ! trim((string) $entry['value']) || $entry['value']==$oclass->getName())) {
+				if ((! is_null($entry['value']) && $entry['value']==$oclass->getName()) || ! trim((string) $entry['value']))
 					$entry['viewed'] = true;
 
 				if (isAjaxEnabled() && $entry['value'])
-					printf('<div id="oc%s" style="display: %s">',$oclass->getName(),strcasecmp($entry['value'],$oclass->getName()) ? 'none' : '');
+					printf('<div id="oc%s" style="display: %s">',(string) $oclass->getName(),strcasecmp((string) $entry['value'],(string) $oclass->getName()) ? 'none' : '');
 				else
 					printf('<div id="oc%s">',$oclass->getName());
 
@@ -494,10 +494,10 @@ switch($entry['view']) {
 
 				else
 					foreach ($oclass->getSupClasses() as $i => $object_class) {
-						$href = htmlspecialchars(sprintf('%s&viewvalue=%s',$entry['href']['objectclasses'],strtolower($object_class)));
+						$href = htmlspecialchars(sprintf('%s&viewvalue=%s',$entry['href']['objectclasses'],strtolower((string) $object_class)));
 						if (isAjaxEnabled())
 							printf('<a href="cmd.php?%s" onclick="return ajSHOWSCHEMA(\'objectclasses\',\'oc\',\'%s\');">%s</a>',
-								$href,strtolower($object_class),$object_class);
+								$href,strtolower((string) $object_class),$object_class);
 						else
 							printf('<a href="cmd.php?%s&viewvalue=%s" title="%s">%s</a>',
 								$href,$object_class,_('Jump to this objectClass definition'),$object_class);
@@ -508,7 +508,7 @@ switch($entry['view']) {
 				echo '</b></td></tr>';
 
 				printf('<tr class="odd"><td colspan="4">%s: <b>',_('Parent to'));
-				if (strcasecmp($oclass->getName(),'top') == 0) {
+				if (strcasecmp((string) $oclass->getName(),'top') == 0) {
 					$href = htmlspecialchars($entry['href']['objectclasses']);
 					if (isAjaxEnabled())
 						printf('<a href="cmd.php?%s" onclick="return ajSHOWSCHEMA(\'objectclasses\',\'oc\',\'\');">all</a>',
@@ -521,10 +521,10 @@ switch($entry['view']) {
 
 				else
 					foreach ($oclass->getChildObjectClasses() as $i => $object_class) {
-						$href = htmlspecialchars(sprintf('%s&viewvalue=%s',$entry['href']['objectclasses'],strtolower($object_class)));
+						$href = htmlspecialchars(sprintf('%s&viewvalue=%s',$entry['href']['objectclasses'],strtolower((string) $object_class)));
 						if (isAjaxEnabled())
 							printf('<a href="cmd.php?%s" title="%s" onclick="return ajSHOWSCHEMA(\'objectclasses\',\'oc\',\'%s\');">%s</a>',
-								$href,_('Jump to this objectClass definition'),strtolower($object_class),$object_class);
+								$href,_('Jump to this objectClass definition'),strtolower((string) $object_class),$object_class);
 						else
 							printf('<a href="cmd.php?%s" title="%s">%s</a>',$href,_('Jump to this objectClass definition'),$object_class);
 
@@ -553,11 +553,11 @@ switch($entry['view']) {
 
 						if ($attr->getSource() != $oclass->getName(false)) {
 							echo '<br />';
-							$href = htmlspecialchars(sprintf('%s&viewvalue=%s',$entry['href']['objectclasses'],strtolower($attr->getSource())));
+							$href = htmlspecialchars(sprintf('%s&viewvalue=%s',$entry['href']['objectclasses'],strtolower((string) $attr->getSource())));
 							printf('<small>(%s ',_('Inherited from'));
 							if (isAjaxEnabled())
 								printf('<a href="cmd.php?%s" title="%s" onclick="return ajSHOWSCHEMA(\'objectclasses\',\'oc\',\'%s\');">%s</a>',
-									$href,_('Jump to this objectClass definition'),strtolower($attr->getSource()),$attr->getSource());
+									$href,_('Jump to this objectClass definition'),strtolower((string) $attr->getSource()),$attr->getSource());
 							else
 								printf('<a href="cmd.php?%s">%s</a>',$href,$attr->getSource());
 							echo ')</small>';
@@ -586,11 +586,11 @@ switch($entry['view']) {
 
 						if ($attr->getSource() != $oclass->getName(false)) {
 							echo '<br />';
-							$href = htmlspecialchars(sprintf('%s&viewvalue=%s',$entry['href']['objectclasses'],strtolower($attr->getSource())));
+							$href = htmlspecialchars(sprintf('%s&viewvalue=%s',$entry['href']['objectclasses'],strtolower((string) $attr->getSource())));
 							printf('<small>(%s ',_('Inherited from'));
 							if (isAjaxEnabled())
 								printf('<a href="cmd.php?%s" title="%s" onclick="return ajSHOWSCHEMA(\'objectclasses\',\'oc\',\'%s\');">%s</a>',
-									$href,_('Jump to this objectClass definition'),strtolower($attr->getSource()),$attr->getSource());
+									$href,_('Jump to this objectClass definition'),strtolower((string) $attr->getSource()),$attr->getSource());
 							else
 								printf('<a href="cmd.php?%s">%s</a>',$href,$attr->getSource());
 							echo ')</small>';