From ddee87204e45667cacc5af86c7aadba550df528a Mon Sep 17 00:00:00 2001 From: Andrew Garrett Date: Wed, 17 Sep 2008 07:26:34 +0000 Subject: [PATCH] Work around misconfiguration by requiring strict comparisons for in_array in User::isAllowed(). See wikitech-l. --- includes/User.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 ); } /** -- 2.20.1