diff options
author | Dmitry Stogov <dmitry@zend.com> | 2015-01-09 01:41:13 +0300 |
---|---|---|
committer | Dmitry Stogov <dmitry@zend.com> | 2015-01-09 01:41:13 +0300 |
commit | 7b4808a6471655b44e65cfb4585c01f2efea444a (patch) | |
tree | 079cd73b2731c42112c96d8cab2b0a0c8b527348 /ext/standard/basic_functions.c | |
parent | ed8ebd6ce40650d54a283e3296151d86e12d7ece (diff) | |
download | php-git-7b4808a6471655b44e65cfb4585c01f2efea444a.tar.gz |
Fixed bug #68636 (setlocale no longer returns current value per category).
Diffstat (limited to 'ext/standard/basic_functions.c')
-rw-r--r-- | ext/standard/basic_functions.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index ed5206aa69..02001f5433 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -3708,6 +3708,7 @@ PHP_RINIT_FUNCTION(basic) /* {{{ */ ZVAL_UNDEF(&BG(strtok_zval)); BG(strtok_last) = NULL; BG(locale_string) = NULL; + BG(locale_changed) = 0; BG(array_walk_fci) = empty_fcall_info; BG(array_walk_fci_cache) = empty_fcall_info_cache; BG(user_compare_fci) = empty_fcall_info; @@ -3756,12 +3757,14 @@ PHP_RSHUTDOWN_FUNCTION(basic) /* {{{ */ /* Check if locale was changed and change it back * to the value in startup environment */ - if (BG(locale_string) != NULL) { + if (BG(locale_changed)) { setlocale(LC_ALL, "C"); setlocale(LC_CTYPE, ""); zend_update_current_locale(); - zend_string_release(BG(locale_string)); - BG(locale_string) = NULL; + if (BG(locale_string)) { + zend_string_release(BG(locale_string)); + BG(locale_string) = NULL; + } } /* FG(stream_wrappers) and FG(stream_filters) are destroyed |