]> git.mjollnir.org Git - moodle.git/commitdiff
accesslib: Fix dirty paths checks on PHPv4
authormartinlanghoff <martinlanghoff>
Wed, 19 Sep 2007 07:25:37 +0000 (07:25 +0000)
committermartinlanghoff <martinlanghoff>
Wed, 19 Sep 2007 07:25:37 +0000 (07:25 +0000)
$DIRTYPATHS and its derivatives are all arrays. Not objects.

Drop the silly -> notation.

lib/accesslib.php

index d21f70f756a4e912eef957b0ccbb3e0b7a145a07..f38e580027200d7a01ccadb0c84135c5dcb63d88 100755 (executable)
@@ -327,7 +327,7 @@ function has_capability($capability, $context=NULL, $userid=NULL, $doanything=tr
 
         // Check basepath only once, when
         // we load the dirty contexts...
-        if (isset($DIRTYCONTEXTS->{$basepath})) {
+        if (isset($DIRTYCONTEXTS[$basepath])) {
             // sitewide change, dirty
             $clean = false;
         }
@@ -4596,7 +4596,7 @@ function is_contextpath_clean($path, $dirty) {
     }
 
     // is _this_ context dirty?
-    if (isset($dirty->{$path})) {
+    if (isset($dirty[$path])) {
         return false;
     }
     while (preg_match('!^(/.+)/\d+$!', $path, $matches)) {
@@ -4606,7 +4606,7 @@ function is_contextpath_clean($path, $dirty) {
             // assume caller did it already
             return true;
         }
-        if (isset($dirty->{$path})) {
+        if (isset($dirty[$path])) {
             return false;
         }
     }