wez Tue Oct 14 20:14:38 2003 EDT
Modified files: (Branch: PHP_4_3)
/php-src NEWS
/php-src/ext/standard basic_functions.c
Log:
Fix bug #25825. tzset() was not called when resetting the TZ env var.
In addition, fix a slight error (made by sniper!) which would trigger
tzset() to be called for any env var beginning with TZ, and not just
TZ itself.
Index: php-src/NEWS
diff -u php-src/NEWS:1.1247.2.436 php-src/NEWS:1.1247.2.437
--- php-src/NEWS:1.1247.2.436 Mon Oct 13 23:48:08 2003
+++ php-src/NEWS Tue Oct 14 20:14:36 2003
@@ -1,6 +1,8 @@
PHP 4 NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? Oct 2003, Version 4.3.4RC2
+- Fixed bug #25825 (tzset() was not called to reset libc environment
+ on request shutdown). (Wez)
- Fixed multibyte regex engine to properly handle ".*" pattern under
POSIX compatible mode. (K.Kosako <kosako at sofnec.co.jp>, Moriyoshi)
- Fixed bug #25836 (last key of multi-dimensional array passed via GPC not
Index: php-src/ext/standard/basic_functions.c
diff -u php-src/ext/standard/basic_functions.c:1.543.2.22
php-src/ext/standard/basic_functions.c:1.543.2.23
--- php-src/ext/standard/basic_functions.c:1.543.2.22 Mon Sep 29 10:02:55 2003
+++ php-src/ext/standard/basic_functions.c Tue Oct 14 20:14:37 2003
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: basic_functions.c,v 1.543.2.22 2003/09/29 14:02:55 stas Exp $ */
+/* $Id: basic_functions.c,v 1.543.2.23 2003/10/15 00:14:37 wez Exp $ */
#include "php.h"
#include "php_streams.h"
@@ -950,6 +950,12 @@
}
# endif
}
+ /* don't forget to reset the various libc globals that
+ * we might have changed by an earlier call to tzset(). */
+ if (!strncmp(pe->key, "TZ", pe->key_len)) {
+ tzset();
+ }
+
efree(pe->putenv_string);
efree(pe->key);
}
@@ -1347,7 +1353,7 @@
if (putenv(pe.putenv_string) == 0) { /* success */
zend_hash_add(&BG(putenv_ht), pe.key, pe.key_len+1, (void **)
&pe, sizeof(putenv_entry), NULL);
#ifdef HAVE_TZSET
- if (!strncmp(pe.key, "TZ", 2)) {
+ if (!strncmp(pe.key, "TZ", pe.key_len)) {
tzset();
}
#endif
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php