From: php at evilcode dot net Operating system: FreeBSD/Linux PHP version: 5.2.6 PHP Bug Type: Feature/Change Request Bug description: setcookie will output expires years of >4 digits
Description: ------------ setcookie() will happily produce expires times with years greater than 4 digits in length. This violates various RFC's and can also lead to unexpectedly hung scripts (especially on 64-bit). Reproduce code: --------------- This works fine on 32-bit, but will keep the script looping effectively forever formatting the date as GMT on 64-bit. setcookie('test', 'testing', PHP_INT_MAX); Sample patch: http://evilcode.net/sjg/php5.2.6-setcookie-head.c.patch This may not be the right place for this, as there are probably other violators as well. A more general/generic fix may be in order. Expected result: ---------------- Date output should be trimmed to the end of year 9999, possibly a warning presented. -- Edit bug report at http://bugs.php.net/?id=45141&edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=45141&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=45141&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=45141&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=45141&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=45141&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=45141&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=45141&r=needscript Try newer version: http://bugs.php.net/fix.php?id=45141&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=45141&r=support Expected behavior: http://bugs.php.net/fix.php?id=45141&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=45141&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=45141&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=45141&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=45141&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=45141&r=dst IIS Stability: http://bugs.php.net/fix.php?id=45141&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=45141&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=45141&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=45141&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=45141&r=mysqlcfg