Re: cvs: php-src(PHP_5_2) / NEWS /ext/standard math.c /ext/standard/tests/strings bug39873.phpt
| From: | Hannes Magnusson | Date: | Fri, 22 Dec 2006 15:56:04 +0000 |
| Subject: | Re: cvs: php-src(PHP_5_2) / NEWS /ext/standard math.c /ext/standard/tests/strings bug39873.phpt | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-27186@lists.php.net to get a copy of this message | ||
Hi Ilia, all
This fix is incorrect..
%f became locale aware internally after the recent *printf changes
causing all kinds of side affects like this one.
We should:
a) revert that change (i.e. make %f not locale aware again) (see
attached patch against 5_2) or
b) keep %f locale aware internally and search our code base and change %f to %F
I vote for option a since option b will break all 3rd party extensions
assuming that %f isn't locale aware.
-Hannes
On 12/22/06, Ilia Alshanetsky <iliaa@php.net> wrote:
iliaa Fri Dec 22 04:03:15 2006 UTCAdded files: (Branch: PHP_5_2) /php-src/ext/standard/tests/strings bug39873.phptModified files:/php-src NEWS /php-src/ext/standard math.cLog: Fixed bug #39873 (number_format() breaks with locale & decimal points). http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.450&r2=1.2027.2.547.2.451&diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.450 php-src/NEWS:1.2027.2.547.2.451--- php-src/NEWS:1.2027.2.547.2.450 Thu Dec 21 09:12:42 2006 +++ php-src/NEWS Fri Dec 22 04:03:14 2006@@ -19,6 +19,8 @@ - Fixed bug #39903 (Notice message when executing __halt_compiler() more than once). (Tony) - Fixed bug #39898 (FILTER_VALIDATE_URL validates \r\n\t etc). (Ilia) +- Fixed bug #39873 (number_format() breaks with locale & decimal points). + (Ilia) - Fixed bug #39869 (safe_read does not initialize errno). (michiel at boland dot org, Dmitry) - Fixed bug #39850 (SplFileObject throws contradictory/wrong error messages http://cvs.php.net/viewvc.cgi/php-src/ext/standard/math.c?r1=1.131.2.2.2.2&r2=1.131.2.2.2.3&diff_format=u Index: php-src/ext/standard/math.c diff -u php-src/ext/standard/math.c:1.131.2.2.2.2 php-src/ext/standard/math.c:1.131.2.2.2.3 --- php-src/ext/standard/math.c:1.131.2.2.2.2 Sun Aug 27 19:14:43 2006 +++ php-src/ext/standard/math.c Fri Dec 22 04:03:15 2006 @@ -19,7 +19,7 @@+----------------------------------------------------------------------+*/ -/* $Id: math.c,v 1.131.2.2.2.2 2006/08/27 19:14:43 bjori Exp $ */ +/* $Id: math.c,v 1.131.2.2.2.3 2006/12/22 04:03:15 iliaa Exp $ */ #include "php.h" #include "php_math.h" @@ -983,7 +983,11 @@}/* find decimal point, if expected */ - dp = dec ? strchr(tmpbuf, '.') : NULL; + if (dec) { + dp = strpbrk(tmpbuf, ".,"); + } else { + dp = NULL; + }/* calculate the length of the return buffer */ if (dp) {http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/bug39873.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/strings/bug39873.phpt +++ php-src/ext/standard/tests/strings/bug39873.phpt -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Attachment: [text/x-diff] printf.f.patch