|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2003-04-06 09:46 UTC] scottmacvicar at ntlworld dot com
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 */
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 03 17:00:01 2025 UTC |
bug23071.phpt --TEST-- date('T') causes crash when DST is in effect and the DST timezone name is shorter than original timezone name --SKIPIF-- <?php if (!date('I')) die('DST not in effect'); ?> --FILE-- <?php var_dump(date('T')); ?> --EXPECT-- string(3) "BST"