r40946 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r40945‎ | r40946 | r40947 >
Date:07:26, 17 September 2008
Author:werdna
Status:old
Tags:
Comment:
Work around misconfiguration by requiring strict comparisons for in_array in User::isAllowed(). See wikitech-l.
Modified paths:
  • /trunk/phase3/includes/User.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/User.php
@@ -2007,7 +2007,11 @@
20082008 // In the spirit of DWIM
20092009 return true;
20102010
2011 - return in_array( $action, $this->getRights() );
 2011+ // PHP is fucking stupid.
 2012+ // > $f = array( 'foo', 'bar', 'baz', 0, 'anne' );
 2013+ // > print in_array( 'blah', $f );
 2014+ // 1
 2015+ return in_array( $action, $this->getRights(), true );
20122016 }
20132017
20142018 /**

Follow-up revisions

RevisionCommit summaryAuthorDate
r40948Backport r40946: Work around misconfiguration by requiring strict comparisons...siebrand07:42, 17 September 2008
r40949Backport r40946: Work around misconfiguration by requiring strict comparisons...siebrand07:42, 17 September 2008