MDL-60280 auth_cas: patch phpCAS for PHP 7.2
authorMarina Glancy <marina@moodle.com>
Mon, 2 Oct 2017 10:11:35 +0000 (18:11 +0800)
committerMarina Glancy <marina@moodle.com>
Mon, 9 Oct 2017 02:04:48 +0000 (10:04 +0800)
auth/cas/CAS/CAS/Autoload.php
auth/cas/CAS/moodle_readme.txt

index e56dbdf..5e9b140 100644 (file)
@@ -74,32 +74,17 @@ function CAS_autoload($class)
 }
 
 // set up __autoload
-if (function_exists('spl_autoload_register')) {
-    if (!(spl_autoload_functions())
-        || !in_array('CAS_autoload', spl_autoload_functions())
+if (!(spl_autoload_functions())
+    || !in_array('CAS_autoload', spl_autoload_functions())
+) {
+    spl_autoload_register('CAS_autoload');
+    if (function_exists('__autoload')
+        && !in_array('__autoload', spl_autoload_functions())
     ) {
-        spl_autoload_register('CAS_autoload');
-        if (function_exists('__autoload')
-            && !in_array('__autoload', spl_autoload_functions())
-        ) {
-            // __autoload() was being used, but now would be ignored, add
-            // it to the autoload stack
-            spl_autoload_register('__autoload');
-        }
-    }
-} elseif (!function_exists('__autoload')) {
-
-    /**
-     * Autoload a class
-     *
-     * @param string $class Class name
-     *
-     * @return bool
-     */
-    function __autoload($class)
-    {
-        return CAS_autoload($class);
+        // __autoload() was being used, but now would be ignored, add
+        // it to the autoload stack
+        spl_autoload_register('__autoload');
     }
 }
 
-?>
\ No newline at end of file
+?>
index 62f9f91..b368b32 100644 (file)
@@ -1,3 +1,4 @@
 Description of phpCAS 1.3.5 library import
 
 * downloaded from http://downloads.jasig.org/cas-clients/php/current/
+* applied patch https://github.com/apereo/phpCAS/pull/247 for PHP 7.2 compatibility (MDL-60280)
\ No newline at end of file