Doc #64069 [NEW]: Function strcasecmp will return NULL if it gets an array.

From: Date: Fri, 25 Jan 2013 08:55:24 +0000
Subject: Doc #64069 [NEW]: Function strcasecmp will return NULL if it gets an array.
Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-9474@lists.php.net to get a copy of this message
From: cayce245 at gmail dot com Operating system: PHP version: Irrelevant Package: Documentation problem Bug Type: Documentation Problem Bug description:Function strcasecmp will return NULL if it gets an array. Description: ------------ --- From manual page: http://www.php.net/function.strcasecmp#refsect1- function.strcasecmp-returnvalues --- Function strcasecmp will return NULL if it gets an array. Now it seems that function will return only an integer, and this assumption can be a security risk, like in the example bellow. Test script: --------------- <?php $pass = isset($_GET['pass'])?$_GET['pass']:''; // Query /?pass=[] will authorize user if ( strcasecmp( $pass, '123456' ) == 0 ) { echo 'You successfully logged in.'; } -- Edit bug report at https://bugs.php.net/bug.php?id=64069&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=64069&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=64069&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=64069&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=64069&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=64069&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=64069&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=64069&r=needscript Try newer version: https://bugs.php.net/fix.php?id=64069&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=64069&r=support Expected behavior: https://bugs.php.net/fix.php?id=64069&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=64069&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=64069&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=64069&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=64069&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=64069&r=dst IIS Stability: https://bugs.php.net/fix.php?id=64069&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=64069&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=64069&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=64069&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=64069&r=mysqlcfg

« previous php.doc.bugs (#9474) next »