aboutsummaryrefslogtreecommitdiffstats
path: root/community/phpldapadmin/php72-db8a98c7a5ae6352018e2a2673e3d24df03f3e48.patch
blob: d1bbf2f84452aed346de3076695bf5506403761c (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
diff --git a/lib/functions.php.orig b/lib/functions.php
index 528c7cc..2ab9999 100644
--- a/lib/functions.php.orig
+++ b/lib/functions.php
@@ -51,7 +51,7 @@ if (file_exists(LIBDIR.'functions.custom.php'))
 /**
  * Loads class definition
  */
-function __autoload($className) {
+spl_autoload_register(function($className) {
 	if (file_exists(HOOKSDIR."classes/$className.php"))
 		require_once(HOOKSDIR."classes/$className.php");
 	elseif (file_exists(LIBDIR."$className.php"))
@@ -64,7 +64,7 @@ function __autoload($className) {
 			'body'=>sprintf('%s: %s [%s]',
 				__METHOD__,_('Called to load a class that cant be found'),$className),
 			'type'=>'error'));
-}
+});
 
 /**
  * Strips all slashes from the specified array in place (pass by ref).
@@ -1029,7 +1029,7 @@ function masort(&$data,$sortby,$rev=0) {
 			$code .= "	} else\n";
 			$code .= "		\$bb = \$b->$key;\n";
 
-			$code .= "	if (\$aa != \$bb)";
+			$code .= "	if (\$aa != \$bb)\n";
 			if ($rev)
 				$code .= "	return (\$aa < \$bb ? 1 : -1);\n";
 			else
@@ -1080,7 +1080,7 @@ function masort(&$data,$sortby,$rev=0) {
 
 		$code .= 'return $c;';
 
-		$CACHE[$sortby] = create_function('$a, $b',$code);
+		$CACHE[$sortby] = function($a, $b) { global $code; eval($code); };
 	}
 
 	uasort($data,$CACHE[$sortby]);