r41050 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r41049‎ | r41050 | r41051 >
Date:03:50, 20 September 2008
Author:tstarling
Status:old
Tags:
Comment:
More descriptive comment for r40948/r40949
Modified paths:
  • /branches/REL1_12/phase3/includes/User.php (modified) (history)
  • /branches/REL1_13/phase3/includes/User.php (modified) (history)

Diff [purge]

Index: branches/REL1_12/phase3/includes/User.php
@@ -1762,10 +1762,8 @@
17631763 // In the spirit of DWIM
17641764 return true;
17651765
1766 - // PHP is stupid.
1767 - // > $f = array( 'foo', 'bar', 'baz', 0, 'anne' );
1768 - // > print in_array( 'blah', $f );
1769 - // 1
 1766+ # Use strict parameter to avoid matching numeric 0 accidentally inserted
 1767+ # by misconfiguration: 0 == 'foo'
17701768 return in_array( $action, $this->getRights(), true );
17711769 }
17721770
Index: branches/REL1_13/phase3/includes/User.php
@@ -1859,10 +1859,8 @@
18601860 // In the spirit of DWIM
18611861 return true;
18621862
1863 - // PHP is stupid.
1864 - // > $f = array( 'foo', 'bar', 'baz', 0, 'anne' );
1865 - // > print in_array( 'blah', $f );
1866 - // 1
 1863+ # Use strict parameter to avoid matching numeric 0 accidentally inserted
 1864+ # by misconfiguration: 0 == 'foo'
18671865 return in_array( $action, $this->getRights(), true );
18681866 }
18691867

Past revisions this follows-up on

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