[PHP-CVS] cvs: php-src(PHP_5_2) / README.UPDATE_5_2
pajoye Mon Oct 1 08:14:03 2007 UTC Modified files: (Branch: PHP_5_2) /php-srcREADME.UPDATE_5_2 Log: - add notice about glob regression (Lukas) http://cvs.php.net/viewvc.cgi/php-src/README.UPDATE_5_2?r1=1.1.2.39r2=1.1.2.40diff_format=u Index: php-src/README.UPDATE_5_2 diff -u php-src/README.UPDATE_5_2:1.1.2.39 php-src/README.UPDATE_5_2:1.1.2.40 --- php-src/README.UPDATE_5_2:1.1.2.39 Sat Jan 6 18:05:02 2007 +++ php-src/README.UPDATE_5_2 Mon Oct 1 08:14:03 2007 @@ -172,6 +172,21 @@ from your error handler in order to populate $php_errormsg. This allows you to fine-grain the levels of the messages stored. +== +Regressions introduced/fixed +== + +- In version 5.2.4 a security fix caused a regression for patterns of + the form /foo/*/bar/*. Since version 5.2.5 instead of raising a warning the + glob() function will return false when openbase_dir restrictions are violated. + + #See http://bugs.php.net/bug.php?id=41655 + + The warning that used to be raised looked like something as follows: + Warning: glob() [function.glob]: Unable to access /foo/*/bar/* in /foo.php on line xxx + #See http://cvs.php.net/viewvc.cgi/php-src/ext/standard/dir.c?r1=1.169r2=1.170 + + The patch can safely be applied to PHP 5.2.4 as well. == Backwards incompatible changes -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) /ext/standard/tests/strings chunk_split_variation2.phpt chunk_split_variation5.phpt chunk_split_variation8.phpt
tony2001Mon Oct 1 10:22:43 2007 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/standard/tests/strings chunk_split_variation2.phpt chunk_split_variation5.phpt chunk_split_variation8.phpt Log: these dots exist since PHP3 even though Jani removed them in 5_3, I can't see how they can cause any BUGS http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/chunk_split_variation2.phpt?r1=1.1.2.1r2=1.1.2.2diff_format=u Index: php-src/ext/standard/tests/strings/chunk_split_variation2.phpt diff -u php-src/ext/standard/tests/strings/chunk_split_variation2.phpt:1.1.2.1 php-src/ext/standard/tests/strings/chunk_split_variation2.phpt:1.1.2.2 --- php-src/ext/standard/tests/strings/chunk_split_variation2.phpt:1.1.2.1 Sat Sep 29 12:55:34 2007 +++ php-src/ext/standard/tests/strings/chunk_split_variation2.phpt Mon Oct 1 10:22:43 2007 @@ -95,21 +95,21 @@ string(28) This is ch*uklen vari*ation* -- Iteration 2 -- -Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d +Warning: chunk_split(): Chunk length should be greater than zero. in %s on line %d bool(false) -- Iteration 3 -- string(26) This is chuklen variation* -- Iteration 4 -- -Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d +Warning: chunk_split(): Chunk length should be greater than zero. in %s on line %d bool(false) -- Iteration 5 -- -Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d +Warning: chunk_split(): Chunk length should be greater than zero. in %s on line %d bool(false) -- Iteration 6 -- -Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d +Warning: chunk_split(): Chunk length should be greater than zero. in %s on line %d bool(false) -- Iteration 7 -- string(50) T*h*i*s* *i*s* *c*h*u*k*l*e*n* *v*a*r*i*a*t*i*o*n* @@ -121,39 +121,39 @@ string(50) T*h*i*s* *i*s* *c*h*u*k*l*e*n* *v*a*r*i*a*t*i*o*n* -- Iteration 11 -- -Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d +Warning: chunk_split(): Chunk length should be greater than zero. in %s on line %d bool(false) -- Iteration 12 -- -Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d +Warning: chunk_split(): Chunk length should be greater than zero. in %s on line %d bool(false) -- Iteration 13 -- string(50) T*h*i*s* *i*s* *c*h*u*k*l*e*n* *v*a*r*i*a*t*i*o*n* -- Iteration 14 -- -Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d +Warning: chunk_split(): Chunk length should be greater than zero. in %s on line %d bool(false) -- Iteration 15 -- string(50) T*h*i*s* *i*s* *c*h*u*k*l*e*n* *v*a*r*i*a*t*i*o*n* -- Iteration 16 -- -Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d +Warning: chunk_split(): Chunk length should be greater than zero. in %s on line %d bool(false) -- Iteration 17 -- -Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d +Warning: chunk_split(): Chunk length should be greater than zero. in %s on line %d bool(false) -- Iteration 18 -- -Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d +Warning: chunk_split(): Chunk length should be greater than zero. in %s on line %d bool(false) -- Iteration 19 -- -Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d +Warning: chunk_split(): Chunk length should be greater than zero. in %s on line %d bool(false) -- Iteration 20 -- -Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d +Warning: chunk_split(): Chunk length should be greater than zero. in %s on line %d bool(false) -- Iteration 21 -- @@ -161,11 +161,11 @@ string(50) T*h*i*s* *i*s* *c*h*u*k*l*e*n* *v*a*r*i*a*t*i*o*n* -- Iteration 22 -- -Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d +Warning: chunk_split(): Chunk length should be greater than zero. in %s on line %d bool(false) -- Iteration 23 -- -Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d +Warning: chunk_split(): Chunk length should be greater than zero. in %s on line %d bool(false) -- Iteration 24 -- string(30) This *is ch*uklen* vari*ation* http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/chunk_split_variation5.phpt?r1=1.1.2.1r2=1.1.2.2diff_format=u Index: php-src/ext/standard/tests/strings/chunk_split_variation5.phpt http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/chunk_split_variation8.phpt?r1=1.1.2.1r2=1.1.2.2diff_format=u Index: php-src/ext/standard/tests/strings/chunk_split_variation8.phpt diff -u php-src/ext/standard/tests/strings/chunk_split_variation8.phpt:1.1.2.1
[PHP-CVS] cvs: php-src(PHP_5_2) /ext/standard/tests/strings join_error.phpt sprintf_basic7.phpt sprintf_basic8.phpt sprintf_variation28.phpt sprintf_variation29.phpt sprintf_variation34.phpt sprintf_v
tony2001Mon Oct 1 10:25:50 2007 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/standard/tests/strings join_error.phpt sprintf_basic7.phpt sprintf_basic8.phpt sprintf_variation28.phpt sprintf_variation29.phpt sprintf_variation34.phpt sprintf_variation35.phpt sprintf_variation4.phpt sprintf_variation40.phpt sprintf_variation41.phpt sprintf_variation44.phpt Log: fix tests http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/join_error.phpt?r1=1.1.2.2r2=1.1.2.3diff_format=u Index: php-src/ext/standard/tests/strings/join_error.phpt diff -u php-src/ext/standard/tests/strings/join_error.phpt:1.1.2.2 php-src/ext/standard/tests/strings/join_error.phpt:1.1.2.3 --- php-src/ext/standard/tests/strings/join_error.phpt:1.1.2.2 Sat Sep 29 09:10:18 2007 +++ php-src/ext/standard/tests/strings/join_error.phpt Mon Oct 1 10:25:50 2007 @@ -45,6 +45,6 @@ -- Testing join() with less than expected no. of arguments -- -Warning: join(): Argument to join must be an array in %s on line %d +Warning: join(): Argument to implode must be an array. in %s on line %d NULL Done http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/sprintf_basic7.phpt?r1=1.1.2.1r2=1.1.2.2diff_format=u Index: php-src/ext/standard/tests/strings/sprintf_basic7.phpt diff -u php-src/ext/standard/tests/strings/sprintf_basic7.phpt:1.1.2.1 php-src/ext/standard/tests/strings/sprintf_basic7.phpt:1.1.2.2 --- php-src/ext/standard/tests/strings/sprintf_basic7.phpt:1.1.2.1 Sat Sep 29 14:13:53 2007 +++ php-src/ext/standard/tests/strings/sprintf_basic7.phpt Mon Oct 1 10:25:50 2007 @@ -1,5 +1,11 @@ --TEST-- Test sprintf() function : basic functionality - unsigned format +--SKIPIF-- +?php +if (PHP_INT_SIZE != 4) { + die(skip this test is for 32bit platform only); +} +? --FILE-- ?php /* Prototype : string sprintf(string $format [, mixed $arg1 [, mixed ...]]) http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/sprintf_basic8.phpt?r1=1.1.2.1r2=1.1.2.2diff_format=u Index: php-src/ext/standard/tests/strings/sprintf_basic8.phpt diff -u php-src/ext/standard/tests/strings/sprintf_basic8.phpt:1.1.2.1 php-src/ext/standard/tests/strings/sprintf_basic8.phpt:1.1.2.2 --- php-src/ext/standard/tests/strings/sprintf_basic8.phpt:1.1.2.1 Sat Sep 29 14:13:53 2007 +++ php-src/ext/standard/tests/strings/sprintf_basic8.phpt Mon Oct 1 10:25:50 2007 @@ -1,5 +1,11 @@ --TEST-- Test sprintf() function : basic functionality - octal format +--SKIPIF-- +?php +if (PHP_INT_SIZE != 4) { + die(skip this test is for 32bit platform only); +} +? --FILE-- ?php /* Prototype : string sprintf(string $format [, mixed $arg1 [, mixed ...]]) http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/sprintf_variation28.phpt?r1=1.1.2.1r2=1.1.2.2diff_format=u Index: php-src/ext/standard/tests/strings/sprintf_variation28.phpt diff -u php-src/ext/standard/tests/strings/sprintf_variation28.phpt:1.1.2.1 php-src/ext/standard/tests/strings/sprintf_variation28.phpt:1.1.2.2 --- php-src/ext/standard/tests/strings/sprintf_variation28.phpt:1.1.2.1 Sat Sep 29 14:13:53 2007 +++ php-src/ext/standard/tests/strings/sprintf_variation28.phpt Mon Oct 1 10:25:50 2007 @@ -1,5 +1,11 @@ --TEST-- Test sprintf() function : usage variations - octal formats with integer values +--SKIPIF-- +?php +if (PHP_INT_SIZE != 4) { + die(skip this test is for 32bit platform only); +} +? --FILE-- ?php /* Prototype : string sprintf(string $format [, mixed $arg1 [, mixed ...]]) @@ -323,4 +329,4 @@ string(30)177 string(4) 0-7] string(1) o -Done \ No newline at end of file +Done http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/sprintf_variation29.phpt?r1=1.1.2.1r2=1.1.2.2diff_format=u Index: php-src/ext/standard/tests/strings/sprintf_variation29.phpt diff -u php-src/ext/standard/tests/strings/sprintf_variation29.phpt:1.1.2.1 php-src/ext/standard/tests/strings/sprintf_variation29.phpt:1.1.2.2 --- php-src/ext/standard/tests/strings/sprintf_variation29.phpt:1.1.2.1 Sat Sep 29 14:13:53 2007 +++ php-src/ext/standard/tests/strings/sprintf_variation29.phpt Mon Oct 1 10:25:50 2007 @@ -1,5 +1,11 @@ --TEST-- Test sprintf() function : usage variations - octal formats with float values +--SKIPIF-- +?php +if (PHP_INT_SIZE != 4) { + die(skip this test is for 32bit platform only); +} +? --FILE-- ?php /* Prototype : string sprintf(string $format [, mixed $arg1 [, mixed ...]]) @@ -163,4 +169,4 @@ string(30)
[PHP-CVS] cvs: php-src(PHP_5_2) /ext/standard/tests/strings join_variation2.phpt
tony2001Mon Oct 1 10:41:36 2007 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/standard/tests/strings join_variation2.phpt Log: fix test http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/join_variation2.phpt?r1=1.1.2.2r2=1.1.2.3diff_format=u Index: php-src/ext/standard/tests/strings/join_variation2.phpt diff -u php-src/ext/standard/tests/strings/join_variation2.phpt:1.1.2.2 php-src/ext/standard/tests/strings/join_variation2.phpt:1.1.2.3 --- php-src/ext/standard/tests/strings/join_variation2.phpt:1.1.2.2 Sat Sep 29 09:10:18 2007 +++ php-src/ext/standard/tests/strings/join_variation2.phpt Mon Oct 1 10:41:36 2007 @@ -105,94 +105,94 @@ --- Testing join() by supplying different values for 'pieces' argument --- -- Iteration 1 -- -Warning: join(): Bad arguments in %s on line %d +Warning: join(): Bad arguments. in %s on line %d NULL -- Iteration 2 -- -Warning: join(): Bad arguments in %s on line %d +Warning: join(): Bad arguments. in %s on line %d NULL -- Iteration 3 -- -Warning: join(): Bad arguments in %s on line %d +Warning: join(): Bad arguments. in %s on line %d NULL -- Iteration 4 -- -Warning: join(): Bad arguments in %s on line %d +Warning: join(): Bad arguments. in %s on line %d NULL -- Iteration 5 -- -Warning: join(): Bad arguments in %s on line %d +Warning: join(): Bad arguments. in %s on line %d NULL -- Iteration 6 -- -Warning: join(): Bad arguments in %s on line %d +Warning: join(): Bad arguments. in %s on line %d NULL -- Iteration 7 -- -Warning: join(): Bad arguments in %s on line %d +Warning: join(): Bad arguments. in %s on line %d NULL -- Iteration 8 -- -Warning: join(): Bad arguments in %s on line %d +Warning: join(): Bad arguments. in %s on line %d NULL -- Iteration 9 -- -Warning: join(): Bad arguments in %s on line %d +Warning: join(): Bad arguments. in %s on line %d NULL -- Iteration 10 -- -Warning: join(): Bad arguments in %s on line %d +Warning: join(): Bad arguments. in %s on line %d NULL -- Iteration 11 -- -Warning: join(): Bad arguments in %s on line %d +Warning: join(): Bad arguments. in %s on line %d NULL -- Iteration 12 -- -Warning: join(): Bad arguments in %s on line %d +Warning: join(): Bad arguments. in %s on line %d NULL -- Iteration 13 -- -Warning: join(): Bad arguments in %s on line %d +Warning: join(): Bad arguments. in %s on line %d NULL -- Iteration 14 -- -Warning: join(): Bad arguments in %s on line %d +Warning: join(): Bad arguments. in %s on line %d NULL -- Iteration 15 -- -Warning: join(): Bad arguments in %s on line %d +Warning: join(): Bad arguments. in %s on line %d NULL -- Iteration 16 -- -Warning: join(): Bad arguments in %s on line %d +Warning: join(): Bad arguments. in %s on line %d NULL -- Iteration 17 -- -Warning: join(): Bad arguments in %s on line %d +Warning: join(): Bad arguments. in %s on line %d NULL -- Iteration 18 -- -Warning: join(): Bad arguments in %s on line %d +Warning: join(): Bad arguments. in %s on line %d NULL -- Iteration 19 -- -Warning: join(): Bad arguments in %s on line %d +Warning: join(): Bad arguments. in %s on line %d NULL -- Iteration 20 -- -Warning: join(): Bad arguments in %s on line %d +Warning: join(): Bad arguments. in %s on line %d NULL -- Iteration 21 -- -Warning: join(): Bad arguments in %s on line %d +Warning: join(): Bad arguments. in %s on line %d NULL -- Iteration 22 -- -Warning: join(): Bad arguments in %s on line %d +Warning: join(): Bad arguments. in %s on line %d NULL -- Iteration 23 -- -Warning: join(): Bad arguments in %s on line %d +Warning: join(): Bad arguments. in %s on line %d NULL Done -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/standard/tests/strings moneyformat.phpt
janiMon Oct 1 12:01:28 2007 UTC Modified files: /php-src/ext/standard/tests/strings moneyformat.phpt Log: - Added unicode result http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/moneyformat.phpt?r1=1.3r2=1.4diff_format=u Index: php-src/ext/standard/tests/strings/moneyformat.phpt diff -u php-src/ext/standard/tests/strings/moneyformat.phpt:1.3 php-src/ext/standard/tests/strings/moneyformat.phpt:1.4 --- php-src/ext/standard/tests/strings/moneyformat.phpt:1.3 Wed Jun 6 17:47:15 2007 +++ php-src/ext/standard/tests/strings/moneyformat.phpt Mon Oct 1 12:01:28 2007 @@ -17,3 +17,9 @@ Warning: money_format(): Only a single %ci or %cn token can be used in %s on line %d bool(false) +--UEXPECTF-- +Strict Standards: setlocale(): deprecated in Unicode mode, please use ICU locale functions in /home/jani/src/php6/ext/standard/tests/strings/moneyformat.php on line 2 +unicode(7) X$3.14Y + +Warning: money_format(): Only a single %i or %n token can be used in /home/jani/src/php6/ext/standard/tests/strings/moneyformat.php on line 4 +bool(false) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/standard string.c /ext/standard/tests/strings implode1.phpt join_error.phpt join_variation2.phpt
janiMon Oct 1 12:04:09 2007 UTC Modified files: /php-src/ext/standard string.c /php-src/ext/standard/tests/strings implode1.phpt join_error.phpt join_variation2.phpt Log: - Fixed bug #42789 (join() warning messages are not proper different return value on php5/6) # For consistency between 5/6 also made the return value be NULL like it # has been for ages when invalid stuff is passed. http://cvs.php.net/viewvc.cgi/php-src/ext/standard/string.c?r1=1.651r2=1.652diff_format=u Index: php-src/ext/standard/string.c diff -u php-src/ext/standard/string.c:1.651 php-src/ext/standard/string.c:1.652 --- php-src/ext/standard/string.c:1.651 Fri Sep 7 02:28:26 2007 +++ php-src/ext/standard/string.c Mon Oct 1 12:04:09 2007 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: string.c,v 1.651 2007/09/07 02:28:26 iliaa Exp $ */ +/* $Id: string.c,v 1.652 2007/10/01 12:04:09 jani Exp $ */ /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */ @@ -1265,8 +1265,8 @@ if (argc == 1) { if (Z_TYPE_PP(arg1) != IS_ARRAY) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, Argument to implode must be an array); - RETURN_FALSE; + php_error_docref(NULL TSRMLS_CC, E_WARNING, Argument must be an array); + return; } else { SEPARATE_ZVAL(arg1); arr = *arg1; @@ -1293,8 +1293,8 @@ } delim = *arg1; } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, Bad arguments); - RETURN_FALSE; + php_error_docref(NULL TSRMLS_CC, E_WARNING, Invalid arguments passed); + return; } } http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/implode1.phpt?r1=1.3r2=1.4diff_format=u Index: php-src/ext/standard/tests/strings/implode1.phpt http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/join_error.phpt?r1=1.1r2=1.2diff_format=u Index: php-src/ext/standard/tests/strings/join_error.phpt diff -u php-src/ext/standard/tests/strings/join_error.phpt:1.1 php-src/ext/standard/tests/strings/join_error.phpt:1.2 --- php-src/ext/standard/tests/strings/join_error.phpt:1.1 Sat Sep 29 09:08:24 2007 +++ php-src/ext/standard/tests/strings/join_error.phpt Mon Oct 1 12:04:09 2007 @@ -1,5 +1,5 @@ --TEST-- -Test join() function : error conditions(Bug#42789) +Test join() function: error conditions --FILE-- ?php /* Prototype : string join( string $glue, array $pieces ) @@ -45,8 +45,8 @@ -- Testing join() with less than expected no. of arguments -- -Warning: join(): Argument to join must be an array in %s on line %d -bool(false) +Warning: join(): Argument must be an array in %s on line %d +NULL Done --UEXPECTF-- *** Testing join() : error conditions *** @@ -63,6 +63,6 @@ -- Testing join() with less than expected no. of arguments -- -Warning: join(): Argument to join must be an array in %s on line %d -bool(false) +Warning: join(): Argument must be an array in %s on line %d +NULL Done http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/join_variation2.phpt?r1=1.1r2=1.2diff_format=u Index: php-src/ext/standard/tests/strings/join_variation2.phpt diff -u php-src/ext/standard/tests/strings/join_variation2.phpt:1.1 php-src/ext/standard/tests/strings/join_variation2.phpt:1.2 --- php-src/ext/standard/tests/strings/join_variation2.phpt:1.1 Sat Sep 29 09:08:24 2007 +++ php-src/ext/standard/tests/strings/join_variation2.phpt Mon Oct 1 12:04:09 2007 @@ -102,95 +102,95 @@ --- Testing join() by supplying different values for 'pieces' argument --- -- Iteration 1 -- -Warning: join(): Bad arguments in %s on line %d +Warning: join(): Invalid arguments passed in %s on line %d NULL -- Iteration 2 -- -Warning: join(): Bad arguments in %s on line %d +Warning: join(): Invalid arguments passed in %s on line %d NULL -- Iteration 3 -- -Warning: join(): Bad arguments in %s on line %d +Warning: join(): Invalid arguments passed in %s on line %d NULL -- Iteration 4 -- -Warning: join(): Bad arguments in %s on line %d +Warning: join(): Invalid arguments passed in %s on line %d NULL -- Iteration 5 -- -Warning: join(): Bad arguments in %s on line %d +Warning: join(): Invalid arguments passed in %s on line %d NULL -- Iteration 6 -- -Warning: join(): Bad arguments in %s on line %d +Warning: join(): Invalid arguments passed in %s on line %d NULL -- Iteration 7 -- -Warning: join(): Bad arguments in %s on line %d +Warning: join(): Invalid arguments passed in %s on line %d NULL -- Iteration 8 -- -Warning: join(): Bad arguments in %s on line %d +Warning: join(): Invalid arguments passed in %s on line
[PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard string.c /ext/standard/tests/strings implode1.phpt join_error.phpt join_variation2.phpt
janiMon Oct 1 12:05:41 2007 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/standard string.c /php-src/ext/standard/tests/strings implode1.phpt join_error.phpt join_variation2.phpt Log: MFH: Fixed bug #42789 http://cvs.php.net/viewvc.cgi/php-src/ext/standard/string.c?r1=1.445.2.14.2.69.2.1r2=1.445.2.14.2.69.2.2diff_format=u Index: php-src/ext/standard/string.c diff -u php-src/ext/standard/string.c:1.445.2.14.2.69.2.1 php-src/ext/standard/string.c:1.445.2.14.2.69.2.2 --- php-src/ext/standard/string.c:1.445.2.14.2.69.2.1 Sun Sep 30 05:40:23 2007 +++ php-src/ext/standard/string.c Mon Oct 1 12:05:41 2007 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: string.c,v 1.445.2.14.2.69.2.1 2007/09/30 05:40:23 jani Exp $ */ +/* $Id: string.c,v 1.445.2.14.2.69.2.2 2007/10/01 12:05:41 jani Exp $ */ /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */ @@ -988,7 +988,7 @@ if (argc == 1) { if (Z_TYPE_PP(arg1) != IS_ARRAY) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, Argument to implode must be an array); + php_error_docref(NULL TSRMLS_CC, E_WARNING, Argument must be an array); return; } @@ -1008,7 +1008,7 @@ convert_to_string_ex(arg1); delim = *arg1; } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, Bad arguments); + php_error_docref(NULL TSRMLS_CC, E_WARNING, Invalid arguments passed); return; } } http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/implode1.phpt?r1=1.1.2.4.2.1r2=1.1.2.4.2.2diff_format=u Index: php-src/ext/standard/tests/strings/implode1.phpt http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/join_error.phpt?r1=1.1.4.3r2=1.1.4.4diff_format=u Index: php-src/ext/standard/tests/strings/join_error.phpt diff -u php-src/ext/standard/tests/strings/join_error.phpt:1.1.4.3 php-src/ext/standard/tests/strings/join_error.phpt:1.1.4.4 --- php-src/ext/standard/tests/strings/join_error.phpt:1.1.4.3 Sun Sep 30 14:37:33 2007 +++ php-src/ext/standard/tests/strings/join_error.phpt Mon Oct 1 12:05:41 2007 @@ -1,5 +1,5 @@ --TEST-- -Test join() function : error conditions(Bug#42789) +Test join() function: error conditions --FILE-- ?php /* Prototype : string join( string $glue, array $pieces ) @@ -45,6 +45,6 @@ -- Testing join() with less than expected no. of arguments -- -Warning: join(): Argument to implode must be an array in %s on line %d +Warning: join(): Argument must be an array in %s on line %d NULL Done http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/join_variation2.phpt?r1=1.1.4.2r2=1.1.4.3diff_format=u Index: php-src/ext/standard/tests/strings/join_variation2.phpt diff -u php-src/ext/standard/tests/strings/join_variation2.phpt:1.1.4.2 php-src/ext/standard/tests/strings/join_variation2.phpt:1.1.4.3 --- php-src/ext/standard/tests/strings/join_variation2.phpt:1.1.4.2 Sat Sep 29 16:52:54 2007 +++ php-src/ext/standard/tests/strings/join_variation2.phpt Mon Oct 1 12:05:41 2007 @@ -105,94 +105,94 @@ --- Testing join() by supplying different values for 'pieces' argument --- -- Iteration 1 -- -Warning: join(): Bad arguments in %s on line %d +Warning: join(): Invalid arguments passed in %s on line %d NULL -- Iteration 2 -- -Warning: join(): Bad arguments in %s on line %d +Warning: join(): Invalid arguments passed in %s on line %d NULL -- Iteration 3 -- -Warning: join(): Bad arguments in %s on line %d +Warning: join(): Invalid arguments passed in %s on line %d NULL -- Iteration 4 -- -Warning: join(): Bad arguments in %s on line %d +Warning: join(): Invalid arguments passed in %s on line %d NULL -- Iteration 5 -- -Warning: join(): Bad arguments in %s on line %d +Warning: join(): Invalid arguments passed in %s on line %d NULL -- Iteration 6 -- -Warning: join(): Bad arguments in %s on line %d +Warning: join(): Invalid arguments passed in %s on line %d NULL -- Iteration 7 -- -Warning: join(): Bad arguments in %s on line %d +Warning: join(): Invalid arguments passed in %s on line %d NULL -- Iteration 8 -- -Warning: join(): Bad arguments in %s on line %d +Warning: join(): Invalid arguments passed in %s on line %d NULL -- Iteration 9 -- -Warning: join(): Bad arguments in %s on line %d +Warning: join(): Invalid arguments passed in %s on line %d NULL -- Iteration 10 -- -Warning: join(): Bad arguments in %s on line %d +Warning: join(): Invalid arguments passed in %s on line %d NULL -- Iteration 11 -- -Warning: join(): Bad arguments in %s on line %d +Warning: join(): Invalid arguments passed in %s on line %d NULL -- Iteration 12 -- -Warning: join(): Bad arguments in
[PHP-CVS] cvs: php-src /main php_ini.c
janiMon Oct 1 12:26:56 2007 UTC Modified files: /php-src/main php_ini.c Log: - Fix warning http://cvs.php.net/viewvc.cgi/php-src/main/php_ini.c?r1=1.158r2=1.159diff_format=u Index: php-src/main/php_ini.c diff -u php-src/main/php_ini.c:1.158 php-src/main/php_ini.c:1.159 --- php-src/main/php_ini.c:1.158Fri Sep 28 10:23:14 2007 +++ php-src/main/php_ini.c Mon Oct 1 12:26:55 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_ini.c,v 1.158 2007/09/28 10:23:14 jani Exp $ */ +/* $Id: php_ini.c,v 1.159 2007/10/01 12:26:55 jani Exp $ */ #include php.h #include ext/standard/info.h @@ -721,7 +721,7 @@ */ PHPAPI void php_ini_activate_config(HashTable *source_hash, int modify_type, int stage TSRMLS_DC) { - char *str; + zstr str; zval *data; uint str_len; ulong num_index; @@ -732,7 +732,7 @@ zend_hash_move_forward(source_hash) ) { zend_hash_get_current_data(source_hash, (void **) data); - zend_alter_ini_entry_ex(str, str_len, Z_STRVAL_P(data), Z_STRLEN_P(data), modify_type, stage, 0 TSRMLS_CC); + zend_alter_ini_entry_ex(str.s, str_len, Z_STRVAL_P(data), Z_STRLEN_P(data), modify_type, stage, 0 TSRMLS_CC); } } /* }}} */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src / configure.in /ext/standard basic_functions.c config.m4 /main getopt.c php_getopt.h /sapi/cgi cgi_main.c config.w32 config9.m4 getopt.c php_getopt.h /sapi/cli config.w32 ge
janiMon Oct 1 12:32:39 2007 UTC Added files: /php-src/main getopt.c php_getopt.h Removed files: /php-src/sapi/cgi getopt.c php_getopt.h /php-src/sapi/cli getopt.c php_getopt.h Modified files: /php-srcconfigure.in /php-src/ext/standard basic_functions.c config.m4 /php-src/sapi/cgi cgi_main.c config.w32 config9.m4 /php-src/sapi/cli config.w32 php_cli.c /php-src/win32/buildconfig.w32 Log: - Added common getopt implementation to core. - Added long-option feature to getopt(). - Made getopt() available on win32 systems. Patch by: David Soria Parra [EMAIL PROTECTED] [DOC]: These changes will be available from 5.3+ http://cvs.php.net/viewvc.cgi/php-src/configure.in?r1=1.640r2=1.641diff_format=u Index: php-src/configure.in diff -u php-src/configure.in:1.640 php-src/configure.in:1.641 --- php-src/configure.in:1.640 Mon Aug 20 14:28:29 2007 +++ php-src/configure.inMon Oct 1 12:32:39 2007 @@ -1,4 +1,4 @@ -## $Id: configure.in,v 1.640 2007/08/20 14:28:29 jani Exp $ -*- autoconf -*- +## $Id: configure.in,v 1.641 2007/10/01 12:32:39 jani Exp $ -*- autoconf -*- dnl ## Process this file with autoconf to produce a configure script. divert(1) @@ -1054,7 +1054,7 @@ if test $PHP_CLI != no; then PHP_CLI_TARGET=\$(SAPI_CLI_PATH) PHP_INSTALL_CLI_TARGET=install-cli - PHP_ADD_SOURCES(sapi/cli, php_cli.c php_cli_readline.c getopt.c,, cli) + PHP_ADD_SOURCES(sapi/cli, php_cli.c php_cli_readline.c,, cli) PHP_INSTALLED_SAPIS=cli $PHP_SAPI else PHP_INSTALLED_SAPIS=$PHP_SAPI @@ -1208,7 +1208,7 @@ php_ini.c SAPI.c rfc1867.c php_content_types.c strlcpy.c \ strlcat.c mergesort.c reentrancy.c php_variables.c php_ticks.c \ network.c php_open_temporary_file.c php_logos.c \ - output.c ) + output.c getopt.c) PHP_ADD_SOURCES(main/streams, streams.c cast.c memory.c filter.c \ plain_wrapper.c userspace.c transports.c xp_socket.c mmap.c \ http://cvs.php.net/viewvc.cgi/php-src/ext/standard/basic_functions.c?r1=1.876r2=1.877diff_format=u Index: php-src/ext/standard/basic_functions.c diff -u php-src/ext/standard/basic_functions.c:1.876 php-src/ext/standard/basic_functions.c:1.877 --- php-src/ext/standard/basic_functions.c:1.876Fri Sep 28 13:06:22 2007 +++ php-src/ext/standard/basic_functions.c Mon Oct 1 12:32:39 2007 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: basic_functions.c,v 1.876 2007/09/28 13:06:22 jani Exp $ */ +/* $Id: basic_functions.c,v 1.877 2007/10/01 12:32:39 jani Exp $ */ #include php.h #include php_streams.h @@ -28,6 +28,7 @@ #include php_math.h #include php_http.h #include php_incomplete_class.h +#include php_getopt.h #include ext/standard/info.h #include ext/session/php_session.h #include zend_operators.h @@ -83,10 +84,6 @@ # include sys/loadavg.h #endif -#ifdef HARTMUT_0 -#include getopt.h -#endif - #ifdef PHP_WIN32 # include win32/unistd.h #endif @@ -100,7 +97,6 @@ #include SAPI.h #include php_ticks.h - #ifdef ZTS PHPAPI int basic_globals_id; #else @@ -725,13 +721,11 @@ ZEND_END_ARG_INFO() #endif -#ifdef HAVE_GETOPT static ZEND_BEGIN_ARG_INFO_EX(arginfo_getopt, 0, 0, 1) ZEND_ARG_INFO(0, options) ZEND_ARG_INFO(0, opts) /* ARRAY_INFO(0, opts, 1) */ ZEND_END_ARG_INFO() -#endif static ZEND_BEGIN_ARG_INFO(arginfo_flush, 0) @@ -3128,7 +3122,7 @@ PHP_FE(iptcembed, arginfo_iptcembed) PHP_FE(getimagesize, arginfo_getimagesize) PHP_FE(image_type_to_mime_type, arginfo_image_type_to_mime_type) - PHP_FE(image_type_to_extension, arginfo_image_type_to_extension) + PHP_FE(image_type_to_extension, arginfo_image_type_to_extension) PHP_FE(phpinfo, arginfo_phpinfo) PHP_FE(phpversion, arginfo_phpversion) @@ -3178,7 +3172,7 @@ #endif #ifdef HAVE_STRFMON - PHP_FE(money_format, arginfo_money_format) + PHP_FE(money_format, arginfo_money_format) #endif PHP_FE(substr,
[PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard array.c php_var.h
janiMon Oct 1 12:34:19 2007 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/standard array.c php_var.h Log: MFH: sync (adds php_prefix_varname() API function) http://cvs.php.net/viewvc.cgi/php-src/ext/standard/array.c?r1=1.308.2.21.2.37r2=1.308.2.21.2.37.2.1diff_format=u Index: php-src/ext/standard/array.c diff -u php-src/ext/standard/array.c:1.308.2.21.2.37 php-src/ext/standard/array.c:1.308.2.21.2.37.2.1 --- php-src/ext/standard/array.c:1.308.2.21.2.37Sat Sep 22 15:38:00 2007 +++ php-src/ext/standard/array.cMon Oct 1 12:34:19 2007 @@ -21,7 +21,7 @@ +--+ */ -/* $Id: array.c,v 1.308.2.21.2.37 2007/09/22 15:38:00 iliaa Exp $ */ +/* $Id: array.c,v 1.308.2.21.2.37.2.1 2007/10/01 12:34:19 jani Exp $ */ #include php.h #include php_ini.h @@ -618,7 +618,7 @@ /* check if comparison function is valid */ #define PHP_ARRAY_CMP_FUNC_CHECK(func_name)\ if (!zend_is_callable(*func_name, 0, NULL)) { \ - php_error_docref(NULL TSRMLS_CC, E_WARNING, Invalid comparison function.);\ + php_error_docref(NULL TSRMLS_CC, E_WARNING, Invalid comparison function); \ BG(user_compare_fci_cache) = old_user_compare_fci_cache; \ BG(user_compare_func_name) = old_compare_func; \ RETURN_FALSE; \ @@ -1317,82 +1317,86 @@ } /* }}} */ +PHPAPI int php_prefix_varname(zval *result, zval *prefix, char *var_name, int var_name_len, zend_bool add_underscore TSRMLS_DC) /* {{{ */ +{ + Z_STRLEN_P(result) = Z_STRLEN_P(prefix) + (add_underscore ? 1 : 0) + var_name_len; + Z_TYPE_P(result) = IS_STRING; + Z_STRVAL_P(result) = emalloc(Z_STRLEN_P(result) + 1); + memcpy(Z_STRVAL_P(result), Z_STRVAL_P(prefix), Z_STRLEN_P(prefix)); + + if (add_underscore) { + Z_STRVAL_P(result)[Z_STRLEN_P(prefix)] = '_'; + } + + memcpy(Z_STRVAL_P(result) + Z_STRLEN_P(prefix) + (add_underscore ? 1 : 0), var_name, var_name_len + 1); + + return SUCCESS; +} +/* }}} */ + /* {{{ proto int extract(array var_array [, int extract_type [, string prefix]]) Imports variables into symbol table from an array */ PHP_FUNCTION(extract) { - zval **var_array, **z_extract_type, **prefix; + zval *var_array, *prefix = NULL; + long extract_type = EXTR_OVERWRITE; zval **entry, *data; char *var_name; - smart_str final_name = {0}; ulong num_key; uint var_name_len; - int var_exists, extract_type, key_type, count = 0; + int var_exists, key_type, count = 0; int extract_refs = 0; HashPosition pos; - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, var_array) == FAILURE) { - WRONG_PARAM_COUNT; - } - extract_type = EXTR_OVERWRITE; - break; + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, a|lz/, var_array, extract_type, prefix) == FAILURE) { + return; + } - case 2: - if (zend_get_parameters_ex(2, var_array, z_extract_type) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(z_extract_type); - extract_type = Z_LVAL_PP(z_extract_type); - extract_refs = (extract_type EXTR_REFS); - extract_type = 0xff; - if (extract_type EXTR_SKIP extract_type = EXTR_PREFIX_IF_EXISTS) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, Prefix expected to be specified); - return; - } - break; - - case 3: - if (zend_get_parameters_ex(3, var_array, z_extract_type, prefix) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(z_extract_type); - extract_type = Z_LVAL_PP(z_extract_type); - extract_refs = (extract_type EXTR_REFS); - extract_type = 0xff; - convert_to_string_ex(prefix); - break; + extract_refs = (extract_type EXTR_REFS); + extract_type = 0xff; - default: - WRONG_PARAM_COUNT; - break; - } - if (extract_type EXTR_OVERWRITE || extract_type EXTR_IF_EXISTS) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, Unknown extract type); + php_error_docref(NULL TSRMLS_CC, E_WARNING, Invalid extract type); return; } - - if
[PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard string.c
janiMon Oct 1 13:38:15 2007 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/standard string.c Log: - ws + cs + sync HEAD http://cvs.php.net/viewvc.cgi/php-src/ext/standard/string.c?r1=1.445.2.14.2.69.2.2r2=1.445.2.14.2.69.2.3diff_format=u Index: php-src/ext/standard/string.c diff -u php-src/ext/standard/string.c:1.445.2.14.2.69.2.2 php-src/ext/standard/string.c:1.445.2.14.2.69.2.3 --- php-src/ext/standard/string.c:1.445.2.14.2.69.2.2 Mon Oct 1 12:05:41 2007 +++ php-src/ext/standard/string.c Mon Oct 1 13:38:14 2007 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: string.c,v 1.445.2.14.2.69.2.2 2007/10/01 12:05:41 jani Exp $ */ +/* $Id: string.c,v 1.445.2.14.2.69.2.3 2007/10/01 13:38:14 jani Exp $ */ /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */ @@ -2181,8 +2181,7 @@ if (Z_TYPE_PP(str) == IS_STRING) { if ( - (argc == 3 Z_TYPE_PP(from) == IS_ARRAY) - || + (argc == 3 Z_TYPE_PP(from) == IS_ARRAY) || (argc == 4 Z_TYPE_PP(from) != Z_TYPE_PP(len)) ) { php_error_docref(NULL TSRMLS_CC, E_WARNING, 'from' and 'len' should be of same type - numerical or array ); @@ -2195,7 +2194,6 @@ } } } - if (Z_TYPE_PP(str) != IS_ARRAY) { if (Z_TYPE_PP(from) != IS_ARRAY) { @@ -5127,12 +5125,12 @@ offset = (offset 0) ? 0 : offset; } - if(offset s1_len) { + if (offset s1_len) { php_error_docref(NULL TSRMLS_CC, E_WARNING, The start position cannot exceed initial string length); RETURN_FALSE; } - if(len s1_len - offset) { + if (len s1_len - offset) { php_error_docref(NULL TSRMLS_CC, E_WARNING, The length cannot exceed initial string length); RETURN_FALSE; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/standard string.c
janiMon Oct 1 13:41:57 2007 UTC Modified files: /php-src/ext/standard string.c Log: MFB: fix bug #42142 and cs+ws http://cvs.php.net/viewvc.cgi/php-src/ext/standard/string.c?r1=1.652r2=1.653diff_format=u Index: php-src/ext/standard/string.c diff -u php-src/ext/standard/string.c:1.652 php-src/ext/standard/string.c:1.653 --- php-src/ext/standard/string.c:1.652 Mon Oct 1 12:04:09 2007 +++ php-src/ext/standard/string.c Mon Oct 1 13:41:57 2007 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: string.c,v 1.652 2007/10/01 12:04:09 jani Exp $ */ +/* $Id: string.c,v 1.653 2007/10/01 13:41:57 jani Exp $ */ /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */ @@ -3317,7 +3317,7 @@ if (*f str_codepts || (*f 0 -(*f) str_codepts)) { ret = 0; } else if (*l str_codepts || (*l 0 -(*l) str_codepts)) { - ret = 0; + *l = str_codepts; } if (((unsigned)(*f) + (unsigned)(*l)) str_codepts) { *l = str_codepts - *f; @@ -3414,6 +3414,7 @@ f = Z_LVAL_PP(from); } if (argc 3) { + SEPARATE_ZVAL(len); if (Z_TYPE_PP(len) != IS_ARRAY) { convert_to_long_ex(len); l = Z_LVAL_PP(len); @@ -3425,8 +3426,10 @@ } if (Z_TYPE_PP(str) != IS_ARRAY) { - if ( (argc == 3 Z_TYPE_PP(from) == IS_ARRAY) || -(argc == 4 Z_TYPE_PP(from) != Z_TYPE_PP(len)) ) { + if ( + (argc == 3 Z_TYPE_PP(from) == IS_ARRAY) || + (argc == 4 Z_TYPE_PP(from) != Z_TYPE_PP(len)) + ) { php_error_docref(NULL TSRMLS_CC, E_WARNING, 'from' and 'len' should be of same type - numerical or array); RETURN_ZVAL(*str, 1, 0); } @@ -3438,7 +3441,6 @@ } } - if (Z_TYPE_PP(str) != IS_ARRAY) { if (Z_TYPE_PP(from) != IS_ARRAY ) { if (Z_TYPE_PP(repl) == IS_ARRAY) { @@ -7919,12 +7921,12 @@ offset = (offset 0) ? 0 : offset; } - if(offset s1_len) { + if (offset s1_len) { php_error_docref(NULL TSRMLS_CC, E_WARNING, The start position cannot exceed initial string length); RETURN_FALSE; } - if(len s1_len - offset) { + if (len s1_len - offset) { php_error_docref(NULL TSRMLS_CC, E_WARNING, The specified segment exceeds string length); RETURN_FALSE; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/standard/tests/strings bug40754.phpt
janiMon Oct 1 13:55:58 2007 UTC Modified files: /php-src/ext/standard/tests/strings bug40754.phpt Log: MFB: fix test http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/bug40754.phpt?r1=1.3r2=1.4diff_format=u Index: php-src/ext/standard/tests/strings/bug40754.phpt diff -u php-src/ext/standard/tests/strings/bug40754.phpt:1.3 php-src/ext/standard/tests/strings/bug40754.phpt:1.4 --- php-src/ext/standard/tests/strings/bug40754.phpt:1.3Mon Jun 18 13:39:02 2007 +++ php-src/ext/standard/tests/strings/bug40754.phptMon Oct 1 13:55:58 2007 @@ -28,7 +28,7 @@ ? --EXPECTF-- string(4) bcde -bool(false) +string(6) abcdex bool(false) bool(false) @@ -63,7 +63,7 @@ bool(false) --UEXPECTF-- unicode(4) bcde -bool(false) +unicode(6) abcdex bool(false) bool(false) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_3) /main main.c ZendEngine2 zend_ini.c
iliaa Mon Oct 1 14:51:11 2007 UTC Modified files: (Branch: PHP_5_3) /ZendEngine2zend_ini.c /php-src/main main.c Log: Refactor code to make fixes for coverity issues #385 and #386 a bit more obvious http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_ini.c?r1=1.39.2.2.2.18.2.9r2=1.39.2.2.2.18.2.10diff_format=u Index: ZendEngine2/zend_ini.c diff -u ZendEngine2/zend_ini.c:1.39.2.2.2.18.2.9 ZendEngine2/zend_ini.c:1.39.2.2.2.18.2.10 --- ZendEngine2/zend_ini.c:1.39.2.2.2.18.2.9Thu Sep 27 18:00:37 2007 +++ ZendEngine2/zend_ini.c Mon Oct 1 14:51:11 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: zend_ini.c,v 1.39.2.2.2.18.2.9 2007/09/27 18:00:37 dmitry Exp $ */ +/* $Id: zend_ini.c,v 1.39.2.2.2.18.2.10 2007/10/01 14:51:11 iliaa Exp $ */ #include zend.h #include zend_qsort.h @@ -437,14 +437,16 @@ tmp_value_len = 0; } - if (tmp_value_len == 4 strcasecmp(tmp_value, true) == 0) { - value = 1; - } else if (tmp_value_len == 3 strcasecmp(tmp_value, yes) == 0) { - value = 1; - } else if (tmp_value_len == 2 strcasecmp(tmp_value, on) == 0) { - value = 1; - } else if (tmp_value) { - value = atoi(tmp_value); + if (tmp_value) { + if (tmp_value_len == 4 strcasecmp(tmp_value, true) == 0) { + value = 1; + } else if (tmp_value_len == 3 strcasecmp(tmp_value, yes) == 0) { + value = 1; + } else if (tmp_value_len == 2 strcasecmp(tmp_value, on) == 0) { + value = 1; + } else (tmp_value) { + value = atoi(tmp_value); + } } else { value = 0; } http://cvs.php.net/viewvc.cgi/php-src/main/main.c?r1=1.640.2.23.2.57.2.1r2=1.640.2.23.2.57.2.2diff_format=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.640.2.23.2.57.2.1 php-src/main/main.c:1.640.2.23.2.57.2.2 --- php-src/main/main.c:1.640.2.23.2.57.2.1 Fri Sep 28 02:05:09 2007 +++ php-src/main/main.c Mon Oct 1 14:51:11 2007 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.640.2.23.2.57.2.1 2007/09/28 02:05:09 jani Exp $ */ +/* $Id: main.c,v 1.640.2.23.2.57.2.2 2007/10/01 14:51:11 iliaa Exp $ */ /* {{{ includes */ @@ -218,7 +218,11 @@ static int php_get_display_errors_mode(char *value, int value_length) { int mode; - + + if (!value) { + return PHP_DISPLAY_ERRORS_STDOUT; + } + if (value_length == 2 !strcasecmp(on, value)) { mode = PHP_DISPLAY_ERRORS_STDOUT; } else if (value_length == 3 !strcasecmp(yes, value)) { @@ -229,14 +233,13 @@ mode = PHP_DISPLAY_ERRORS_STDERR; } else if (value_length == 6 !strcasecmp(value, stdout)) { mode = PHP_DISPLAY_ERRORS_STDOUT; - } else if (value) { + } else { mode = atoi(value); if (mode mode != PHP_DISPLAY_ERRORS_STDOUT mode != PHP_DISPLAY_ERRORS_STDERR) { mode = PHP_DISPLAY_ERRORS_STDOUT; } - } else { - mode = PHP_DISPLAY_ERRORS_STDOUT; } + return mode; } /* }}} */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) /main main.c ZendEngine2 zend_ini.c
iliaa Mon Oct 1 14:53:01 2007 UTC Modified files: (Branch: PHP_5_2) /ZendEngine2zend_ini.c /php-src/main main.c Log: MFB: Refactor code to make fixes for coverity issues #385 and #386 a bit more obvious http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_ini.c?r1=1.39.2.2.2.23r2=1.39.2.2.2.24diff_format=u Index: ZendEngine2/zend_ini.c diff -u ZendEngine2/zend_ini.c:1.39.2.2.2.23 ZendEngine2/zend_ini.c:1.39.2.2.2.24 --- ZendEngine2/zend_ini.c:1.39.2.2.2.23Thu Sep 27 17:27:15 2007 +++ ZendEngine2/zend_ini.c Mon Oct 1 14:53:01 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: zend_ini.c,v 1.39.2.2.2.23 2007/09/27 17:27:15 iliaa Exp $ */ +/* $Id: zend_ini.c,v 1.39.2.2.2.24 2007/10/01 14:53:01 iliaa Exp $ */ #include zend.h #include zend_qsort.h @@ -434,14 +434,16 @@ tmp_value_len = 0; } - if (tmp_value_len == 4 strcasecmp(tmp_value, true) == 0) { - value = 1; - } else if (tmp_value_len == 3 strcasecmp(tmp_value, yes) == 0) { - value = 1; - } else if (tmp_value_len == 2 strcasecmp(tmp_value, on) == 0) { - value = 1; - } else if (tmp_value) { - value = atoi(tmp_value); + if (tmp_value) { + if (tmp_value_len == 4 strcasecmp(tmp_value, true) == 0) { + value = 1; + } else if (tmp_value_len == 3 strcasecmp(tmp_value, yes) == 0) { + value = 1; + } else if (tmp_value_len == 2 strcasecmp(tmp_value, on) == 0) { + value = 1; + } else (tmp_value) { + value = atoi(tmp_value); + } } else { value = 0; } http://cvs.php.net/viewvc.cgi/php-src/main/main.c?r1=1.640.2.23.2.57r2=1.640.2.23.2.58diff_format=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.640.2.23.2.57 php-src/main/main.c:1.640.2.23.2.58 --- php-src/main/main.c:1.640.2.23.2.57 Mon Sep 24 11:53:40 2007 +++ php-src/main/main.c Mon Oct 1 14:53:01 2007 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.640.2.23.2.57 2007/09/24 11:53:40 dmitry Exp $ */ +/* $Id: main.c,v 1.640.2.23.2.58 2007/10/01 14:53:01 iliaa Exp $ */ /* {{{ includes */ @@ -218,7 +218,11 @@ static int php_get_display_errors_mode(char *value, int value_length) { int mode; - + + if (!value) { + return PHP_DISPLAY_ERRORS_STDOUT; + } + if (value_length == 2 !strcasecmp(on, value)) { mode = PHP_DISPLAY_ERRORS_STDOUT; } else if (value_length == 3 !strcasecmp(yes, value)) { @@ -229,14 +233,13 @@ mode = PHP_DISPLAY_ERRORS_STDERR; } else if (value_length == 6 !strcasecmp(value, stdout)) { mode = PHP_DISPLAY_ERRORS_STDOUT; - } else if (value) { + } else { mode = atoi(value); if (mode mode != PHP_DISPLAY_ERRORS_STDOUT mode != PHP_DISPLAY_ERRORS_STDERR) { mode = PHP_DISPLAY_ERRORS_STDOUT; } - } else { - mode = PHP_DISPLAY_ERRORS_STDOUT; } + return mode; } /* }}} */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard/tests/general_functions error_get_last.phpt
johannesMon Oct 1 15:01:47 2007 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/standard/tests/general_functions error_get_last.phpt Log: - Fix test http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/general_functions/error_get_last.phpt?r1=1.1.2.2.2.1r2=1.1.2.2.2.2diff_format=u Index: php-src/ext/standard/tests/general_functions/error_get_last.phpt diff -u php-src/ext/standard/tests/general_functions/error_get_last.phpt:1.1.2.2.2.1 php-src/ext/standard/tests/general_functions/error_get_last.phpt:1.1.2.2.2.2 --- php-src/ext/standard/tests/general_functions/error_get_last.phpt:1.1.2.2.2.1 Mon Oct 1 12:40:54 2007 +++ php-src/ext/standard/tests/general_functions/error_get_last.phptMon Oct 1 15:01:47 2007 @@ -24,7 +24,7 @@ [message]= string(54) error_get_last() expects exactly 0 parameters, 1 given [file]= - string(78) %s + string(%i) %s [line]= int(4) } @@ -36,7 +36,7 @@ [message]= string(21) Undefined variable: b [file]= - string(78) %s + string(%i) %s [line]= int(7) } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_3) /ext/json json.c /main snprintf.c spprintf.c
iliaa Mon Oct 1 15:22:41 2007 UTC Modified files: (Branch: PHP_5_3) /php-src/main snprintf.c spprintf.c /php-src/ext/json json.c Log: Fixed bug #42785 (json_encode() formats doubles according to locale rather then following standard syntax). http://cvs.php.net/viewvc.cgi/php-src/main/snprintf.c?r1=1.37.2.4.2.14r2=1.37.2.4.2.14.2.1diff_format=u Index: php-src/main/snprintf.c diff -u php-src/main/snprintf.c:1.37.2.4.2.14 php-src/main/snprintf.c:1.37.2.4.2.14.2.1 --- php-src/main/snprintf.c:1.37.2.4.2.14 Fri Aug 3 14:31:27 2007 +++ php-src/main/snprintf.c Mon Oct 1 15:22:41 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: snprintf.c,v 1.37.2.4.2.14 2007/08/03 14:31:27 tony2001 Exp $ */ +/* $Id: snprintf.c,v 1.37.2.4.2.14.2.1 2007/10/01 15:22:41 iliaa Exp $ */ #include php.h @@ -1004,6 +1004,7 @@ case 'g': + case 'k': case 'G': case 'H': switch(modifier) { @@ -1045,7 +1046,7 @@ lconv = localeconv(); } #endif - s = php_gcvt(fp_num, precision, *fmt=='H' ? '.' : LCONV_DECIMAL_POINT, (*fmt == 'G' || *fmt == 'H')?'E':'e', num_buf[1]); + s = php_gcvt(fp_num, precision, (*fmt=='H' || *fmt == 'k') ? '.' : LCONV_DECIMAL_POINT, (*fmt == 'G' || *fmt == 'H')?'E':'e', num_buf[1]); if (*s == '-') { prefix_char = *s++; } else if (print_sign) { http://cvs.php.net/viewvc.cgi/php-src/main/spprintf.c?r1=1.25.2.2.2.10r2=1.25.2.2.2.10.2.1diff_format=u Index: php-src/main/spprintf.c diff -u php-src/main/spprintf.c:1.25.2.2.2.10 php-src/main/spprintf.c:1.25.2.2.2.10.2.1 --- php-src/main/spprintf.c:1.25.2.2.2.10 Fri Aug 3 14:31:28 2007 +++ php-src/main/spprintf.c Mon Oct 1 15:22:41 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: spprintf.c,v 1.25.2.2.2.10 2007/08/03 14:31:28 tony2001 Exp $ */ +/* $Id: spprintf.c,v 1.25.2.2.2.10.2.1 2007/10/01 15:22:41 iliaa Exp $ */ /* This is the spprintf implementation. * It has emerged from apache snprintf. See original header: @@ -600,6 +600,7 @@ case 'g': + case 'k': case 'G': case 'H': switch(modifier) { @@ -640,7 +641,7 @@ lconv = localeconv(); } #endif - s = php_gcvt(fp_num, precision, *fmt=='H' ? '.' : LCONV_DECIMAL_POINT, (*fmt == 'G' || *fmt == 'H')?'E':'e', num_buf[1]); + s = php_gcvt(fp_num, precision, (*fmt=='H' || *fmt == 'k') ? '.' : LCONV_DECIMAL_POINT, (*fmt == 'G' || *fmt == 'H')?'E':'e', num_buf[1]); if (*s == '-') prefix_char = *s++; else if (print_sign) http://cvs.php.net/viewvc.cgi/php-src/ext/json/json.c?r1=1.9.2.19.2.1r2=1.9.2.19.2.2diff_format=u Index: php-src/ext/json/json.c diff -u php-src/ext/json/json.c:1.9.2.19.2.1 php-src/ext/json/json.c:1.9.2.19.2.2 --- php-src/ext/json/json.c:1.9.2.19.2.1Thu Sep 27 18:00:39 2007 +++ php-src/ext/json/json.c Mon Oct 1 15:22:41 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: json.c,v 1.9.2.19.2.1 2007/09/27 18:00:39 dmitry Exp $ */ +/* $Id: json.c,v 1.9.2.19.2.2 2007/10/01 15:22:41 iliaa Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -359,7 +359,7 @@ double dbl = Z_DVAL_P(val); if (!zend_isinf(dbl) !zend_isnan(dbl)) { - len = spprintf(d, 0, %.*g, (int) EG(precision), dbl); + len = spprintf(d, 0, %.*k, (int) EG(precision), dbl); smart_str_appendl(buf, d, len); efree(d); } else { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /ext/json json.c /main snprintf.c spprintf.c
iliaa Mon Oct 1 15:23:15 2007 UTC Modified files: (Branch: PHP_5_2) /php-src/main snprintf.c spprintf.c /php-src/ext/json json.c /php-srcNEWS Log: MFB: Fixed bug #42785 (json_encode() formats doubles according to locale rather then following standard syntax). http://cvs.php.net/viewvc.cgi/php-src/main/snprintf.c?r1=1.37.2.4.2.14r2=1.37.2.4.2.15diff_format=u Index: php-src/main/snprintf.c diff -u php-src/main/snprintf.c:1.37.2.4.2.14 php-src/main/snprintf.c:1.37.2.4.2.15 --- php-src/main/snprintf.c:1.37.2.4.2.14 Fri Aug 3 14:31:27 2007 +++ php-src/main/snprintf.c Mon Oct 1 15:23:15 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: snprintf.c,v 1.37.2.4.2.14 2007/08/03 14:31:27 tony2001 Exp $ */ +/* $Id: snprintf.c,v 1.37.2.4.2.15 2007/10/01 15:23:15 iliaa Exp $ */ #include php.h @@ -1004,6 +1004,7 @@ case 'g': + case 'k': case 'G': case 'H': switch(modifier) { @@ -1045,7 +1046,7 @@ lconv = localeconv(); } #endif - s = php_gcvt(fp_num, precision, *fmt=='H' ? '.' : LCONV_DECIMAL_POINT, (*fmt == 'G' || *fmt == 'H')?'E':'e', num_buf[1]); + s = php_gcvt(fp_num, precision, (*fmt=='H' || *fmt == 'k') ? '.' : LCONV_DECIMAL_POINT, (*fmt == 'G' || *fmt == 'H')?'E':'e', num_buf[1]); if (*s == '-') { prefix_char = *s++; } else if (print_sign) { http://cvs.php.net/viewvc.cgi/php-src/main/spprintf.c?r1=1.25.2.2.2.10r2=1.25.2.2.2.11diff_format=u Index: php-src/main/spprintf.c diff -u php-src/main/spprintf.c:1.25.2.2.2.10 php-src/main/spprintf.c:1.25.2.2.2.11 --- php-src/main/spprintf.c:1.25.2.2.2.10 Fri Aug 3 14:31:28 2007 +++ php-src/main/spprintf.c Mon Oct 1 15:23:15 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: spprintf.c,v 1.25.2.2.2.10 2007/08/03 14:31:28 tony2001 Exp $ */ +/* $Id: spprintf.c,v 1.25.2.2.2.11 2007/10/01 15:23:15 iliaa Exp $ */ /* This is the spprintf implementation. * It has emerged from apache snprintf. See original header: @@ -600,6 +600,7 @@ case 'g': + case 'k': case 'G': case 'H': switch(modifier) { @@ -640,7 +641,7 @@ lconv = localeconv(); } #endif - s = php_gcvt(fp_num, precision, *fmt=='H' ? '.' : LCONV_DECIMAL_POINT, (*fmt == 'G' || *fmt == 'H')?'E':'e', num_buf[1]); + s = php_gcvt(fp_num, precision, (*fmt=='H' || *fmt == 'k') ? '.' : LCONV_DECIMAL_POINT, (*fmt == 'G' || *fmt == 'H')?'E':'e', num_buf[1]); if (*s == '-') prefix_char = *s++; else if (print_sign) http://cvs.php.net/viewvc.cgi/php-src/ext/json/json.c?r1=1.9.2.19r2=1.9.2.20diff_format=u Index: php-src/ext/json/json.c diff -u php-src/ext/json/json.c:1.9.2.19 php-src/ext/json/json.c:1.9.2.20 --- php-src/ext/json/json.c:1.9.2.19Tue Jul 24 22:57:13 2007 +++ php-src/ext/json/json.c Mon Oct 1 15:23:15 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: json.c,v 1.9.2.19 2007/07/24 22:57:13 bjori Exp $ */ +/* $Id: json.c,v 1.9.2.20 2007/10/01 15:23:15 iliaa Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -359,7 +359,7 @@ double dbl = Z_DVAL_P(val); if (!zend_isinf(dbl) !zend_isnan(dbl)) { - len = spprintf(d, 0, %.*g, (int) EG(precision), dbl); + len = spprintf(d, 0, %.*k, (int) EG(precision), dbl); smart_str_appendl(buf, d, len); efree(d); } else { http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.965r2=1.2027.2.547.2.966diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.965 php-src/NEWS:1.2027.2.547.2.966 --- php-src/NEWS:1.2027.2.547.2.965 Wed Sep 26 15:44:15 2007 +++ php-src/NEWSMon Oct 1 15:23:15 2007 @@ -30,6 +30,8 @@ Reported by Laurent gaffie. (Ilia) - Fixed imagerectangle regression with 1x1 rectangle (libgd #106). (Pierre) +- Fixed bug #42785 (json_encode() formats doubles according to locale rather + then
[PHP-CVS] cvs: php-src /ext/json json.c /main snprintf.c spprintf.c
iliaa Mon Oct 1 15:25:01 2007 UTC Modified files: /php-src/main snprintf.c spprintf.c /php-src/ext/json json.c Log: MFB: Fixed bug #42785 (json_encode() formats doubles according to locale rather then following standard syntax). http://cvs.php.net/viewvc.cgi/php-src/main/snprintf.c?r1=1.59r2=1.60diff_format=u Index: php-src/main/snprintf.c diff -u php-src/main/snprintf.c:1.59 php-src/main/snprintf.c:1.60 --- php-src/main/snprintf.c:1.59Tue Sep 4 11:19:33 2007 +++ php-src/main/snprintf.c Mon Oct 1 15:25:01 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: snprintf.c,v 1.59 2007/09/04 11:19:33 derick Exp $ */ +/* $Id: snprintf.c,v 1.60 2007/10/01 15:25:01 iliaa Exp $ */ #include php.h @@ -1051,6 +1051,7 @@ case 'g': + case 'k': case 'G': case 'H': switch(modifier) { @@ -1091,7 +1092,7 @@ lconv = localeconv(); } #endif - s = php_gcvt(fp_num, precision, *fmt=='H' ? '.' : LCONV_DECIMAL_POINT, (*fmt == 'G' || *fmt == 'H')?'E':'e', num_buf[1]); + s = php_gcvt(fp_num, precision, (*fmt == 'H' || *fmt == 'k') ? '.' : LCONV_DECIMAL_POINT, (*fmt == 'G' || *fmt == 'H')?'E':'e', num_buf[1]); if (*s == '-') prefix_char = *s++; else if (print_sign) http://cvs.php.net/viewvc.cgi/php-src/main/spprintf.c?r1=1.49r2=1.50diff_format=u Index: php-src/main/spprintf.c diff -u php-src/main/spprintf.c:1.49 php-src/main/spprintf.c:1.50 --- php-src/main/spprintf.c:1.49Fri Aug 3 14:30:59 2007 +++ php-src/main/spprintf.c Mon Oct 1 15:25:01 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: spprintf.c,v 1.49 2007/08/03 14:30:59 tony2001 Exp $ */ +/* $Id: spprintf.c,v 1.50 2007/10/01 15:25:01 iliaa Exp $ */ /* This is the spprintf implementation. * It has emerged from apache snprintf. See original header: @@ -690,6 +690,7 @@ case 'g': + case 'k': case 'G': case 'H': switch(modifier) { @@ -730,7 +731,7 @@ lconv = localeconv(); } #endif - s = php_gcvt(fp_num, precision, *fmt=='H' ? '.' : LCONV_DECIMAL_POINT, (*fmt == 'G' || *fmt == 'H')?'E':'e', num_buf[1]); + s = php_gcvt(fp_num, precision, (*fmt=='H' || *fmt == 'k') ? '.' : LCONV_DECIMAL_POINT, (*fmt == 'G' || *fmt == 'H')?'E':'e', num_buf[1]); if (*s == '-') prefix_char = *s++; else if (print_sign) http://cvs.php.net/viewvc.cgi/php-src/ext/json/json.c?r1=1.30r2=1.31diff_format=u Index: php-src/ext/json/json.c diff -u php-src/ext/json/json.c:1.30 php-src/ext/json/json.c:1.31 --- php-src/ext/json/json.c:1.30Thu Sep 27 18:28:39 2007 +++ php-src/ext/json/json.c Mon Oct 1 15:25:01 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: json.c,v 1.30 2007/09/27 18:28:39 dmitry Exp $ */ +/* $Id: json.c,v 1.31 2007/10/01 15:25:01 iliaa Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -363,9 +363,9 @@ double dbl = Z_DVAL_P(val); if (!zend_isinf(dbl) !zend_isnan(dbl)) { - len = spprintf(d, 0, %.*g, (int) EG(precision), dbl); - smart_str_appendl(buf, d, len); - efree(d); + len = spprintf(d, 0, %.*k, (int) EG(precision), dbl); + smart_str_appendl(buf, d, len); + efree(d); } else { zend_error(E_WARNING, [json] (json_encode_r) double %.9g does not conform to the JSON spec, encoded as 0., dbl); smart_str_appendc(buf, '0'); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_3) /ext/json/tests bug42785.phpt
iliaa Mon Oct 1 15:33:11 2007 UTC Added files: (Branch: PHP_5_3) /php-src/ext/json/tests bug42785.phpt Log: Added test for bug #42785 http://cvs.php.net/viewvc.cgi/php-src/ext/json/tests/bug42785.phpt?view=markuprev=1.1 Index: php-src/ext/json/tests/bug42785.phpt +++ php-src/ext/json/tests/bug42785.phpt -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) /ext/json/tests bug42785.phpt
iliaa Mon Oct 1 15:33:21 2007 UTC Added files: (Branch: PHP_5_2) /php-src/ext/json/tests bug42785.phpt Log: MFB: Added test for bug #42785 http://cvs.php.net/viewvc.cgi/php-src/ext/json/tests/bug42785.phpt?view=markuprev=1.1 Index: php-src/ext/json/tests/bug42785.phpt +++ php-src/ext/json/tests/bug42785.phpt -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/json/tests bug42785.phpt
iliaa Mon Oct 1 15:33:29 2007 UTC Modified files: /php-src/ext/json/tests bug42785.phpt Log: MFB: Added test for bug #42785 http://cvs.php.net/viewvc.cgi/php-src/ext/json/tests/bug42785.phpt?r1=1.1r2=1.2diff_format=u Index: php-src/ext/json/tests/bug42785.phpt diff -u /dev/null php-src/ext/json/tests/bug42785.phpt:1.2 --- /dev/null Mon Oct 1 15:33:29 2007 +++ php-src/ext/json/tests/bug42785.phptMon Oct 1 15:33:29 2007 @@ -0,0 +1,26 @@ +--TEST-- +Bug #42785 (Incorrect formatting of double values with non-english locales) +--SKIPIF-- +?php + if (!extension_loaded(json)) { + print skip; + } else if (!setlocale(LC_CTYPE, de_DE, de, german, ge, de_DE.ISO8859-1, ISO8859-1)) { + die(skip locale needed for this test is not supported on this platform); + } +? +--FILE-- +?php +setlocale(LC_ALL, de_DE, de, german, ge, de_DE.ISO8859-1, ISO8859-1); + +$foo = Array(100.10,bar); +var_dump(json_encode($foo)); + +Class bar {} +$bar1 = new bar; +$bar1-a = 100.10; +$bar1-b = foo; +var_dump(json_encode($bar1)); +? +--EXPECT-- +string(13) [100.1,bar] +string(21) {a:100.1,b:foo} -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard basic_functions.c
johannesMon Oct 1 20:36:01 2007 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/standard basic_functions.c Log: - pass the adress not the value http://cvs.php.net/viewvc.cgi/php-src/ext/standard/basic_functions.c?r1=1.725.2.31.2.64.2.4r2=1.725.2.31.2.64.2.5diff_format=u Index: php-src/ext/standard/basic_functions.c diff -u php-src/ext/standard/basic_functions.c:1.725.2.31.2.64.2.4 php-src/ext/standard/basic_functions.c:1.725.2.31.2.64.2.5 --- php-src/ext/standard/basic_functions.c:1.725.2.31.2.64.2.4 Mon Oct 1 12:40:53 2007 +++ php-src/ext/standard/basic_functions.c Mon Oct 1 20:36:01 2007 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: basic_functions.c,v 1.725.2.31.2.64.2.4 2007/10/01 12:40:53 jani Exp $ */ +/* $Id: basic_functions.c,v 1.725.2.31.2.64.2.5 2007/10/01 20:36:01 johannes Exp $ */ #include php.h #include php_streams.h @@ -6125,7 +6125,7 @@ RETURN_FALSE; } - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ss, path, path_len, new_path, new_path_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ss, path, path_len, new_path, new_path_len) == FAILURE) { return; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php-src(PHP_5_2) /ext/standard/tests/strings chunk_split_variation2.phpt chunk_split_variation5.phpt chunk_split_variation8.phpt
Hello Antony, this is not about fixing BUGS as in PHP behaves wrong. This is about consistency. We decided on a format for all error messages and Jani was enforcing that. Anyway, it does not matter how long something wrong is in the codebase. Longer errors are not better errors. They only tend to get loved and become features. The real issue here is in fact that you might want to write a strict rule for parsing errors, with some errors having dots and some not it is harder to get the real text. marcus Monday, October 1, 2007, 12:22:43 PM, you wrote: tony2001Mon Oct 1 10:22:43 2007 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/standard/tests/strings chunk_split_variation2.phpt chunk_split_variation5.phpt chunk_split_variation8.phpt Log: these dots exist since PHP3 even though Jani removed them in 5_3, I can't see how they can cause any BUGS http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/chunk_split_variation2.phpt?r1=1.1.2.1r2=1.1.2.2diff_format=u Index: php-src/ext/standard/tests/strings/chunk_split_variation2.phpt diff -u php-src/ext/standard/tests/strings/chunk_split_variation2.phpt:1.1.2.1 php-src/ext/standard/tests/strings/chunk_split_variation2.phpt:1.1.2.2 --- php-src/ext/standard/tests/strings/chunk_split_variation2.phpt:1.1.2.1 Sat Sep 29 12:55:34 2007 +++ php-src/ext/standard/tests/strings/chunk_split_variation2.phpt Mon Oct 1 10:22:43 2007 @@ -95,21 +95,21 @@ string(28) This is ch*uklen vari*ation* -- Iteration 2 -- -Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d +Warning: chunk_split(): Chunk length should be greater than zero. in %s on line %d bool(false) -- Iteration 3 -- string(26) This is chuklen variation* -- Iteration 4 -- -Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d +Warning: chunk_split(): Chunk length should be greater than zero. in %s on line %d bool(false) -- Iteration 5 -- -Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d +Warning: chunk_split(): Chunk length should be greater than zero. in %s on line %d bool(false) -- Iteration 6 -- -Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d +Warning: chunk_split(): Chunk length should be greater than zero. in %s on line %d bool(false) -- Iteration 7 -- string(50) T*h*i*s* *i*s* *c*h*u*k*l*e*n* *v*a*r*i*a*t*i*o*n* @@ -121,39 +121,39 @@ string(50) T*h*i*s* *i*s* *c*h*u*k*l*e*n* *v*a*r*i*a*t*i*o*n* -- Iteration 11 -- -Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d +Warning: chunk_split(): Chunk length should be greater than zero. in %s on line %d bool(false) -- Iteration 12 -- -Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d +Warning: chunk_split(): Chunk length should be greater than zero. in %s on line %d bool(false) -- Iteration 13 -- string(50) T*h*i*s* *i*s* *c*h*u*k*l*e*n* *v*a*r*i*a*t*i*o*n* -- Iteration 14 -- -Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d +Warning: chunk_split(): Chunk length should be greater than zero. in %s on line %d bool(false) -- Iteration 15 -- string(50) T*h*i*s* *i*s* *c*h*u*k*l*e*n* *v*a*r*i*a*t*i*o*n* -- Iteration 16 -- -Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d +Warning: chunk_split(): Chunk length should be greater than zero. in %s on line %d bool(false) -- Iteration 17 -- -Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d +Warning: chunk_split(): Chunk length should be greater than zero. in %s on line %d bool(false) -- Iteration 18 -- -Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d +Warning: chunk_split(): Chunk length should be greater than zero. in %s on line %d bool(false) -- Iteration 19 -- -Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d +Warning: chunk_split(): Chunk length should be greater than zero. in %s on line %d bool(false) -- Iteration 20 -- -Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d +Warning: chunk_split(): Chunk length should be greater than zero. in %s on line %d bool(false) -- Iteration 21 -- @@ -161,11 +161,11 @@ string(50) T*h*i*s* *i*s* *c*h*u*k*l*e*n* *v*a*r*i*a*t*i*o*n* -- Iteration 22 -- -Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d +Warning: chunk_split(): Chunk length should be greater than zero. in %s on line %d bool(false) -- Iteration 23 -- -Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d