Index: branches/REL1_12/phase3/includes/User.php |
— | — | @@ -1762,10 +1762,8 @@ |
1763 | 1763 | // In the spirit of DWIM |
1764 | 1764 | return true; |
1765 | 1765 | |
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' |
1770 | 1768 | return in_array( $action, $this->getRights(), true ); |
1771 | 1769 | } |
1772 | 1770 | |
Index: branches/REL1_13/phase3/includes/User.php |
— | — | @@ -1859,10 +1859,8 @@ |
1860 | 1860 | // In the spirit of DWIM |
1861 | 1861 | return true; |
1862 | 1862 | |
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' |
1867 | 1865 | return in_array( $action, $this->getRights(), true ); |
1868 | 1866 | } |
1869 | 1867 | |