Work around misconfiguration by requiring strict comparisons for in_array in User...
authorAndrew Garrett <werdna@users.mediawiki.org>
Wed, 17 Sep 2008 07:26:34 +0000 (07:26 +0000)
committerAndrew Garrett <werdna@users.mediawiki.org>
Wed, 17 Sep 2008 07:26:34 +0000 (07:26 +0000)
includes/User.php

index bc4b131..563274d 100644 (file)
@@ -2007,7 +2007,11 @@ class User {
                        // In the spirit of DWIM
                        return true;
 
-               return in_array( $action, $this->getRights() );
+               // PHP is fucking stupid.
+               // > $f = array( 'foo', 'bar', 'baz', 0, 'anne' );
+               // > print in_array( 'blah', $f );
+               // 1
+               return in_array( $action, $this->getRights(), true );
        }
 
        /**