From 56fac96bec882ac59a7fc298c98407bf4a17629d Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Fri, 21 Nov 2014 09:57:12 +0100 Subject: partially fixed bug #66265 NTS mode should additionally use _putenv to satisfy libs like gettext relying on _getenv. As _putenv isn't thread safe, it wouldn't bring much for the TS mode as it would change locale across all the threads and require locking to avoid random fails with concurrent _getenv calls. --- ext/standard/basic_functions.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'ext/standard/basic_functions.c') diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index ace6540a04..cadbb7f2e5 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -4138,13 +4138,17 @@ PHP_FUNCTION(putenv) if (putenv(pe.putenv_string) == 0) { /* success */ # else error_code = SetEnvironmentVariable(pe.key, value); -# if _MSC_VER < 1500 - /* Yet another VC6 bug, unset may return env not found */ - if (error_code != 0 || - (error_code == 0 && GetLastError() == ERROR_ENVVAR_NOT_FOUND)) { -# else - if (error_code != 0) { /* success */ -# endif + + if (error_code != 0 +# ifndef ZTS + /* We need both SetEnvironmentVariable and _putenv here as some + dependency lib could use either way to read the environment. + Obviously the CRT version will be useful more often. But + generally, doing both brings us on the safe track at least + in NTS build. */ + && _putenv(pe.putenv_string) == 0 +# endif + ) { /* success */ # endif #endif zend_hash_add(&BG(putenv_ht), pe.key, pe.key_len + 1, (void **) &pe, sizeof(putenv_entry), NULL); -- cgit v1.2.1 From a023e032b952ad464bc994f3a68b6273ff26bf28 Mon Sep 17 00:00:00 2001 From: Alexander Lisachenko Date: Fri, 14 Nov 2014 15:36:56 +0300 Subject: Fix incorrect argument reflection info for array_multisort() --- ext/standard/basic_functions.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'ext/standard/basic_functions.c') diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index 694ce5be27..c6fe61dd55 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -549,12 +549,9 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_array_multisort, 0, 0, 1) ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, arr1) /* ARRAY_INFO(0, arg1, 0) */ - ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, SORT_ASC_or_SORT_DESC) - ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, SORT_REGULAR_or_SORT_NUMERIC_or_SORT_STRING) - ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, arr2) - ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, SORT_ASC_or_SORT_DESC) - ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, SORT_REGULAR_or_SORT_NUMERIC_or_SORT_STRING) - ZEND_ARG_VARIADIC_INFO(ZEND_SEND_PREFER_REF, more_array_and_sort_options) + ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, sort_order) + ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, sort_flags) + ZEND_ARG_VARIADIC_INFO(ZEND_SEND_PREFER_REF, arr2) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_array_rand, 0, 0, 1) -- cgit v1.2.1