From: scottmacvicar at ntlworld dot com
Operating system: Windows XP
PHP version: 4.3.2RC1
PHP Bug Type: Reproducible crash
Bug description: when trying to use the T flag in date it will crash if DST is in
operation
on windows this will crash Apache 2.0.45 using PHP built from this morning.
tname[1] value is BST but tname[0] value is GMT Standard Time.
<?php
date('T');
?>
patch is as follows
--- datetime.c Sun Feb 9 17:11:00 2003
+++ datetime.c.patched Sun Apr 6 10:41:52 2003
@@ -540,7 +540,11 @@
#if HAVE_TM_ZONE
strcat(Z_STRVAL_P(return_value),
ta->tm_zone);
#elif HAVE_TZNAME
- strcat(Z_STRVAL_P(return_value),
tname[0]);
+ if (ta->tm_isdst > 0 ) {
+ strcat(Z_STRVAL_P(return_value),
tname[1]);
+ } else {
+ strcat(Z_STRVAL_P(return_value),
tname[0]);
+ }
#endif
break;
case 'B': /* Swatch Beat a.k.a. Internet
Time */
--
Edit bug report at http://bugs.php.net/?id=23071&edit=1
--
Try a CVS snapshot: http://bugs.php.net/fix.php?id=23071&r=trysnapshot
Fixed in CVS: http://bugs.php.net/fix.php?id=23071&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=23071&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=23071&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=23071&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=23071&r=support
Expected behavior: http://bugs.php.net/fix.php?id=23071&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=23071&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=23071&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=23071&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=23071&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=23071&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=23071&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=23071&r=gnused