* Make User::isAllowed return true if passed an empty string
authorÆvar Arnfjörð Bjarmason <avar@users.mediawiki.org>
Wed, 21 Dec 2005 05:15:26 +0000 (05:15 +0000)
committerÆvar Arnfjörð Bjarmason <avar@users.mediawiki.org>
Wed, 21 Dec 2005 05:15:26 +0000 (05:15 +0000)
includes/User.php

index 60e06fb..ad81edd 100644 (file)
@@ -1118,6 +1118,10 @@ class User {
         * @return boolean True: action is allowed, False: action should not be allowed
         */
        function isAllowed($action='') {
+               if ( $action === '' )
+                       // In the spirit of DWIM
+                       return true;
+
                $this->loadFromDatabase();
                return in_array( $action , $this->mRights );
        }