diff options
author | Wez Furlong <wez@php.net> | 2003-10-15 00:18:53 +0000 |
---|---|---|
committer | Wez Furlong <wez@php.net> | 2003-10-15 00:18:53 +0000 |
commit | 54d176965306e1cf9b8df378dc85271da6ec3386 (patch) | |
tree | 23d59c3619357d61ebcd264aa40a2d36eeabe543 | |
parent | 54a31f5a88f5c113ecf8a57b93d9886e06290c9e (diff) | |
download | php-git-54d176965306e1cf9b8df378dc85271da6ec3386.tar.gz |
MFB Fix for #25825
-rw-r--r-- | ext/standard/basic_functions.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index c8e45c71fa..a2a11e398c 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -1024,6 +1024,14 @@ static void php_putenv_destructor(putenv_entry *pe) } # endif } +#ifdef HAVE_TZSET + /* 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(); + } +#endif + efree(pe->putenv_string); efree(pe->key); } @@ -1423,7 +1431,7 @@ PHP_FUNCTION(putenv) 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 |