From c5fec9e09d313b1812791e9a1c27cf422a1a8807 Mon Sep 17 00:00:00 2001 From: Lior Kaplan Date: Tue, 1 Jul 2014 01:57:01 +0300 Subject: Add newline at end of file to prevent compilation warning The newline was removed at commit 50d50c2f --- Zend/zend_vm_opcodes.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Zend/zend_vm_opcodes.h b/Zend/zend_vm_opcodes.h index 331bc7a187..5e4bf4d05a 100644 --- a/Zend/zend_vm_opcodes.h +++ b/Zend/zend_vm_opcodes.h @@ -165,4 +165,4 @@ ZEND_API const char *zend_get_opcode_name(zend_uchar opcode); #define ZEND_QM_ASSIGN_VAR 157 #define ZEND_JMP_SET_VAR 158 -#endif \ No newline at end of file +#endif -- cgit v1.2.1 From 716d2a3937b4590772212b563127810eb4aad672 Mon Sep 17 00:00:00 2001 From: Lior Kaplan Date: Tue, 1 Jul 2014 11:44:39 +0300 Subject: Make sure the generator script also creates a newline at the end of file Similar to commit d6713f39 in master --- Zend/zend_vm_gen.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Zend/zend_vm_gen.php b/Zend/zend_vm_gen.php index 4bab9e5e3d..2e244eb5ad 100644 --- a/Zend/zend_vm_gen.php +++ b/Zend/zend_vm_gen.php @@ -1210,7 +1210,7 @@ function gen_vm($def, $skel) { fputs($f,"#define $op $code\n"); } - fputs($f, "\n#endif"); + fputs($f, "\n#endif\n"); fclose($f); echo "zend_vm_opcodes.h generated successfully.\n"; -- cgit v1.2.1 From 6c8a570a969b262d233350829ead759364a29e82 Mon Sep 17 00:00:00 2001 From: Stanislav Malyshev Date: Mon, 7 Jul 2014 00:36:57 -0700 Subject: Fix bug #67052 (NumberFormatter::parse() resets LC_NUMERIC setting) --- NEWS | 6 +++++- ext/intl/formatter/formatter_parse.c | 5 ++++- ext/intl/tests/bug14562.phpt | 1 + ext/intl/tests/bug67052.phpt | 25 +++++++++++++++++++++++++ 4 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 ext/intl/tests/bug67052.phpt diff --git a/NEWS b/NEWS index 44196a3e1a..3fb47817f0 100644 --- a/NEWS +++ b/NEWS @@ -16,7 +16,11 @@ PHP NEWS (Adam) - FPM: - . Fix bug #67531 (syslog cannot be set in pool configuration). (Remi) + . Fixed bug #67531 (syslog cannot be set in pool configuration). (Remi) + +- Intl: + . Fixed bug #67052 (NumberFormatter::parse() resets LC_NUMERIC setting). + (Stas) - pgsql: . Fix bug #67550 (Error in code "form" instead of "from", pgsql.c, line 756), diff --git a/ext/intl/formatter/formatter_parse.c b/ext/intl/formatter/formatter_parse.c index 6f3a3a12b5..0c8704d95c 100644 --- a/ext/intl/formatter/formatter_parse.c +++ b/ext/intl/formatter/formatter_parse.c @@ -73,7 +73,9 @@ PHP_FUNCTION( numfmt_parse ) } #if ICU_LOCALE_BUG && defined(LC_NUMERIC) - oldlocale = setlocale(LC_NUMERIC, "C"); + /* need to copy here since setlocale may change it later */ + oldlocale = estrdup(setlocale(LC_NUMERIC, NULL)); + setlocale(LC_NUMERIC, "C"); #endif switch(type) { @@ -100,6 +102,7 @@ PHP_FUNCTION( numfmt_parse ) } #if ICU_LOCALE_BUG && defined(LC_NUMERIC) setlocale(LC_NUMERIC, oldlocale); + efree(oldlocale); #endif if(zposition) { zval_dtor(zposition); diff --git a/ext/intl/tests/bug14562.phpt b/ext/intl/tests/bug14562.phpt index 3256268405..7cf927f7e7 100644 --- a/ext/intl/tests/bug14562.phpt +++ b/ext/intl/tests/bug14562.phpt @@ -15,6 +15,7 @@ function ut_main() setlocale(LC_ALL, $de_locale); $fmt = new NumberFormatter("de", NumberFormatter::DECIMAL ); $numeric = $fmt->parse("1234,56"); + setlocale(LC_ALL, "C"); // reset for printing $res_str .= "$numeric\n"; return $res_str; } diff --git a/ext/intl/tests/bug67052.phpt b/ext/intl/tests/bug67052.phpt new file mode 100644 index 0000000000..59579395dd --- /dev/null +++ b/ext/intl/tests/bug67052.phpt @@ -0,0 +1,25 @@ +--TEST-- +Bug #67052 - NumberFormatter::parse() resets LC_NUMERIC setting +--SKIPIF-- + +--FILE-- +parse($num)."\n"; + $res_str .= setlocale(LC_NUMERIC, 0); + return $res_str; +} + +include_once( 'ut_common.inc' ); +ut_run(); + +?> +--EXPECT-- +1234567,891 +sl_SI.UTF-8 -- cgit v1.2.1