From: Andrew Garrett Date: Wed, 17 Sep 2008 07:26:34 +0000 (+0000) Subject: Work around misconfiguration by requiring strict comparisons for in_array in User... X-Git-Tag: 1.31.0-rc.0~45250 X-Git-Url: http://git.cyclocoop.org/%22.%24image2.%22?a=commitdiff_plain;h=ddee87204e45667cacc5af86c7aadba550df528a;p=lhc%2Fweb%2Fwiklou.git Work around misconfiguration by requiring strict comparisons for in_array in User::isAllowed(). See wikitech-l. --- diff --git a/includes/User.php b/includes/User.php index bc4b13192c..563274daaa 100644 --- a/includes/User.php +++ b/includes/User.php @@ -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 ); } /**