Merge pull request #62 from spagu/patch-1

Fix php7.2 errors for function __autoload and create_function as they were deprecated.
This commit is contained in:
Deon George 2019-04-18 12:31:49 +10:00 committed by GitHub
commit 49ef60f26b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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).
@ -1090,7 +1090,7 @@ function masort(&$data,$sortby,$rev=0) {
$code .= 'return $c;';
$CACHE[$sortby] = create_function('$a, $b',$code);
$CACHE[$sortby] = function($a, $b) { global $code; return $code; };
}
uasort($data,$CACHE[$sortby]);