[PHP-CVS] com php-src: Revert zend_make_printable_zval choses cast_object over __toString: Zend/zend.c
Commit:75f6c8d42cfcf856d7a12f67c3981f3ad62660e9 Author:Xinchen Hui larue...@php.net Sun, 12 Aug 2012 12:02:06 +0800 Parents: 32c1c5a19fab5c1471a5902a54efcd0875fe7e79 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=75f6c8d42cfcf856d7a12f67c3981f3ad62660e9 Log: Revert zend_make_printable_zval choses cast_object over __toString This reverts commit a5dfd414941953c282bb68f6b08685252ca93a1a. Changed paths: M Zend/zend.c Diff: diff --git a/Zend/zend.c b/Zend/zend.c index be30e92..18c4f11 100644 --- a/Zend/zend.c +++ b/Zend/zend.c @@ -258,12 +258,6 @@ ZEND_API void zend_make_printable_zval(zval *expr, zval *expr_copy, int *use_cop { TSRMLS_FETCH(); - if (Z_OBJCE_P(expr)-__tostring) { - if (zend_std_cast_object_tostring(expr, expr_copy, IS_STRING TSRMLS_CC) == SUCCESS) { - break; - } - } - if (Z_OBJ_HANDLER_P(expr, cast_object)) { zval *val; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Revert Test for bug 62328: Zend/tests/bug62328.phpt
Commit:32c1c5a19fab5c1471a5902a54efcd0875fe7e79 Author:Xinchen Hui larue...@php.net Sun, 12 Aug 2012 12:02:02 +0800 Parents: d11fa44d626809f1160cafdaddd73d4c45516a2c Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=32c1c5a19fab5c1471a5902a54efcd0875fe7e79 Log: Revert Test for bug 62328 This reverts commit 222ab9da1aa086a47279d29c16a8ebea514257fe. Bugs: https://bugs.php.net/62328 Changed paths: D Zend/tests/bug62328.phpt Diff: diff --git a/Zend/tests/bug62328.phpt b/Zend/tests/bug62328.phpt deleted file mode 100644 index c56ddc2..000 --- a/Zend/tests/bug62328.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -Bug #62328 (cast_object takes precedence over __toString) ---FILE-- -?php - -class SplFileInfo62328 extends SplFileInfo -{ - public function __toString() - { - return '__toString'; - } -} - -$fi = new SplFileInfo62328(__FILE__); - -echo (string)$fi . PHP_EOL; -echo (string)$fi-__toString() . PHP_EOL; - -? ---EXPECT-- -__toString -__toString -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Fixed bug #62795 (Zip extension version not defined): .gitattributes
Commit:e1180b4f1aea83ee5dc7f62832a10056e0f62f18 Author:Xinchen Hui larue...@php.net Sat, 11 Aug 2012 15:59:06 +0800 Parents: 7130887719684cff57cb904a6f1b2de5016a00c8 Branches: PHP-5.3 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=e1180b4f1aea83ee5dc7f62832a10056e0f62f18 Log: Fixed bug #62795 (Zip extension version not defined) Bugs: https://bugs.php.net/62795 Changed paths: M .gitattributes Diff: diff --git a/.gitattributes b/.gitattributes index d53e569..862575b 100644 --- a/.gitattributes +++ b/.gitattributes @@ -15,6 +15,7 @@ ext/dba/libflatfile/flatfile.c ident ext/dba/libcdb/cdb_make.c ident ext/dba/libcdb/cdb.cident ext/filter/filter.c ident +ext/zip/php_zip.c ident README.input_filter ident run-tests.php ident sapi/nsapi/nsapi.c ident -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.3' into PHP-5.4: .gitattributes
Commit:d4f9bbfae248687c1aa68370564b14544eb4eafd Author:Xinchen Hui larue...@php.net Sat, 11 Aug 2012 16:00:00 +0800 Parents: 5ae7540abd241a9d0453ce8a37637068140897a9 e1180b4f1aea83ee5dc7f62832a10056e0f62f18 Branches: PHP-5.4 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=d4f9bbfae248687c1aa68370564b14544eb4eafd Log: Merge branch 'PHP-5.3' into PHP-5.4 Changed paths: MM .gitattributes Diff: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: more test script for #62328: ext/spl/tests/bug62328.phpt
Commit:212cfb95d1c7eb7202e1386294808eceef386b78 Author:Xinchen Hui larue...@php.net Mon, 13 Aug 2012 11:03:35 +0800 Parents: be818e7ea7a7627ab12faa70d9e70a85c823f738 Branches: PHP-5.4 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=212cfb95d1c7eb7202e1386294808eceef386b78 Log: more test script for #62328 Bugs: https://bugs.php.net/62328 Changed paths: A ext/spl/tests/bug62328.phpt Diff: diff --git a/ext/spl/tests/bug62328.phpt b/ext/spl/tests/bug62328.phpt new file mode 100644 index 000..33a8aee --- /dev/null +++ b/ext/spl/tests/bug62328.phpt @@ -0,0 +1,24 @@ +--TEST-- +Bug #62328 (cast_object takes precedence over __toString) +--CREDITS-- +leight at gmail dot com +--FILE-- +?php + +class SplFileInfo62328 extends SplFileInfo +{ +public function __toString() +{ +return '__toString'; +} +} + +$fi = new SplFileInfo62328(__FILE__); + +echo (string)$fi . PHP_EOL; +echo (string)$fi-__toString() . PHP_EOL; + +? +--EXPECT-- +__toString +__toString -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Fix test, from PR 158: ext/xmlrpc/tests/bug61264.phpt
Commit:7130887719684cff57cb904a6f1b2de5016a00c8 Author:Xinchen Hui larue...@php.net Sat, 11 Aug 2012 00:22:52 +0800 Parents: c4b26cc1b0b0521c75e653fffec2a9e3b4bf8cbb Branches: PHP-5.3 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=7130887719684cff57cb904a6f1b2de5016a00c8 Log: Fix test, from PR 158 Changed paths: M ext/xmlrpc/tests/bug61264.phpt Diff: diff --git a/ext/xmlrpc/tests/bug61264.phpt b/ext/xmlrpc/tests/bug61264.phpt index b1da27f..24e4b27 100644 --- a/ext/xmlrpc/tests/bug61264.phpt +++ b/ext/xmlrpc/tests/bug61264.phpt @@ -1,5 +1,7 @@ --TEST-- Bug #61264: xmlrpc_parse_method_descriptions leaks temporary variable +--SKIPIF-- +?php if (!extension_loaded(xmlrpc)) print skip; ? --FILE-- ?php $xml = XML -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Fixed bug #62744 (dangling pointers made by zend_disable_class): NEWS Zend/zend_API.c Zend/zend_API.h
Commit:03a1fcabf31210d3f304bfacf5096ce43c2b8f93 Author:Xinchen Hui larue...@php.net Sat, 4 Aug 2012 10:41:26 +0800 Parents: 49b202f2cfe04d577671b685b7c0d3a096a433c7 Branches: PHP-5.3 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=03a1fcabf31210d3f304bfacf5096ce43c2b8f93 Log: Fixed bug #62744 (dangling pointers made by zend_disable_class) the test will be added while commit the fix for #62737 Bugs: https://bugs.php.net/62744 https://bugs.php.net/62737 Changed paths: M NEWS M Zend/zend_API.c M Zend/zend_API.h Diff: diff --git a/NEWS b/NEWS index 05a80eb..c22d7c2 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,7 @@ PHP NEWS ?? ??? 2012, PHP 5.3.16 - Core: + . Fixed bug #62744 (dangling pointers made by zend_disable_class). (Laruence) . Fixed bug #62716 (munmap() is called with the incorrect length). (slang...@google.com) . Fixed bug #60194 (--with-zend-multibyte and --enable-debug reports LEAK diff --git a/Zend/zend_API.c b/Zend/zend_API.c index 6d2ccd2..16a940d 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -2342,16 +2342,16 @@ static const zend_function_entry disabled_class_new[] = { ZEND_API int zend_disable_class(char *class_name, uint class_name_length TSRMLS_DC) /* {{{ */ { - zend_class_entry disabled_class; + zend_class_entry **disabled_class; zend_str_tolower(class_name, class_name_length); - if (zend_hash_del(CG(class_table), class_name, class_name_length+1)==FAILURE) { + if (zend_hash_find(CG(class_table), class_name, class_name_length+1, (void **)disabled_class)==FAILURE) { return FAILURE; } - INIT_OVERLOADED_CLASS_ENTRY_EX(disabled_class, class_name, class_name_length, disabled_class_new, NULL, NULL, NULL, NULL, NULL); - disabled_class.create_object = display_disabled_class; - disabled_class.name_length = class_name_length; - zend_register_internal_class(disabled_class TSRMLS_CC); + INIT_CLASS_ENTRY_INIT_METHODS((**disabled_class), disabled_class_new, NULL, NULL, NULL, NULL, NULL); + (*disabled_class)-create_object = display_disabled_class; + (*disabled_class)-builtin_functions = disabled_class_new; + zend_hash_clean(((*disabled_class)-function_table)); return SUCCESS; } /* }}} */ @@ -2425,7 +2425,6 @@ static int zend_is_callable_check_class(const char *name, int name_len, zend_fca } /* }}} */ - static int zend_is_callable_check_func(int check_flags, zval *callable, zend_fcall_info_cache *fcc, int strict_class, char **error TSRMLS_DC) /* {{{ */ { zend_class_entry *ce_org = fcc-calling_scope; diff --git a/Zend/zend_API.h b/Zend/zend_API.h index 0a2a595..ddd84fa 100644 --- a/Zend/zend_API.h +++ b/Zend/zend_API.h @@ -170,6 +170,11 @@ typedef struct _zend_fcall_info_cache { int _len = class_name_len; \ class_container.name = zend_strndup(class_name, _len); \ class_container.name_length = _len; \ + INIT_CLASS_ENTRY_INIT_METHODS(class_container, functions, handle_fcall, handle_propget, handle_propset, handle_propunset, handle_propisset) \ + } + +#define INIT_CLASS_ENTRY_INIT_METHODS(class_container, functions, handle_fcall, handle_propget, handle_propset, handle_propunset, handle_propisset) \ + { \ class_container.builtin_functions = functions; \ class_container.constructor = NULL; \ class_container.destructor = NULL; \ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: This becomes useless, since we have set that in the INIT macro: Zend/zend_API.c
Commit:f4a315fce2658a5338486e17ee11d77bd3dcb14b Author:Xinchen Hui larue...@php.net Sat, 4 Aug 2012 11:03:21 +0800 Parents: 03a1fcabf31210d3f304bfacf5096ce43c2b8f93 Branches: PHP-5.3 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=f4a315fce2658a5338486e17ee11d77bd3dcb14b Log: This becomes useless, since we have set that in the INIT macro Changed paths: M Zend/zend_API.c Diff: diff --git a/Zend/zend_API.c b/Zend/zend_API.c index 16a940d..5618213 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -2350,7 +2350,6 @@ ZEND_API int zend_disable_class(char *class_name, uint class_name_length TSRMLS_ } INIT_CLASS_ENTRY_INIT_METHODS((**disabled_class), disabled_class_new, NULL, NULL, NULL, NULL, NULL); (*disabled_class)-create_object = display_disabled_class; - (*disabled_class)-builtin_functions = disabled_class_new; zend_hash_clean(((*disabled_class)-function_table)); return SUCCESS; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.3' into PHP-5.4: Zend/zend_API.c Zend/zend_API.h
Commit:d289efb45771217a826f10def835a6185683a1eb Author:Xinchen Hui larue...@php.net Sat, 4 Aug 2012 11:14:03 +0800 Parents: d1f0662e4d587754742891f0a179551d8f36674f 03a1fcabf31210d3f304bfacf5096ce43c2b8f93 Branches: PHP-5.4 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=d289efb45771217a826f10def835a6185683a1eb Log: Merge branch 'PHP-5.3' into PHP-5.4 Conflicts: Zend/zend_API.h Changed paths: MM Zend/zend_API.c MM Zend/zend_API.h Diff: diff --cc Zend/zend_API.c index 98a33e5,16a940d..827446b --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@@ -2547,16 -2342,16 +2547,15 @@@ static const zend_function_entry disabl ZEND_API int zend_disable_class(char *class_name, uint class_name_length TSRMLS_DC) /* {{{ */ { - zend_class_entry disabled_class; + zend_class_entry **disabled_class; zend_str_tolower(class_name, class_name_length); - if (zend_hash_del(CG(class_table), class_name, class_name_length+1)==FAILURE) { + if (zend_hash_find(CG(class_table), class_name, class_name_length+1, (void **)disabled_class)==FAILURE) { return FAILURE; } - INIT_OVERLOADED_CLASS_ENTRY_EX(disabled_class, class_name, class_name_length, disabled_class_new, NULL, NULL, NULL, NULL, NULL); - disabled_class.create_object = display_disabled_class; - disabled_class.name_length = class_name_length; - zend_register_internal_class(disabled_class TSRMLS_CC); + INIT_CLASS_ENTRY_INIT_METHODS((**disabled_class), disabled_class_new, NULL, NULL, NULL, NULL, NULL); + (*disabled_class)-create_object = display_disabled_class; - (*disabled_class)-builtin_functions = disabled_class_new; + zend_hash_clean(((*disabled_class)-function_table)); return SUCCESS; } /* }}} */ diff --cc Zend/zend_API.h index f54db7f,ddd84fa..d7fbc3c --- a/Zend/zend_API.h +++ b/Zend/zend_API.h @@@ -168,13 -167,15 +168,18 @@@ typedef struct _zend_fcall_info_cache #define INIT_OVERLOADED_CLASS_ENTRY_EX(class_container, class_name, class_name_len, functions, handle_fcall, handle_propget, handle_propset, handle_propunset, handle_propisset) \ { \ + const char *cl_name = class_name; \ int _len = class_name_len; \ - class_container.name = zend_strndup(class_name, _len); \ + class_container.name = zend_new_interned_string(cl_name, _len+1, 0 TSRMLS_CC); \ + if (class_container.name == cl_name) { \ + class_container.name = zend_strndup(cl_name, _len); \ + } \ class_container.name_length = _len; \ + INIT_CLASS_ENTRY_INIT_METHODS(class_container, functions, handle_fcall, handle_propget, handle_propset, handle_propunset, handle_propisset) \ + } + + #define INIT_CLASS_ENTRY_INIT_METHODS(class_container, functions, handle_fcall, handle_propget, handle_propset, handle_propunset, handle_propisset) \ + { \ - class_container.builtin_functions = functions; \ class_container.constructor = NULL; \ class_container.destructor = NULL; \ class_container.clone = NULL; \ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: fix test due to float value: ext/standard/tests/file/realpath_cache.phpt
Commit:9a690859f6491dd5c14dfd6c907a5563c8aedd17 Author:Xinchen Hui larue...@php.net Thu, 2 Aug 2012 19:14:06 +0800 Parents: cd896d69d90c70fd13efec315fd8b1f6647497b9 Branches: PHP-5.3 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=9a690859f6491dd5c14dfd6c907a5563c8aedd17 Log: fix test due to float value Changed paths: M ext/standard/tests/file/realpath_cache.phpt Diff: diff --git a/ext/standard/tests/file/realpath_cache.phpt b/ext/standard/tests/file/realpath_cache.phpt index 92d6fc5..0eb9dc5 100644 --- a/ext/standard/tests/file/realpath_cache.phpt +++ b/ext/standard/tests/file/realpath_cache.phpt @@ -19,7 +19,7 @@ echo Done\n; int(%d) array(4) { [key]= - %s(%d) + %s(%f) [is_dir]= bool(true) [realpath]= -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Fix test, wrong exepct rule used: ext/intl/tests/bug59597_64.phpt
Commit:2b6ac9e1a0ce6efddba9d513b99a67f8e5d43764 Author:Xinchen Hui larue...@php.net Thu, 2 Aug 2012 19:31:34 +0800 Parents: 9a690859f6491dd5c14dfd6c907a5563c8aedd17 Branches: PHP-5.3 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=2b6ac9e1a0ce6efddba9d513b99a67f8e5d43764 Log: Fix test, wrong exepct rule used Changed paths: M ext/intl/tests/bug59597_64.phpt Diff: diff --git a/ext/intl/tests/bug59597_64.phpt b/ext/intl/tests/bug59597_64.phpt index 4b96bf7..eb70995 100644 --- a/ext/intl/tests/bug59597_64.phpt +++ b/ext/intl/tests/bug59597_64.phpt @@ -15,7 +15,6 @@ $value = $formatter-parse('2147483650', \NumberFormatter::TYPE_INT64); var_dump($value); ? ---EXPECTREGEX-- +--EXPECT-- int(2147483647) int(2147483650) - -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Fixed bug that can not get default value of parameter if it's not `optional`: ext/reflection/php_reflection.c ext/reflection/tests/bug62715.phpt
Commit:49b202f2cfe04d577671b685b7c0d3a096a433c7 Author:Xinchen Hui larue...@php.net Thu, 2 Aug 2012 22:16:46 +0800 Parents: 2b6ac9e1a0ce6efddba9d513b99a67f8e5d43764 Branches: PHP-5.3 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=49b202f2cfe04d577671b685b7c0d3a096a433c7 Log: Fixed bug that can not get default value of parameter if it's not `optional` Changed paths: M ext/reflection/php_reflection.c M ext/reflection/tests/bug62715.phpt Diff: diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 23c9044..593a050 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -2406,10 +2406,6 @@ ZEND_METHOD(reflection_parameter, getDefaultValue) zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, Cannot determine default value for internal functions); return; } - if (param-offset param-required) { - zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, Parameter is not optional); - return; - } precv = _get_recv_op((zend_op_array*)param-fptr, param-offset); if (!precv || precv-opcode != ZEND_RECV_INIT || precv-op2.op_type == IS_UNUSED) { zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, Internal error); diff --git a/ext/reflection/tests/bug62715.phpt b/ext/reflection/tests/bug62715.phpt index 721d484..feb67f6 100644 --- a/ext/reflection/tests/bug62715.phpt +++ b/ext/reflection/tests/bug62715.phpt @@ -10,8 +10,15 @@ foreach ($r-getParameters() as $p) { var_dump($p-isDefaultValueAvailable()); } +foreach ($r-getParameters() as $p) { +if ($p-isDefaultValueAvailable()) { +var_dump($p-getDefaultValue()); +} +} ? --EXPECT-- bool(true) bool(true) bool(false) +NULL +int(0) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Fixed bug that can not get default value of parameter if it's not `optional`: ext/reflection/php_reflection.c ext/reflection/tests/ReflectionParameter_DefaultValueConstant_error
Commit:170ee90bf962d288bdcf6cf0c8c4a2a30c5c1ba2 Author:Xinchen Hui larue...@php.net Thu, 2 Aug 2012 22:28:04 +0800 Parents: 3b5defd3b09bf827239087126261ce9abdc13d09 Branches: PHP-5.4 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=170ee90bf962d288bdcf6cf0c8c4a2a30c5c1ba2 Log: Fixed bug that can not get default value of parameter if it's not `optional` Changed paths: M ext/reflection/php_reflection.c M ext/reflection/tests/ReflectionParameter_DefaultValueConstant_error.phpt M ext/reflection/tests/bug62715.phpt Diff: diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 7e80dea..6656f58 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -1477,11 +1477,6 @@ static parameter_reference *_reflection_param_get_default_param(INTERNAL_FUNCTIO return NULL; } - if (param-offset param-required) { - zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, Parameter is not optional); - return NULL; - } - return param; } /* }}} */ @@ -1497,7 +1492,7 @@ static zend_op *_reflection_param_get_default_precv(INTERNAL_FUNCTION_PARAMETERS precv = _get_recv_op((zend_op_array*)param-fptr, param-offset); if (!precv || precv-opcode != ZEND_RECV_INIT || precv-op2_type == IS_UNUSED) { - zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, Internal error); + zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, Internal error: Failed to retrieve the default value); return NULL; } diff --git a/ext/reflection/tests/ReflectionParameter_DefaultValueConstant_error.phpt b/ext/reflection/tests/ReflectionParameter_DefaultValueConstant_error.phpt index 984b06e..a2c2d24 100644 --- a/ext/reflection/tests/ReflectionParameter_DefaultValueConstant_error.phpt +++ b/ext/reflection/tests/ReflectionParameter_DefaultValueConstant_error.phpt @@ -18,8 +18,6 @@ foreach($reflect-getParameters() as $param) { } } ? -==DONE== --EXPECT-- -Parameter is not optional +Internal error: Failed to retrieve the default value CONST_TEST_1 -==DONE== diff --git a/ext/reflection/tests/bug62715.phpt b/ext/reflection/tests/bug62715.phpt index 721d484..feb67f6 100644 --- a/ext/reflection/tests/bug62715.phpt +++ b/ext/reflection/tests/bug62715.phpt @@ -10,8 +10,15 @@ foreach ($r-getParameters() as $p) { var_dump($p-isDefaultValueAvailable()); } +foreach ($r-getParameters() as $p) { +if ($p-isDefaultValueAvailable()) { +var_dump($p-getDefaultValue()); +} +} ? --EXPECT-- bool(true) bool(true) bool(false) +NULL +int(0) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Fixed bug #62725 (Calling exit() in a shutdown function does not return the exit value): NEWS sapi/cli/php_cli.c
Commit:d1f0662e4d587754742891f0a179551d8f36674f Author:Xinchen Hui larue...@php.net Thu, 2 Aug 2012 23:03:38 +0800 Parents: 170ee90bf962d288bdcf6cf0c8c4a2a30c5c1ba2 Branches: PHP-5.4 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=d1f0662e4d587754742891f0a179551d8f36674f Log: Fixed bug #62725 (Calling exit() in a shutdown function does not return the exit value) The fix is make 5.4 behavior consistent with 5.3 Bugs: https://bugs.php.net/62725 Changed paths: M NEWS M sapi/cli/php_cli.c Diff: diff --git a/NEWS b/NEWS index 6b0d2d9..623a791 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,10 @@ PHP NEWS ||| ?? ??? 2012, PHP 5.4.7 +- Core: + . Fixed bug #62725 (Calling exit() in a shutdown function does not return +the exit value). (Laruence) + - PDO: . Fixed bug #62685 (Wrong return datatype in PDO::inTransaction()). (Laruence) diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c index 2cdd1aa..f9bf3ee 100644 --- a/sapi/cli/php_cli.c +++ b/sapi/cli/php_cli.c @@ -1167,15 +1167,15 @@ static int do_cli(int argc, char **argv TSRMLS_DC) /* {{{ */ } zend_end_try(); out: - if (exit_status == 0) { - exit_status = EG(exit_status); - } if (request_started) { php_request_shutdown((void *) 0); } if (translated_path) { free(translated_path); } + if (exit_status == 0) { + exit_status = EG(exit_status); + } return exit_status; err: sapi_deactivate(TSRMLS_C); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] com php-src: Fixed bug that can not get default value of parameter if it's not `optional`: ext/reflection/php_reflection.c ext/reflection/tests/ReflectionParameter_DefaultValueConstant_e
thinking of Function foo($a = 1, $b) I agree this is kind of wrong usage. But that is allowed Thanks 发自我的 iPad 在 2012-8-3,1:35,Stas Malyshev smalys...@sugarcrm.com 写道: Hi! Commit:170ee90bf962d288bdcf6cf0c8c4a2a30c5c1ba2 Author:Xinchen Hui larue...@php.net Thu, 2 Aug 2012 22:28:04 +0800 Parents: 3b5defd3b09bf827239087126261ce9abdc13d09 Branches: PHP-5.4 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=170ee90bf962d288bdcf6cf0c8c4a2a30c5c1ba2 Log: Fixed bug that can not get default value of parameter if it's not `optional` What you mean here? Optional parameters are those that have default values, not? -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227 -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Fixed bug #62715 (ReflectionParameter::isDefaultValueAvailable() wrong result): NEWS ext/reflection/php_reflection.c ext/reflection/tests/bug62715.phpt
Commit:10642aa9e4f1eb694a8f7b514cc234cb24545744 Author:Xinchen Hui larue...@php.net Wed, 1 Aug 2012 20:23:30 +0800 Parents: 645f84e41bbda22c7a19326cd1a7df7994678976 Branches: PHP-5.3 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=10642aa9e4f1eb694a8f7b514cc234cb24545744 Log: Fixed bug #62715 (ReflectionParameter::isDefaultValueAvailable() wrong result) Bugs: https://bugs.php.net/62715 Changed paths: M NEWS M ext/reflection/php_reflection.c A ext/reflection/tests/bug62715.phpt Diff: diff --git a/NEWS b/NEWS index 5aa35d7..b836d4f 100644 --- a/NEWS +++ b/NEWS @@ -13,6 +13,10 @@ PHP NEWS - DateTime: . Fixed Bug #62500 (Segfault in DateInterval class when extended). (Laruence) +- Reflection: + . Fixed bug #62715 (ReflectionParameter::isDefaultValueAvailable() wrong +result). (Laruence) + - SPL: . Fixed bug #62616 (ArrayIterator::count() from IteratorIterator instance gives Segmentation fault). (Laruence, Gustavo) diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index e98652b..23c9044 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -2379,9 +2379,7 @@ ZEND_METHOD(reflection_parameter, isDefaultValueAvailable) { RETURN_FALSE; } - if (param-offset param-required) { - RETURN_FALSE; - } + precv = _get_recv_op((zend_op_array*)param-fptr, param-offset); if (!precv || precv-opcode != ZEND_RECV_INIT || precv-op2.op_type == IS_UNUSED) { RETURN_FALSE; diff --git a/ext/reflection/tests/bug62715.phpt b/ext/reflection/tests/bug62715.phpt new file mode 100644 index 000..721d484 --- /dev/null +++ b/ext/reflection/tests/bug62715.phpt @@ -0,0 +1,17 @@ +--TEST-- +Bug #62715 (ReflectionParameter::isDefaultValueAvailable() wrong result) +--FILE-- +?php + +function test(PDO $a = null, $b = 0, array $c) {} +$r = new ReflectionFunction('test'); + +foreach ($r-getParameters() as $p) { +var_dump($p-isDefaultValueAvailable()); +} + +? +--EXPECT-- +bool(true) +bool(true) +bool(false) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.3' into PHP-5.4: ext/reflection/php_reflection.c
Commit:2026e9040ff3093e53083baefc1299b1efa25c4c Author:Xinchen Hui larue...@php.net Wed, 1 Aug 2012 20:24:14 +0800 Parents: ff729aabf7a3dd7bd76b50dcaf7051e414f3714c 10642aa9e4f1eb694a8f7b514cc234cb24545744 Branches: PHP-5.4 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=2026e9040ff3093e53083baefc1299b1efa25c4c Log: Merge branch 'PHP-5.3' into PHP-5.4 Changed paths: MM ext/reflection/php_reflection.c Diff: diff --cc ext/reflection/php_reflection.c index bcdcdae,23c9044..7e80dea --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@@ -2568,11 -2379,9 +2568,9 @@@ ZEND_METHOD(reflection_parameter, isDef { RETURN_FALSE; } - if (param-offset param-required) { - RETURN_FALSE; - } + precv = _get_recv_op((zend_op_array*)param-fptr, param-offset); - if (!precv || precv-opcode != ZEND_RECV_INIT || precv-op2.op_type == IS_UNUSED) { + if (!precv || precv-opcode != ZEND_RECV_INIT || precv-op2_type == IS_UNUSED) { RETURN_FALSE; } RETURN_TRUE; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: update NEWS: NEWS
Commit:7398029e0676964b7b16219c1a9696d3a7c345c9 Author:Xinchen Hui larue...@php.net Wed, 1 Aug 2012 20:24:53 +0800 Parents: 2026e9040ff3093e53083baefc1299b1efa25c4c Branches: PHP-5.4 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=7398029e0676964b7b16219c1a9696d3a7c345c9 Log: update NEWS Changed paths: M NEWS Diff: diff --git a/NEWS b/NEWS index 3fbbe7c..a84e756 100644 --- a/NEWS +++ b/NEWS @@ -39,6 +39,8 @@ PHP NEWS sapi/cli/cli.h: No such file). (Johannes) - Reflection: + . Fixed bug #62715 (ReflectionParameter::isDefaultValueAvailable() wrong +result). (Laruence) . Implemented FR #61602 (Allow access to name of constant used as default value). (reeze@gmail.com) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Sleep a little bit more, in some slow machine (like gcov), it will take a little more time to setup server: sapi/cli/tests/php_cli_server.inc
Commit:36100060b31ba85d5c70669168cfd418522884ce Author:Xinchen Hui larue...@php.net Wed, 1 Aug 2012 23:54:01 +0800 Parents: 7398029e0676964b7b16219c1a9696d3a7c345c9 Branches: PHP-5.4 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=36100060b31ba85d5c70669168cfd418522884ce Log: Sleep a little bit more, in some slow machine (like gcov), it will take a little more time to setup server Changed paths: M sapi/cli/tests/php_cli_server.inc Diff: diff --git a/sapi/cli/tests/php_cli_server.inc b/sapi/cli/tests/php_cli_server.inc index 3479cd0..40c5361 100644 --- a/sapi/cli/tests/php_cli_server.inc +++ b/sapi/cli/tests/php_cli_server.inc @@ -38,7 +38,7 @@ function php_cli_server_start($code = 'echo Hello world;', $no_router = FALSE) // note: even when server prints 'Listening on localhost:8964...Press Ctrl-C to quit.' // it might not be listening yet...need to wait until fsockopen() call returns $i = 0; -while (($i++ 5) !($fp = @fsockopen(PHP_CLI_SERVER_HOSTNAME, PHP_CLI_SERVER_PORT))) { +while (($i++ 30) !($fp = @fsockopen(PHP_CLI_SERVER_HOSTNAME, PHP_CLI_SERVER_PORT))) { usleep(1); } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Fixed bug #62716 (munmap() is called with the incorrect length): NEWS Zend/zend_stream.c
Commit:433089ccb4d4747a01d522e8678664ff17584615 Author:Xinchen Hui larue...@php.net Thu, 2 Aug 2012 12:30:07 +0800 Parents: 10642aa9e4f1eb694a8f7b514cc234cb24545744 Branches: PHP-5.3 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=433089ccb4d4747a01d522e8678664ff17584615 Log: Fixed bug #62716 (munmap() is called with the incorrect length) Bugs: https://bugs.php.net/62716 Changed paths: M NEWS M Zend/zend_stream.c Diff: diff --git a/NEWS b/NEWS index b836d4f..97fc6d6 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,8 @@ PHP NEWS ?? ??? 2012, PHP 5.3.16 - Core: + . Fixed bug #62716 (munmap() is called with the incorrect length). +(slang...@google.com) . Fixed bug #60194 (--with-zend-multibyte and --enable-debug reports LEAK with run-test.php). (Laruence) diff --git a/Zend/zend_stream.c b/Zend/zend_stream.c index 5a02ecd..bc5206c 100644 --- a/Zend/zend_stream.c +++ b/Zend/zend_stream.c @@ -79,7 +79,7 @@ static size_t zend_stream_stdio_fsizer(void *handle TSRMLS_DC) /* {{{ */ static void zend_stream_unmap(zend_stream *stream TSRMLS_DC) { /* {{{ */ #if HAVE_MMAP if (stream-mmap.map) { - munmap(stream-mmap.map, stream-mmap.len); + munmap(stream-mmap.map, stream-mmap.len + ZEND_MMAP_AHEAD); } else #endif if (stream-mmap.buf) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.3' into PHP-5.4: Zend/zend_stream.c
Commit:242658c053f505dfd3f307cea348867beee450ee Author:Xinchen Hui larue...@php.net Thu, 2 Aug 2012 12:32:44 +0800 Parents: ce92857131e24bf1c06b798b424367c6ce9dabcd 433089ccb4d4747a01d522e8678664ff17584615 Branches: PHP-5.4 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=242658c053f505dfd3f307cea348867beee450ee Log: Merge branch 'PHP-5.3' into PHP-5.4 Changed paths: MM Zend/zend_stream.c Diff: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Fixed bug #62685 (Wrong return datatype in PDO::inTransaction()): NEWS ext/pdo/pdo_dbh.c
Commit:cd896d69d90c70fd13efec315fd8b1f6647497b9 Author:Xinchen Hui larue...@php.net Thu, 2 Aug 2012 12:52:11 +0800 Parents: 433089ccb4d4747a01d522e8678664ff17584615 Branches: PHP-5.3 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=cd896d69d90c70fd13efec315fd8b1f6647497b9 Log: Fixed bug #62685 (Wrong return datatype in PDO::inTransaction()) Bugs: https://bugs.php.net/62685 Changed paths: M NEWS M ext/pdo/pdo_dbh.c Diff: diff --git a/NEWS b/NEWS index 97fc6d6..05a80eb 100644 --- a/NEWS +++ b/NEWS @@ -13,7 +13,10 @@ PHP NEWS (r.hampartsum...@gmail.com, Laruence) - DateTime: - . Fixed Bug #62500 (Segfault in DateInterval class when extended). (Laruence) + . Fixed bug #62500 (Segfault in DateInterval class when extended). (Laruence) + +- PDO: + . Fixed bug #62685 (Wrong return datatype in PDO::inTransaction()). (Laruence) - Reflection: . Fixed bug #62715 (ReflectionParameter::isDefaultValueAvailable() wrong diff --git a/ext/pdo/pdo_dbh.c b/ext/pdo/pdo_dbh.c index 6b3ba3b..4035b2b 100755 --- a/ext/pdo/pdo_dbh.c +++ b/ext/pdo/pdo_dbh.c @@ -694,7 +694,7 @@ static PHP_METHOD(PDO, inTransaction) } PDO_CONSTRUCT_CHECK; - RETURN_LONG(dbh-in_txn); + RETURN_BOOL(dbh-in_txn); } /* }}} */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Fixed bug #62685 (Wrong return datatype in PDO::inTransaction()): NEWS ext/pdo/pdo_dbh.c
Commit:53c8612fe780a80fde64da118587e6096b16b595 Author:Xinchen Hui larue...@php.net Thu, 2 Aug 2012 12:55:05 +0800 Parents: 80520d0903b0726d3ce6121e2fd80438f9754468 Branches: PHP-5.4 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=53c8612fe780a80fde64da118587e6096b16b595 Log: Fixed bug #62685 (Wrong return datatype in PDO::inTransaction()) Bugs: https://bugs.php.net/62685 Changed paths: M NEWS M ext/pdo/pdo_dbh.c Diff: diff --git a/NEWS b/NEWS index 084f3cd..6b0d2d9 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,9 @@ PHP NEWS ||| ?? ??? 2012, PHP 5.4.7 +- PDO: + . Fixed bug #62685 (Wrong return datatype in PDO::inTransaction()). (Laruence) + - Reflection: . Fixed bug #62715 (ReflectionParameter::isDefaultValueAvailable() wrong result). (Laruence) diff --git a/ext/pdo/pdo_dbh.c b/ext/pdo/pdo_dbh.c index b4f383c..acdc0dd 100755 --- a/ext/pdo/pdo_dbh.c +++ b/ext/pdo/pdo_dbh.c @@ -700,7 +700,7 @@ static PHP_METHOD(PDO, inTransaction) RETURN_BOOL(dbh-in_txn); } - RETURN_LONG(dbh-methods-in_transaction(dbh TSRMLS_CC)); + RETURN_BOOL(dbh-methods-in_transaction(dbh TSRMLS_CC)); } /* }}} */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Implemented FR #62700 (have the console output 'Listening on http://localhost:8000'): NEWS sapi/cli/php_cli_server.c
Commit:0988ae3c43982db1474dd7e9a772953c8a7cf0c6 Author:Xinchen Hui larue...@php.net Tue, 31 Jul 2012 22:42:28 +0800 Parents: 572d6437bc84123e8971e2f35b4fdf14e1e0e5f5 Branches: PHP-5.4 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=0988ae3c43982db1474dd7e9a772953c8a7cf0c6 Log: Implemented FR #62700 (have the console output 'Listening on http://localhost:8000') Bugs: https://bugs.php.net/62700 Changed paths: M NEWS M sapi/cli/php_cli_server.c Diff: diff --git a/NEWS b/NEWS index 7336376..5a5fda7 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,10 @@ PHP NEWS ||| ?? ??? 2012, PHP 5.4.6 +- CLI Server: + . Implemented FR #62700 (have the console output 'Listening on +http://localhost:8000'). (pascal.chev...@free.fr) + - Core: . Fixed bug #62661 (Interactive php-cli crashes if include() is used in auto_prepend_file). (Laruence) diff --git a/sapi/cli/php_cli_server.c b/sapi/cli/php_cli_server.c index 02f8854..e80ab68 100644 --- a/sapi/cli/php_cli_server.c +++ b/sapi/cli/php_cli_server.c @@ -2407,7 +2407,7 @@ int do_cli_server(int argc, char **argv TSRMLS_DC) /* {{{ */ php_localtime_r(tv.tv_sec, tm); php_asctime_r(tm, buf); printf(PHP %s Development Server started at %s - Listening on %s\n + Listening on http://%s\n; Document root is %s\n Press Ctrl-C to quit.\n, PHP_VERSION, buf, server_bind_address, document_root); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Test for bug #62680: Zend/tests/bug62680.phpt
Commit:645f84e41bbda22c7a19326cd1a7df7994678976 Author:Xinchen Hui larue...@php.net Tue, 31 Jul 2012 10:49:13 +0800 Parents: 7e3e1837c8e60ad87e9b7aee6cb306a843f5c784 Branches: PHP-5.3 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=645f84e41bbda22c7a19326cd1a7df7994678976 Log: Test for bug #62680 Bugs: https://bugs.php.net/62680 Changed paths: A Zend/tests/bug62680.phpt Diff: diff --git a/Zend/tests/bug62680.phpt b/Zend/tests/bug62680.phpt new file mode 100644 index 000..804dece --- /dev/null +++ b/Zend/tests/bug62680.phpt @@ -0,0 +1,13 @@ +--TEST-- +Bug #62680 (Function isset() throws fatal error on set array if non-existent key depth = 3) +--XFAIL-- +see https://bugs.php.net/62680 +--FILE-- +?php +$array = array(); +var_dump(isset($array[0][a][b])); +var_dump(isset($array[0][a][b][c])); +? +--EXPECT-- +bool(false) +bool(false) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: expect pass for 5.4: Zend/tests/bug62680.phpt
Commit:572d6437bc84123e8971e2f35b4fdf14e1e0e5f5 Author:Xinchen Hui larue...@php.net Tue, 31 Jul 2012 10:51:18 +0800 Parents: c730329bb0e0771268e8a201fe1d850fbf16d3fd Branches: PHP-5.4 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=572d6437bc84123e8971e2f35b4fdf14e1e0e5f5 Log: expect pass for 5.4 Changed paths: M Zend/tests/bug62680.phpt Diff: diff --git a/Zend/tests/bug62680.phpt b/Zend/tests/bug62680.phpt index 804dece..e2a2366 100644 --- a/Zend/tests/bug62680.phpt +++ b/Zend/tests/bug62680.phpt @@ -1,7 +1,5 @@ --TEST-- Bug #62680 (Function isset() throws fatal error on set array if non-existent key depth = 3) ---XFAIL-- -see https://bugs.php.net/62680 --FILE-- ?php $array = array(); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Sike test while there is no zend mm max_size guard: ext/standard/tests/streams/bug61115-1.phpt
Commit:f419d614ba79dbf2b4d7eae016a39cc9735a2cb2 Author:Xinchen Hui larue...@php.net Sun, 29 Jul 2012 14:30:01 +0800 Parents: 880a6cee0068e980fd1eed735675d9b7d37968a0 Branches: PHP-5.3 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=f419d614ba79dbf2b4d7eae016a39cc9735a2cb2 Log: Sike test while there is no zend mm max_size guard Changed paths: M ext/standard/tests/streams/bug61115-1.phpt Diff: diff --git a/ext/standard/tests/streams/bug61115-1.phpt b/ext/standard/tests/streams/bug61115-1.phpt index 89374e7..99e2f79 100644 --- a/ext/standard/tests/streams/bug61115-1.phpt +++ b/ext/standard/tests/streams/bug61115-1.phpt @@ -1,5 +1,11 @@ --TEST-- Bug #61115: Stream related segfault on fatal error in php_stream_context_del_link - variation 1 +--SKIPIF-- +?php +if (getenv(USE_ZEND_ALLOC) === 0) { +die(skip Zend MM disabled); +} +? --FILE-- ?php -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Fix test failed due to new feature introduced in 45d596ea: ext/json/json.c ext/json/tests/json_encode_error.phpt
Commit:f8559194db82a231bbed547bd15f077e343914e4 Author:Xinchen Hui larue...@php.net Sun, 29 Jul 2012 23:35:06 +0800 Parents: 9c73c8d58d9948e6a38f8053c4a6da1dcbd2ac94 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=f8559194db82a231bbed547bd15f077e343914e4 Log: Fix test failed due to new feature introduced in 45d596ea Changed paths: M ext/json/json.c M ext/json/tests/json_encode_error.phpt Diff: diff --git a/ext/json/json.c b/ext/json/json.c index dab4230..e4bb8a5 100644 --- a/ext/json/json.c +++ b/ext/json/json.c @@ -700,7 +700,7 @@ PHP_JSON_API void php_json_decode_ex(zval *return_value, char *str, int str_len, /* }}} */ -/* {{{ proto string json_encode(mixed data [, int options]) +/* {{{ proto string json_encode(mixed data [, int options[, int depth]]) Returns the JSON representation of a value */ static PHP_FUNCTION(json_encode) { diff --git a/ext/json/tests/json_encode_error.phpt b/ext/json/tests/json_encode_error.phpt index d130dd9..547c8be 100644 --- a/ext/json/tests/json_encode_error.phpt +++ b/ext/json/tests/json_encode_error.phpt @@ -34,7 +34,5 @@ Warning: json_encode() expects at least 1 parameter, 0 given in %s on line %d NULL -- Testing json_encode() function with more than expected no. of arguments -- - -Warning: json_encode() expects at most 2 parameters, 3 given in %s on line %d -NULL +string(5) abc ===Done=== -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Fixed bug #60194 for eavl: Zend/zend_language_scanner.c Zend/zend_language_scanner.l Zend/zend_language_scanner_defs.h
Commit:b477a84026a39a58452af9676b4b74607e83e2f8 Author:Xinchen Hui larue...@php.net Sat, 28 Jul 2012 17:00:05 +0800 Parents: ef7286a42f0d85cc359f1d64678f859d6c3f832e Branches: PHP-5.3 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=b477a84026a39a58452af9676b4b74607e83e2f8 Log: Fixed bug #60194 for eavl same reason here Bugs: https://bugs.php.net/60194 Changed paths: M Zend/zend_language_scanner.c M Zend/zend_language_scanner.l M Zend/zend_language_scanner_defs.h Diff: diff --git a/Zend/zend_language_scanner.c b/Zend/zend_language_scanner.c index e3fc576..15a48fa 100644 --- a/Zend/zend_language_scanner.c +++ b/Zend/zend_language_scanner.c @@ -1,4 +1,4 @@ -/* Generated by re2c 0.13.5 on Sat Jul 28 00:45:37 2012 */ +/* Generated by re2c 0.13.5 on Sat Jul 28 16:59:07 2012 */ #line 1 Zend/zend_language_scanner.l /* +--+ @@ -445,7 +445,7 @@ ZEND_API int zend_prepare_string_for_scanning(zval *str, char *filename TSRMLS_D zend_multibyte_set_filter(CG(internal_encoding) TSRMLS_CC); if (!SCNG(input_filter)) { - SCNG(script_filtered) = (unsigned char*)emalloc(SCNG(script_org_size)+1); + SCNG(script_filtered) = (unsigned char*)emalloc(SCNG(script_org_size)+2); memcpy(SCNG(script_filtered), SCNG(script_org), SCNG(script_org_size)+1); SCNG(script_filtered_size) = SCNG(script_org_size); } else { diff --git a/Zend/zend_language_scanner.l b/Zend/zend_language_scanner.l index 2661627..c92bf2b 100644 --- a/Zend/zend_language_scanner.l +++ b/Zend/zend_language_scanner.l @@ -443,7 +443,7 @@ ZEND_API int zend_prepare_string_for_scanning(zval *str, char *filename TSRMLS_D zend_multibyte_set_filter(CG(internal_encoding) TSRMLS_CC); if (!SCNG(input_filter)) { - SCNG(script_filtered) = (unsigned char*)emalloc(SCNG(script_org_size)+1); + SCNG(script_filtered) = (unsigned char*)emalloc(SCNG(script_org_size)+2); memcpy(SCNG(script_filtered), SCNG(script_org), SCNG(script_org_size)+1); SCNG(script_filtered_size) = SCNG(script_org_size); } else { diff --git a/Zend/zend_language_scanner_defs.h b/Zend/zend_language_scanner_defs.h index d1955a8..02a2a39 100644 --- a/Zend/zend_language_scanner_defs.h +++ b/Zend/zend_language_scanner_defs.h @@ -1,4 +1,4 @@ -/* Generated by re2c 0.13.5 on Sat Jul 28 00:45:37 2012 */ +/* Generated by re2c 0.13.5 on Sat Jul 28 16:59:07 2012 */ #line 3 Zend/zend_language_scanner_defs.h enum YYCONDTYPE { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Skip test while zend_mm is disabled: Zend/tests/bug55509.phpt
Commit:015ee3b2c88d3e7bf984c7414b4de6c2a465b6a9 Author:Xinchen Hui larue...@php.net Sun, 29 Jul 2012 12:17:43 +0800 Parents: b477a84026a39a58452af9676b4b74607e83e2f8 Branches: PHP-5.3 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=015ee3b2c88d3e7bf984c7414b4de6c2a465b6a9 Log: Skip test while zend_mm is disabled Changed paths: M Zend/tests/bug55509.phpt Diff: diff --git a/Zend/tests/bug55509.phpt b/Zend/tests/bug55509.phpt index b78fceb..5268789 100644 --- a/Zend/tests/bug55509.phpt +++ b/Zend/tests/bug55509.phpt @@ -5,6 +5,12 @@ Bug #55509 (segfault on x86_64 using more than 2G memory) if (PHP_INT_SIZE == 4) { die('skip Not for 32-bits OS'); } + +$zend_mm_enabled = getenv(USE_ZEND_ALLOC); +if ($zend_mm_enabled === 0) { +die(skip Zend MM disabled); +} + if (getenv(SKIP_SLOW_TESTS)) die(skip slow test); // check the available memory if (PHP_OS == 'Linux') { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Skip test while zend mm is disabled: ext/oci8/tests/pecl_bug10194.phpt ext/oci8/tests/pecl_bug10194_blob_64.phpt tests/lang/bug45392.phpt
Commit:880a6cee0068e980fd1eed735675d9b7d37968a0 Author:Xinchen Hui larue...@php.net Sun, 29 Jul 2012 13:25:31 +0800 Parents: 14cebefb058ec4f78d61a5a520da699b121fb306 Branches: PHP-5.3 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=880a6cee0068e980fd1eed735675d9b7d37968a0 Log: Skip test while zend mm is disabled Changed paths: M ext/oci8/tests/pecl_bug10194.phpt M ext/oci8/tests/pecl_bug10194_blob_64.phpt M tests/lang/bug45392.phpt Diff: diff --git a/ext/oci8/tests/pecl_bug10194.phpt b/ext/oci8/tests/pecl_bug10194.phpt index 9947e15..3c1c788 100644 --- a/ext/oci8/tests/pecl_bug10194.phpt +++ b/ext/oci8/tests/pecl_bug10194.phpt @@ -5,6 +5,9 @@ PECL Bug #10194 (segfault in Instant Client when memory_limit is reached inside $target_dbs = array('oracledb' = true, 'timesten' = false); // test runs on these DBs require(dirname(__FILE__).'/skipif.inc'); if (getenv('SKIP_SLOW_TESTS')) die('skip slow tests excluded by request'); +if (getenv(USE_ZEND_ALLOC) === 0) { +die(skip Zend MM disabled); +} ? --INI-- memory_limit=10M diff --git a/ext/oci8/tests/pecl_bug10194_blob_64.phpt b/ext/oci8/tests/pecl_bug10194_blob_64.phpt index 45788a4..e1a4cc0 100644 --- a/ext/oci8/tests/pecl_bug10194_blob_64.phpt +++ b/ext/oci8/tests/pecl_bug10194_blob_64.phpt @@ -6,6 +6,9 @@ $target_dbs = array('oracledb' = true, 'timesten' = false); // test runs on t require(dirname(__FILE__).'/skipif.inc'); if (getenv('SKIP_SLOW_TESTS')) die('skip slow tests excluded by request'); if (PHP_INT_SIZE != 8) die(skip this test is for 64bit platforms only); +if (getenv(USE_ZEND_ALLOC) === 0) { +die(skip Zend MM disabled); +} ? --INI-- memory_limit=6M diff --git a/tests/lang/bug45392.phpt b/tests/lang/bug45392.phpt index ae84cd9..78876c7 100644 --- a/tests/lang/bug45392.phpt +++ b/tests/lang/bug45392.phpt @@ -2,6 +2,11 @@ Bug #45392 (ob_start()/ob_end_clean() and memory_limit) --INI-- display_errors=stderr +--SKIPIF-- +?php +if (getenv(USE_ZEND_ALLOC) === 0) { +die(skip Zend MM disabled); +} --FILE-- ?php echo __LINE__ . \n; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Fixed bug #60194 (--with-zend-multibyte and --enable-debug reports LEAK with run-test.php): NEWS Zend/zend_language_scanner.c Zend/zend_language_scanner.l Zend/zend_language_sca
Commit:ef7286a42f0d85cc359f1d64678f859d6c3f832e Author:Xinchen Hui larue...@php.net Sat, 28 Jul 2012 00:50:45 +0800 Parents: 5799ebdb0cafb2de1dbb18cfe780976c98dbaeac Branches: PHP-5.3 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=ef7286a42f0d85cc359f1d64678f859d6c3f832e Log: Fixed bug #60194 (--with-zend-multibyte and --enable-debug reports LEAK with run-test.php) It's not a big deal, just because lexer will read the char after cursor before leaving Bugs: https://bugs.php.net/60194 Changed paths: M NEWS M Zend/zend_language_scanner.c M Zend/zend_language_scanner.l M Zend/zend_language_scanner_defs.h Diff: diff --git a/NEWS b/NEWS index 8f55123..5aa35d7 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,10 @@ PHP NEWS ||| ?? ??? 2012, PHP 5.3.16 +- Core: + . Fixed bug #60194 (--with-zend-multibyte and --enable-debug reports LEAK +with run-test.php). (Laruence) + - CURL: . Fixed bug #62499 (curl_setopt($ch, CURLOPT_COOKIEFILE, ) returns false). (r.hampartsum...@gmail.com, Laruence) diff --git a/Zend/zend_language_scanner.c b/Zend/zend_language_scanner.c index 1d0ada7..e3fc576 100644 --- a/Zend/zend_language_scanner.c +++ b/Zend/zend_language_scanner.c @@ -1,4 +1,4 @@ -/* Generated by re2c 0.13.5 on Wed Feb 15 17:38:31 2012 */ +/* Generated by re2c 0.13.5 on Sat Jul 28 00:45:37 2012 */ #line 1 Zend/zend_language_scanner.l /* +--+ @@ -287,7 +287,7 @@ ZEND_API int open_file_for_scanning(zend_file_handle *file_handle TSRMLS_DC) zend_multibyte_set_filter(NULL TSRMLS_CC); if (!SCNG(input_filter)) { - SCNG(script_filtered) = (unsigned char*)emalloc(SCNG(script_org_size)+1); + SCNG(script_filtered) = (unsigned char*)emalloc(SCNG(script_org_size)+2); memcpy(SCNG(script_filtered), SCNG(script_org), SCNG(script_org_size)+1); SCNG(script_filtered_size) = SCNG(script_org_size); } else { diff --git a/Zend/zend_language_scanner.l b/Zend/zend_language_scanner.l index 9b2e453..2661627 100644 --- a/Zend/zend_language_scanner.l +++ b/Zend/zend_language_scanner.l @@ -285,7 +285,7 @@ ZEND_API int open_file_for_scanning(zend_file_handle *file_handle TSRMLS_DC) zend_multibyte_set_filter(NULL TSRMLS_CC); if (!SCNG(input_filter)) { - SCNG(script_filtered) = (unsigned char*)emalloc(SCNG(script_org_size)+1); + SCNG(script_filtered) = (unsigned char*)emalloc(SCNG(script_org_size)+2); memcpy(SCNG(script_filtered), SCNG(script_org), SCNG(script_org_size)+1); SCNG(script_filtered_size) = SCNG(script_org_size); } else { diff --git a/Zend/zend_language_scanner_defs.h b/Zend/zend_language_scanner_defs.h index adaedcf..d1955a8 100644 --- a/Zend/zend_language_scanner_defs.h +++ b/Zend/zend_language_scanner_defs.h @@ -1,4 +1,4 @@ -/* Generated by re2c 0.13.5 on Wed Feb 15 17:38:31 2012 */ +/* Generated by re2c 0.13.5 on Sat Jul 28 00:45:37 2012 */ #line 3 Zend/zend_language_scanner_defs.h enum YYCONDTYPE { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Fixed invalid read in CONST_STRING dereference, reported by Nikic: Zend/zend_language_parser.y
Commit:ba568aaebb3f3c788a5551c016c0afafd7a5502e Author:Xinchen Hui larue...@php.net Thu, 26 Jul 2012 00:29:39 +0800 Parents: 0fbc8561e687689f796d95584cea1fa959eee83b Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=ba568aaebb3f3c788a5551c016c0afafd7a5502e Log: Fixed invalid read in CONST_STRING dereference, reported by Nikic Changed paths: M Zend/zend_language_parser.y Diff: diff --git a/Zend/zend_language_parser.y b/Zend/zend_language_parser.y index e397fe1..c88e9a7 100644 --- a/Zend/zend_language_parser.y +++ b/Zend/zend_language_parser.y @@ -802,7 +802,7 @@ expr_without_variable: combined_scalar_offset: combined_scalar '[' dim_offset ']' { zend_do_begin_variable_parse(TSRMLS_C); fetch_array_dim($$, $1, $3 TSRMLS_CC); } | combined_scalar_offset '[' dim_offset ']' { fetch_array_dim($$, $1, $3 TSRMLS_CC); } -| T_CONSTANT_ENCAPSED_STRING '[' dim_offset ']' { zend_do_begin_variable_parse(TSRMLS_C); fetch_array_dim($$, $1, $3 TSRMLS_CC); } +| T_CONSTANT_ENCAPSED_STRING '[' dim_offset ']' { $1.EA = 0; zend_do_begin_variable_parse(TSRMLS_C); fetch_array_dim($$, $1, $3 TSRMLS_CC); } combined_scalar: T_ARRAY '(' array_pair_list ')' { $$ = $3; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Fixed bug #62661 (Interactive php-cli crashes if include() is used in auto_prepend_file): NEWS Zend/zend.c
Commit:b4b3a65f5518803c4a3bca34ac67e139b2547133 Author:Xinchen Hui larue...@php.net Thu, 26 Jul 2012 12:40:47 +0800 Parents: 9fe8c58130ac82d2b52b35a290b71569abe50d18 Branches: PHP-5.4 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=b4b3a65f5518803c4a3bca34ac67e139b2547133 Log: Fixed bug #62661 (Interactive php-cli crashes if include() is used in auto_prepend_file) Bugs: https://bugs.php.net/62661 Changed paths: M NEWS M Zend/zend.c Diff: diff --git a/NEWS b/NEWS index 883d910..d429849 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,8 @@ PHP NEWS ?? ??? 2012, PHP 5.4.6 - Core: + . Fixed bug #62661 (Interactive php-cli crashes if include() is used in +auto_prepend_file). (Laruence) . Fixed bug #62565 (Crashes due non-initialized internal properties_table). (Felipe) diff --git a/Zend/zend.c b/Zend/zend.c index 37a1a27..18c4f11 100644 --- a/Zend/zend.c +++ b/Zend/zend.c @@ -1261,6 +1261,7 @@ ZEND_API int zend_execute_scripts(int type TSRMLS_DC, zval **retval, int file_co zend_file_handle *file_handle; zend_op_array *orig_op_array = EG(active_op_array); zval **orig_retval_ptr_ptr = EG(return_value_ptr_ptr); +long orig_interactive = CG(interactive); va_start(files, file_count); for (i = 0; i file_count; i++) { @@ -1268,6 +1269,15 @@ ZEND_API int zend_execute_scripts(int type TSRMLS_DC, zval **retval, int file_co if (!file_handle) { continue; } + +if (orig_interactive) { +if (file_handle-filename[0] != '-' || file_handle-filename[1]) { +CG(interactive) = 0; +} else { +CG(interactive) = 1; +} +} + EG(active_op_array) = zend_compile_file(file_handle, type TSRMLS_CC); if (file_handle-opened_path) { int dummy = 1; @@ -1309,12 +1319,14 @@ ZEND_API int zend_execute_scripts(int type TSRMLS_DC, zval **retval, int file_co va_end(files); EG(active_op_array) = orig_op_array; EG(return_value_ptr_ptr) = orig_retval_ptr_ptr; +CG(interactive) = orig_interactive; return FAILURE; } } va_end(files); EG(active_op_array) = orig_op_array; EG(return_value_ptr_ptr) = orig_retval_ptr_ptr; +CG(interactive) = orig_interactive; return SUCCESS; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Fixed bug #62653: (unset($array[$float]) causes a crash): NEWS Zend/tests/bug62653.phpt Zend/zend_vm_def.h Zend/zend_vm_execute.h
Commit:eae06100429f37e5297c432e99104daeeed13bad Author:Xinchen Hui larue...@php.net Thu, 26 Jul 2012 13:52:42 +0800 Parents: ba27e0888a3bb91eba3266c71003df045c4d2091 Branches: PHP-5.4 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=eae06100429f37e5297c432e99104daeeed13bad Log: Fixed bug #62653: (unset($array[$float]) causes a crash) the reason why jpauli and I can not reproduce is (it's silly): I typo USE_ZEND_ALLOC ** valgrind at the first time, then I always ctrl+r and jpauli copied my command from the pastbin :) thanks Bugs: https://bugs.php.net/62653 Changed paths: M NEWS A Zend/tests/bug62653.phpt M Zend/zend_vm_def.h M Zend/zend_vm_execute.h Diff: diff --git a/NEWS b/NEWS index d429849..407b052 100644 --- a/NEWS +++ b/NEWS @@ -5,6 +5,8 @@ PHP NEWS - Core: . Fixed bug #62661 (Interactive php-cli crashes if include() is used in auto_prepend_file). (Laruence) + . Fixed bug #62653: (unset($array[$float]) causes a crash). (Nikita Popov, +Laruence) . Fixed bug #62565 (Crashes due non-initialized internal properties_table). (Felipe) diff --git a/Zend/tests/bug62653.phpt b/Zend/tests/bug62653.phpt new file mode 100644 index 000..cf5941c --- /dev/null +++ b/Zend/tests/bug62653.phpt @@ -0,0 +1,33 @@ +--TEST-- +Bug #62653: unset($array[$float]) causes a crash +--FILE-- +?php +$array = array(5=bar); +$foo = 10.; // gettype($foo) = string +$foo /= 2; //Makes $foo = 5 but still gettype($foo) = double +unset($array[$foo]); +print_r($array); + +$array = array(5=bar); +$foo = 5; +unset($array[(float)$foo]); +print_r($array); + +$array = array(5=bar); +$foo = 5; +$foo /= 2; //Makes $foo = 5 but still gettype($foo) = double +$name = foo; +unset($array[$$name]); +print_r($array); + +? +--EXPECT-- +Array +( +) +Array +( +) +Array +( +) diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index 5a3ae49..f5567ea 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -3947,7 +3947,8 @@ ZEND_VM_HANDLER(75, ZEND_UNSET_DIM, VAR|UNUSED|CV, CONST|TMP|VAR|CV) switch (Z_TYPE_P(offset)) { case IS_DOUBLE: hval = zend_dval_to_lval(Z_DVAL_P(offset)); - ZEND_VM_C_GOTO(num_index_dim); + zend_hash_index_del(ht, hval); + break; case IS_RESOURCE: case IS_BOOL: case IS_LONG: diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index 1fb6e76..78f3d84 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -13917,7 +13917,8 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HAND switch (Z_TYPE_P(offset)) { case IS_DOUBLE: hval = zend_dval_to_lval(Z_DVAL_P(offset)); - goto num_index_dim; + zend_hash_index_del(ht, hval); + break; case IS_RESOURCE: case IS_BOOL: case IS_LONG: @@ -15919,7 +15920,8 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLE switch (Z_TYPE_P(offset)) { case IS_DOUBLE: hval = zend_dval_to_lval(Z_DVAL_P(offset)); - goto num_index_dim; + zend_hash_index_del(ht, hval); + break; case IS_RESOURCE: case IS_BOOL: case IS_LONG: @@ -18131,7 +18133,8 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLE switch (Z_TYPE_P(offset)) { case IS_DOUBLE: hval = zend_dval_to_lval(Z_DVAL_P(offset)); - goto num_index_dim; + zend_hash_index_del(ht, hval); + break; case IS_RESOURCE: case IS_BOOL: case IS_LONG: @@ -21166,7 +21169,8 @@ static int ZEND_FASTCALL
[PHP-CVS] com php-src: Fix test, committed in wrong folder: Zend/tests/bug62653.phpt
Commit:302ad0d648376e072358a269432d3598302b62c0 Author:Xinchen Hui larue...@php.net Thu, 26 Jul 2012 13:57:04 +0800 Parents: eae06100429f37e5297c432e99104daeeed13bad Branches: PHP-5.4 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=302ad0d648376e072358a269432d3598302b62c0 Log: Fix test, committed in wrong folder Changed paths: M Zend/tests/bug62653.phpt Diff: diff --git a/Zend/tests/bug62653.phpt b/Zend/tests/bug62653.phpt index cf5941c..96299f1 100644 --- a/Zend/tests/bug62653.phpt +++ b/Zend/tests/bug62653.phpt @@ -14,7 +14,7 @@ unset($array[(float)$foo]); print_r($array); $array = array(5=bar); -$foo = 5; +$foo = 10.; $foo /= 2; //Makes $foo = 5 but still gettype($foo) = double $name = foo; unset($array[$$name]); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.4': Zend/zend_vm_def.h Zend/zend_vm_execute.h
Commit:80497ea7dfade2ccd032ef65103c0a113338653a Author:Xinchen Hui larue...@php.net Thu, 26 Jul 2012 13:58:01 +0800 Parents: 07c61c2fdb5c6016508cfac7deb783b9dbef2ad5 302ad0d648376e072358a269432d3598302b62c0 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=80497ea7dfade2ccd032ef65103c0a113338653a Log: Merge branch 'PHP-5.4' Changed paths: MM Zend/zend_vm_def.h MM Zend/zend_vm_execute.h Diff: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Re-fix bug #55544: ext/zlib/php_zlib.h ext/zlib/tests/bug55544.phpt ext/zlib/zlib.c
Commit:4c1e2bbd6f744b4048d4e0540ecc5dbe005494fe Author:Xinchen Hui larue...@php.net Tue, 24 Jul 2012 14:43:53 +0800 Parents: 2abc4c2f6fabfc81d12380170dc5ec7be9314a61 Branches: PHP-5.4 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=4c1e2bbd6f744b4048d4e0540ecc5dbe005494fe Log: Re-fix bug #55544 Bugs: https://bugs.php.net/55544 Changed paths: M ext/zlib/php_zlib.h A ext/zlib/tests/bug55544.phpt M ext/zlib/zlib.c Diff: diff --git a/ext/zlib/php_zlib.h b/ext/zlib/php_zlib.h index 449dfed..ab67351 100644 --- a/ext/zlib/php_zlib.h +++ b/ext/zlib/php_zlib.h @@ -55,6 +55,7 @@ ZEND_BEGIN_MODULE_GLOBALS(zlib) long output_compression_default; char *output_handler; php_zlib_context *ob_gzhandler; +zend_bool handler_registered; ZEND_END_MODULE_GLOBALS(zlib); php_stream *php_stream_gzopen(php_stream_wrapper *wrapper, char *path, char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC); diff --git a/ext/zlib/tests/bug55544.phpt b/ext/zlib/tests/bug55544.phpt new file mode 100644 index 000..ca4214a Binary files /dev/null and b/ext/zlib/tests/bug55544.phpt differ diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c index eac757b..7ff2b30 100644 --- a/ext/zlib/zlib.c +++ b/ext/zlib/zlib.c @@ -263,6 +263,8 @@ static php_output_handler *php_zlib_output_handler_init(const char *handler_name ZLIBG(output_compression) = chunk_size ? chunk_size : PHP_OUTPUT_HANDLER_DEFAULT_SIZE; } +ZLIBG(handler_registered) = 1; + if ((h = php_output_handler_create_internal(handler_name, handler_name_len, php_zlib_output_handler, chunk_size, flags TSRMLS_CC))) { php_output_handler_set_context(h, php_zlib_output_handler_context_init(TSRMLS_C), php_zlib_output_handler_context_dtor TSRMLS_CC); } @@ -964,9 +966,10 @@ static PHP_MSHUTDOWN_FUNCTION(zlib) static PHP_RINIT_FUNCTION(zlib) { ZLIBG(compression_coding) = 0; - ZLIBG(output_compression) = ZLIBG(output_compression_default); - - php_zlib_output_compression_start(TSRMLS_C); +if (!ZLIBG(handler_registered)) { +ZLIBG(output_compression) = ZLIBG(output_compression_default); +php_zlib_output_compression_start(TSRMLS_C); +} return SUCCESS; } @@ -976,6 +979,7 @@ static PHP_RINIT_FUNCTION(zlib) static PHP_RSHUTDOWN_FUNCTION(zlib) { php_zlib_cleanup_ob_gzhandler_mess(TSRMLS_C); +ZLIBG(handler_registered) = 0; return SUCCESS; } @@ -1000,6 +1004,7 @@ static PHP_MINFO_FUNCTION(zlib) static ZEND_MODULE_GLOBALS_CTOR_D(zlib) { zlib_globals-ob_gzhandler = NULL; +zlib_globals-handler_registered = 0; } /* }}} */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: binary compatibility: ext/zlib/php_zlib.h
Commit:9fe8c58130ac82d2b52b35a290b71569abe50d18 Author:Xinchen Hui larue...@php.net Tue, 24 Jul 2012 14:45:13 +0800 Parents: 4c1e2bbd6f744b4048d4e0540ecc5dbe005494fe Branches: PHP-5.4 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=9fe8c58130ac82d2b52b35a290b71569abe50d18 Log: binary compatibility Changed paths: M ext/zlib/php_zlib.h Diff: diff --git a/ext/zlib/php_zlib.h b/ext/zlib/php_zlib.h index ab67351..e895e0e 100644 --- a/ext/zlib/php_zlib.h +++ b/ext/zlib/php_zlib.h @@ -52,9 +52,9 @@ ZEND_BEGIN_MODULE_GLOBALS(zlib) int compression_coding; long output_compression; long output_compression_level; - long output_compression_default; char *output_handler; php_zlib_context *ob_gzhandler; + long output_compression_default; zend_bool handler_registered; ZEND_END_MODULE_GLOBALS(zlib); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: folders: ext/zlib/zlib.c
Commit:c20b2ab0bd8eae770088fca9dff50da76c2117e4 Author:Xinchen Hui larue...@php.net Tue, 24 Jul 2012 13:37:44 +0800 Parents: a88eca53f708602384cae147a8376352d5909d90 Branches: PHP-5.4 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=c20b2ab0bd8eae770088fca9dff50da76c2117e4 Log: folders Changed paths: M ext/zlib/zlib.c Diff: diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c index 9cd1f37..eac757b 100644 --- a/ext/zlib/zlib.c +++ b/ext/zlib/zlib.c @@ -690,6 +690,7 @@ PHP_ZLIB_ENCODE_FUNC(zlib_encode, 0); /* {{{ proto binary zlib_decode(binary data[, int max_decoded_len]) Uncompress any raw/gzip/zlib encoded data */ PHP_ZLIB_DECODE_FUNC(zlib_decode, PHP_ZLIB_ENCODING_ANY); +/* }}} */ /* NOTE: The naming of these userland functions was quite unlucky */ /* {{{ proto binary gzdeflate(binary data[, int level = -1[, int encoding = ZLIB_ENCODING_RAW]) @@ -701,18 +702,22 @@ PHP_ZLIB_ENCODE_FUNC(gzdeflate, PHP_ZLIB_ENCODING_RAW); Encode data with the gzip encoding */ PHP_ZLIB_ENCODE_FUNC(gzencode, PHP_ZLIB_ENCODING_GZIP); /* }}} */ + /* {{{ proto binary gzcompress(binary data[, int level = -1[, int encoding = ZLIB_ENCODING_DEFLATE]) Encode data with the zlib encoding */ PHP_ZLIB_ENCODE_FUNC(gzcompress, PHP_ZLIB_ENCODING_DEFLATE); /* }}} */ + /* {{{ proto binary gzinflate(binary data[, int max_decoded_len]) Decode raw deflate encoded data */ PHP_ZLIB_DECODE_FUNC(gzinflate, PHP_ZLIB_ENCODING_RAW); /* }}} */ + /* {{{ proto binary gzdecode(binary data[, int max_decoded_len]) Decode gzip encoded data */ PHP_ZLIB_DECODE_FUNC(gzdecode, PHP_ZLIB_ENCODING_GZIP); /* }}} */ + /* {{{ proto binary gzuncompress(binary data[, int max_decoded_len]) Decode zlib encoded data */ PHP_ZLIB_DECODE_FUNC(gzuncompress, PHP_ZLIB_ENCODING_DEFLATE); @@ -967,12 +972,14 @@ static PHP_RINIT_FUNCTION(zlib) } /* }}} */ +/* {{{ PHP_RSHUTDOWN_FUNCTION */ static PHP_RSHUTDOWN_FUNCTION(zlib) { php_zlib_cleanup_ob_gzhandler_mess(TSRMLS_C); return SUCCESS; } +/* }}} */ /* {{{ PHP_MINFO_FUNCTION */ static PHP_MINFO_FUNCTION(zlib) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: correct the author name introduced in bb685512: ext/zlib/zlib.c
Commit:6126ac44b5348dc7aac9d2c67f8e927211dfee2f Author:Xinchen Hui larue...@php.net Tue, 24 Jul 2012 13:39:46 +0800 Parents: 38fb89f91d7046d25cfe05ec7954a64f11ba755d Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=6126ac44b5348dc7aac9d2c67f8e927211dfee2f Log: correct the author name introduced in bb685512 Changed paths: M ext/zlib/zlib.c Diff: diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c index a0bec9c..eac757b 100644 --- a/ext/zlib/zlib.c +++ b/ext/zlib/zlib.c @@ -13,7 +13,7 @@ | lice...@php.net so we can mail you a copy immediately. | +--+ | Authors: Rasmus Lerdorf ras...@lerdorf.on.ca | - | Stefan R�hrich s...@linux.de| + | Stefan Röhrich s...@linux.de| | Zeev Suraski z...@zend.com| | Jade Nicoletti nicole...@nns.ch | | Michael Wallner m...@php.net | -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.4': ext/zlib/zlib.c
Commit:38fb89f91d7046d25cfe05ec7954a64f11ba755d Author:Xinchen Hui larue...@php.net Tue, 24 Jul 2012 13:39:02 +0800 Parents: ae3a827bf9b14c88bb7d52a19ad74bf0f074dc73 2abc4c2f6fabfc81d12380170dc5ec7be9314a61 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=38fb89f91d7046d25cfe05ec7954a64f11ba755d Log: Merge branch 'PHP-5.4' Changed paths: MM ext/zlib/zlib.c Diff: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Improve error message for ssl request: sapi/cli/php_cli_server.c
Commit:a88eca53f708602384cae147a8376352d5909d90 Author:Xinchen Hui larue...@php.net Sun, 22 Jul 2012 19:20:23 +0800 Parents: fd50bf2085982e28b42a8665dd71009205eec108 Branches: PHP-5.4 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=a88eca53f708602384cae147a8376352d5909d90 Log: Improve error message for ssl request Changed paths: M sapi/cli/php_cli_server.c Diff: diff --git a/sapi/cli/php_cli_server.c b/sapi/cli/php_cli_server.c index 876c57a..02f8854 100644 --- a/sapi/cli/php_cli_server.c +++ b/sapi/cli/php_cli_server.c @@ -1618,7 +1618,11 @@ static int php_cli_server_client_read_request(php_cli_server_client *client, cha client-parser.data = client; nbytes_consumed = php_http_parser_execute(client-parser, settings, buf, nbytes_read); if (nbytes_consumed != nbytes_read) { - *errstr = estrdup(Malformed HTTP request); + if (buf[0] 0x80 /* SSLv2 */ || buf[0] == 0x16 /* SSLv3/TLSv1 */) { + *errstr = estrdup(Unsupported SSL request); + } else { + *errstr = estrdup(Malformed HTTP request); + } return -1; } if (client-current_header_name) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Fixed bug #62616 (ArrayIterator::count() from IteratorIterator instance gives Segmentation fault): NEWS ext/spl/spl_iterators.c ext/spl/tests/bug62616.phpt
Commit:0c996613c0173708381f4bfcd28d2441360bc701 Author:Xinchen Hui larue...@php.net Sat, 21 Jul 2012 22:45:16 +0800 Parents: a6f1533789b897d3b8930b437164e81e0a0f4c72 Branches: PHP-5.4 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=0c996613c0173708381f4bfcd28d2441360bc701 Log: Fixed bug #62616 (ArrayIterator::count() from IteratorIterator instance gives Segmentation fault) Bugs: https://bugs.php.net/62616 Changed paths: M NEWS M ext/spl/spl_iterators.c A ext/spl/tests/bug62616.phpt Diff: diff --git a/NEWS b/NEWS index 9cd089c..8ae6931 100644 --- a/NEWS +++ b/NEWS @@ -32,6 +32,8 @@ PHP NEWS . Implemented FR #55218 Get namespaces from current node. (Lonny) - SPL: + . Fixed bug #62616 (ArrayIterator::count() from IteratorIterator instance +gives Segmentation fault). (Laruence, Gustavo) . Fixed bug #61527 (ArrayIterator gives misleading notice on next() when moved to the end). (reeze@gmail.com) diff --git a/ext/spl/spl_iterators.c b/ext/spl/spl_iterators.c index 19a68f6..e5dc030 100755 --- a/ext/spl/spl_iterators.c +++ b/ext/spl/spl_iterators.c @@ -1289,6 +1289,8 @@ static union _zend_function *spl_dual_it_get_method(zval **object_ptr, char *met *object_ptr = intern-inner.zobject; function_handler = Z_OBJ_HT_P(*object_ptr)-get_method(object_ptr, method, method_len, key TSRMLS_CC); } + } else { + *object_ptr = intern-inner.zobject; } } return function_handler; diff --git a/ext/spl/tests/bug62616.phpt b/ext/spl/tests/bug62616.phpt new file mode 100644 index 000..4e4be94 --- /dev/null +++ b/ext/spl/tests/bug62616.phpt @@ -0,0 +1,15 @@ +--TEST-- +Bug #62616 (ArrayIterator::count() from IteratorIterator instance gives Segmentation fault) +--FILE-- +?php +$ai = new ArrayIterator(array(0,1)); + +var_dump($ai-count()); + +$ii = new IteratorIterator($ai); + +var_dump($ii-count()); +? +--EXPECTF-- +int(2) +int(2) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.4': ext/spl/spl_iterators.c
Commit:a580405f3825934d536109ad299886d7373e6786 Author:Xinchen Hui larue...@php.net Sat, 21 Jul 2012 22:46:14 +0800 Parents: 64cbdc606cdfeab3972851d9050db70b1ef5eea7 0c996613c0173708381f4bfcd28d2441360bc701 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=a580405f3825934d536109ad299886d7373e6786 Log: Merge branch 'PHP-5.4' * PHP-5.4: Fixed bug #62616 (ArrayIterator::count() from IteratorIterator instance gives Segmentation fault) Bugs: https://bugs.php.net/62616 Changed paths: MM ext/spl/spl_iterators.c Diff: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Fix test failed: ext/standard/tests/general_functions/uniqid_basic.phpt
Commit:ead076bac613bc69d83ab65be2efb68feada912c Author:Xinchen Hui larue...@php.net Sat, 21 Jul 2012 23:27:09 +0800 Parents: cc30524c89fa2255944dc3c70f8d41a6c23faa2a Branches: PHP-5.3 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=ead076bac613bc69d83ab65be2efb68feada912c Log: Fix test failed Changed paths: M ext/standard/tests/general_functions/uniqid_basic.phpt Diff: diff --git a/ext/standard/tests/general_functions/uniqid_basic.phpt b/ext/standard/tests/general_functions/uniqid_basic.phpt index 9a9c573..2da832b 100644 --- a/ext/standard/tests/general_functions/uniqid_basic.phpt +++ b/ext/standard/tests/general_functions/uniqid_basic.phpt @@ -1,73 +1,72 @@ ---TEST-- -Test uniqid() function : basic functionality ---FILE-- -?php -/* Prototype : string uniqid ([ string $prefix= [, bool $more_entropy= false ]] ) - * Description: Gets a prefixed unique identifier based on the current time in microseconds. - * Source code: ext/standard/uniqid.c -*/ -echo *** Testing uniqid() : basic functionality ***\n; - -echo \nuniqid() without a prefix\n; -var_dump(uniqid()); -var_dump(uniqid(null, true)); -var_dump(uniqid(null, false)); -echo \n\n; - -echo uniqid() with a prefix\n; - -// Use a fixed prefix so we can ensure length of o/p id is fixed -$prefix = array ( - 9, - 9, - 10.5e2, - null, - true, - false - ); - -for ($i = 0; $i count($prefix); $i++) { - var_dump(uniqid($prefix[$i])); - var_dump(uniqid($prefix[$i], true)); - var_dump(uniqid($prefix[$i], false)); - echo \n; -} - -? -===DONE=== ---EXPECTF-- -*** Testing uniqid() : basic functionality *** - -uniqid() without a prefix -string(13) %s -string(23) %s.%s -string(13) %s - - -uniqid() with a prefix -string(18) 9%s -string(28) 9%s.%s -string(18) 9%s - -string(18) 94%s -string(28) 94%s.%s -string(18) 94%s - -string(17) 1050%s -string(27) 1050%s.%s -string(17) 1050%s - -string(13) %s -string(23) %s.%s -string(13) %s - -string(14) 1%s -string(24) 1%s.%s -string(14) 1%s - -string(13) %s -string(23) %s.%s -string(13) %s - -===DONE=== - \ No newline at end of file +--TEST-- +Test uniqid() function : basic functionality +--FILE-- +?php +/* Prototype : string uniqid ([ string $prefix= [, bool $more_entropy= false ]] ) + * Description: Gets a prefixed unique identifier based on the current time in microseconds. + * Source code: ext/standard/uniqid.c +*/ +echo *** Testing uniqid() : basic functionality ***\n; + +echo \nuniqid() without a prefix\n; +var_dump(uniqid()); +var_dump(uniqid(null, true)); +var_dump(uniqid(null, false)); +echo \n\n; + +echo uniqid() with a prefix\n; + +// Use a fixed prefix so we can ensure length of o/p id is fixed +$prefix = array ( + 9, + 9, + 10.5e2, + null, + true, + false + ); + +for ($i = 0; $i count($prefix); $i++) { + var_dump(uniqid($prefix[$i])); + var_dump(uniqid($prefix[$i], true)); + var_dump(uniqid($prefix[$i], false)); + echo \n; +} + +? +===DONE=== +--EXPECTF-- +*** Testing uniqid() : basic functionality *** + +uniqid() without a prefix +string(13) %s +string(23) %s.%s +string(13) %s + + +uniqid() with a prefix +string(18) 9%s +string(28) 9%s.%s +string(18) 9%s + +string(18) 9%s +string(28) 9%s.%s +string(18) 9%s + +string(17) 1050%s +string(27) 1050%s.%s +string(17) 1050%s + +string(13) %s +string(23) %s.%s +string(13) %s + +string(14) 1%s +string(24) 1%s.%s +string(14) 1%s + +string(13) %s +string(23) %s.%s +string(13) %s + +===DONE=== -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Fixed bug #62616 (ArrayIterator::count() from IteratorIterator instance gives Segmentation fault): NEWS ext/spl/spl_iterators.c
Commit:cc30524c89fa2255944dc3c70f8d41a6c23faa2a Author:Xinchen Hui larue...@php.net Sat, 21 Jul 2012 23:26:18 +0800 Parents: 683b4f7a2be0479182f229cf84f502d19bd792d9 Branches: PHP-5.3 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=cc30524c89fa2255944dc3c70f8d41a6c23faa2a Log: Fixed bug #62616 (ArrayIterator::count() from IteratorIterator instance gives Segmentation fault) Bugs: https://bugs.php.net/62616 Changed paths: M NEWS M ext/spl/spl_iterators.c Diff: diff --git a/NEWS b/NEWS index 902185c..e6b51a9 100644 --- a/NEWS +++ b/NEWS @@ -13,6 +13,10 @@ PHP NEWS - DateTime: . Fixed Bug #62500 (Segfault in DateInterval class when extended). (Laruence) +- SPL: + . Fixed bug #62616 (ArrayIterator::count() from IteratorIterator instance +gives Segmentation fault). (Laruence, Gustavo) + 14 Jun 2012, PHP 5.3.14 - CLI SAPI: diff --git a/ext/spl/spl_iterators.c b/ext/spl/spl_iterators.c index eecd483..a46b7d4 100755 --- a/ext/spl/spl_iterators.c +++ b/ext/spl/spl_iterators.c @@ -1287,6 +1287,8 @@ static union _zend_function *spl_dual_it_get_method(zval **object_ptr, char *met *object_ptr = intern-inner.zobject; function_handler = Z_OBJ_HT_P(*object_ptr)-get_method(object_ptr, method, method_len TSRMLS_CC); } + } else { + *object_ptr = intern-inner.zobject; } } return function_handler; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: missed the test script: ext/spl/tests/bug62616.phpt
Commit:777b6679a41abe40c4211c2f2a906a5218680872 Author:Xinchen Hui larue...@php.net Sat, 21 Jul 2012 23:30:32 +0800 Parents: ead076bac613bc69d83ab65be2efb68feada912c Branches: PHP-5.3 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=777b6679a41abe40c4211c2f2a906a5218680872 Log: missed the test script Changed paths: A ext/spl/tests/bug62616.phpt Diff: diff --git a/ext/spl/tests/bug62616.phpt b/ext/spl/tests/bug62616.phpt new file mode 100644 index 000..4e4be94 --- /dev/null +++ b/ext/spl/tests/bug62616.phpt @@ -0,0 +1,15 @@ +--TEST-- +Bug #62616 (ArrayIterator::count() from IteratorIterator instance gives Segmentation fault) +--FILE-- +?php +$ai = new ArrayIterator(array(0,1)); + +var_dump($ai-count()); + +$ii = new IteratorIterator($ai); + +var_dump($ii-count()); +? +--EXPECTF-- +int(2) +int(2) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: merge 9eb5cb6571698ca1c623ad3e02c8727c4b0c9a09 to 5.3: ext/standard/tests/file/umask_variation3.phpt
Commit:683b4f7a2be0479182f229cf84f502d19bd792d9 Author:Xinchen Hui larue...@php.net Sat, 21 Jul 2012 00:46:32 +0800 Parents: bd39495332f12f074ef0916280c446a3c37704b4 Branches: PHP-5.3 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=683b4f7a2be0479182f229cf84f502d19bd792d9 Log: merge 9eb5cb6571698ca1c623ad3e02c8727c4b0c9a09 to 5.3 Changed paths: M ext/standard/tests/file/umask_variation3.phpt Diff: diff --git a/ext/standard/tests/file/umask_variation3.phpt b/ext/standard/tests/file/umask_variation3.phpt index 1483dc4..cb34294 100644 --- a/ext/standard/tests/file/umask_variation3.phpt +++ b/ext/standard/tests/file/umask_variation3.phpt @@ -110,7 +110,7 @@ foreach($inputs as $key =$value) { echo \n--$key--\n; umask(0); var_dump(umask($value)); - var_dump( umask()); + var_dump(umask() 0777); }; ? -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Fixed bug #55544 (ob_gzhandler always conflicts with zlib.output_compression): NEWS ext/zlib/php_zlib.h ext/zlib/zlib.c
Commit:a6f1533789b897d3b8930b437164e81e0a0f4c72 Author:Xinchen Hui larue...@php.net Sat, 21 Jul 2012 02:56:28 +0800 Parents: a2a1cef1a22be33521276bcaa79dab454d573591 Branches: PHP-5.4 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=a6f1533789b897d3b8930b437164e81e0a0f4c72 Log: Fixed bug #55544 (ob_gzhandler always conflicts with zlib.output_compression) Bugs: https://bugs.php.net/55544 Changed paths: M NEWS M ext/zlib/php_zlib.h M ext/zlib/zlib.c Diff: diff --git a/NEWS b/NEWS index 34b48d9..9cd089c 100644 --- a/NEWS +++ b/NEWS @@ -39,6 +39,10 @@ PHP NEWS . Fixed bug #62597 (segfault in php_stream_wrapper_log_error with ZTS build). (Laruence) +- Zlib: + . Fixed bug #55544 (ob_gzhandler always conflicts with +zlib.output_compression). (Laruence) + ?? ??? 2012, PHP 5.4.5 - Core: diff --git a/ext/zlib/php_zlib.h b/ext/zlib/php_zlib.h index 3d8c90c..449dfed 100644 --- a/ext/zlib/php_zlib.h +++ b/ext/zlib/php_zlib.h @@ -52,6 +52,7 @@ ZEND_BEGIN_MODULE_GLOBALS(zlib) int compression_coding; long output_compression; long output_compression_level; + long output_compression_default; char *output_handler; php_zlib_context *ob_gzhandler; ZEND_END_MODULE_GLOBALS(zlib); diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c index c6e2e0c..9cd1f37 100644 --- a/ext/zlib/zlib.c +++ b/ext/zlib/zlib.c @@ -890,6 +890,7 @@ static PHP_INI_MH(OnUpdate_zlib_output_compression) status = OnUpdateLong(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC); + ZLIBG(output_compression) = ZLIBG(output_compression_default); if (stage == PHP_INI_STAGE_RUNTIME int_value) { if (!php_output_handler_started(ZEND_STRL(PHP_ZLIB_OUTPUT_HANDLER_NAME) TSRMLS_CC)) { php_zlib_output_compression_start(TSRMLS_C); @@ -914,7 +915,7 @@ static PHP_INI_MH(OnUpdate_zlib_output_handler) /* {{{ INI */ PHP_INI_BEGIN() - STD_PHP_INI_BOOLEAN(zlib.output_compression, 0, PHP_INI_ALL, OnUpdate_zlib_output_compression, output_compression, zend_zlib_globals, zlib_globals) + STD_PHP_INI_BOOLEAN(zlib.output_compression, 0, PHP_INI_ALL, OnUpdate_zlib_output_compression, output_compression_default, zend_zlib_globals, zlib_globals) STD_PHP_INI_ENTRY(zlib.output_compression_level, -1, PHP_INI_ALL, OnUpdateLong, output_compression_level, zend_zlib_globals, zlib_globals) STD_PHP_INI_ENTRY(zlib.output_handler, , PHP_INI_ALL, OnUpdate_zlib_output_handler, output_handler, zend_zlib_globals, zlib_globals) PHP_INI_END() @@ -958,6 +959,7 @@ static PHP_MSHUTDOWN_FUNCTION(zlib) static PHP_RINIT_FUNCTION(zlib) { ZLIBG(compression_coding) = 0; + ZLIBG(output_compression) = ZLIBG(output_compression_default); php_zlib_output_compression_start(TSRMLS_C); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.4': ext/zlib/zlib.c
Commit:64cbdc606cdfeab3972851d9050db70b1ef5eea7 Author:Xinchen Hui larue...@php.net Sat, 21 Jul 2012 02:58:16 +0800 Parents: b39c0749acbe47cdf4db3c89edc33f5e9e9961c4 a6f1533789b897d3b8930b437164e81e0a0f4c72 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=64cbdc606cdfeab3972851d9050db70b1ef5eea7 Log: Merge branch 'PHP-5.4' Changed paths: MM ext/zlib/zlib.c Diff: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Bug doesn't exists in any release: NEWS
Commit:c7c939b5d8b2a8e2d7d72bf83c031005e93cd3fe Author:Xinchen Hui larue...@php.net Wed, 18 Jul 2012 18:00:09 +0800 Parents: c7614a8c19d5d1f366ec219e745760ea2133e5a0 Branches: PHP-5.4 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=c7c939b5d8b2a8e2d7d72bf83c031005e93cd3fe Log: Bug doesn't exists in any release Changed paths: M NEWS Diff: diff --git a/NEWS b/NEWS index 8dc740c..9da5717 100644 --- a/NEWS +++ b/NEWS @@ -3,8 +3,6 @@ PHP NEWS ?? ??? 2012, PHP 5.4.6 - Core: - . Fixed bug in number_format() when the number was not finite. See pull -request #134. (Reeze Xia) . Fixed bug #62565 (Crashes due non-initialized internal properties_table). (Felipe) @@ -17,7 +15,7 @@ PHP NEWS - Fileinfo: . Fixed bug #61964 (finfo_open with directory causes invalid free). - (reeze@gmail.com) +(reeze@gmail.com) - Intl: . Fixed bug #62564 (Extending MessageFormatter and adding property causes -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: fix test: ext/curl/tests/curl_escape.phpt
Commit:cea3f0f3635179c052ba2d13d889a82b5a327ddb Author:Xinchen Hui larue...@php.net Wed, 18 Jul 2012 18:50:42 +0800 Parents: 2e325d612637605b8fada38b665f5bf49ab55b5a Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=cea3f0f3635179c052ba2d13d889a82b5a327ddb Log: fix test All input characters that are not a-z, A-Z or 0-9 will be converted to their URL escaped version see http://curl.haxx.se/libcurl/c/curl_escape.html Changed paths: M ext/curl/tests/curl_escape.phpt Diff: diff --git a/ext/curl/tests/curl_escape.phpt b/ext/curl/tests/curl_escape.phpt index 7c90fb9..9a11e61 100644 Binary files a/ext/curl/tests/curl_escape.phpt and b/ext/curl/tests/curl_escape.phpt differ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Fixed bug #62594 (segfault in mysqlnd_res_meta::set_mode): NEWS ext/mysqlnd/mysqlnd_debug.c
Commit:25be12a3bcd4a56a094d28b73cdc5cee68970bf3 Author:Xinchen Hui larue...@php.net Wed, 18 Jul 2012 19:06:27 +0800 Parents: c7c939b5d8b2a8e2d7d72bf83c031005e93cd3fe Branches: PHP-5.4 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=25be12a3bcd4a56a094d28b73cdc5cee68970bf3 Log: Fixed bug #62594 (segfault in mysqlnd_res_meta::set_mode) Bugs: https://bugs.php.net/62594 Changed paths: M NEWS M ext/mysqlnd/mysqlnd_debug.c Diff: diff --git a/NEWS b/NEWS index 9da5717..280eb1f 100644 --- a/NEWS +++ b/NEWS @@ -21,6 +21,9 @@ PHP NEWS . Fixed bug #62564 (Extending MessageFormatter and adding property causes crash). (Felipe) +- MySQLnd: + . Fixed bug #62594 (segfault in mysqlnd_res_meta::set_mode). (Laruence) + - Reflection: . Implemented FR #61602 (Allow access to name of constant used as default value). (reeze@gmail.com) diff --git a/ext/mysqlnd/mysqlnd_debug.c b/ext/mysqlnd/mysqlnd_debug.c index 5c77b42..044a7d6 100644 --- a/ext/mysqlnd/mysqlnd_debug.c +++ b/ext/mysqlnd/mysqlnd_debug.c @@ -516,9 +516,11 @@ enum mysqlnd_debug_parser_state static void MYSQLND_METHOD(mysqlnd_debug, set_mode)(MYSQLND_DEBUG * self, const char * const mode) { - unsigned int mode_len = strlen(mode), i; + unsigned int mode_len, i; enum mysqlnd_debug_parser_state state = PARSER_WAIT_MODIFIER; + mode_len = mode? strlen(mode) : 0; + self-flags = 0; self-nest_level_limit = 0; if (self-file_name self-file_name != mysqlnd_debug_default_trace_file) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.4': ext/mysqlnd/mysqlnd_debug.c
Commit:f13288de96b9cc064b976a384fad73a191891721 Author:Xinchen Hui larue...@php.net Wed, 18 Jul 2012 19:06:58 +0800 Parents: cea3f0f3635179c052ba2d13d889a82b5a327ddb 25be12a3bcd4a56a094d28b73cdc5cee68970bf3 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=f13288de96b9cc064b976a384fad73a191891721 Log: Merge branch 'PHP-5.4' * PHP-5.4: Fixed bug #62594 (segfault in mysqlnd_res_meta::set_mode) Bugs: https://bugs.php.net/62594 Changed paths: MM ext/mysqlnd/mysqlnd_debug.c Diff: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: test script for bug #61697: ext/spl/tests/bug61697.phpt
Commit:8238c6a4c815220045322ac3c524b98613639f97 Author:Xinchen Hui larue...@php.net Wed, 18 Jul 2012 19:19:31 +0800 Parents: f13288de96b9cc064b976a384fad73a191891721 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=8238c6a4c815220045322ac3c524b98613639f97 Log: test script for bug #61697 Bugs: https://bugs.php.net/61697 Changed paths: A ext/spl/tests/bug61697.phpt Diff: diff --git a/ext/spl/tests/bug61697.phpt b/ext/spl/tests/bug61697.phpt new file mode 100644 index 000..d95caef --- /dev/null +++ b/ext/spl/tests/bug61697.phpt @@ -0,0 +1,26 @@ +--TEST-- +Bug #61697 (spl_autoload_functions returns lambda functions incorrectly) +--XFAIL-- +Bug #61697 not fixed yet +--FILE-- +?php + +function f1($class) { echo f1: [[$class]]\n; } +function f2($class) { echo f2: [[$class]]\n; } + +spl_autoload_register('f1'); +spl_autoload_register('f2'); +spl_autoload_register(create_function('$class', 'echo cf1: [[$class]]\n;')); +spl_autoload_register(create_function('$class', 'echo cf2: [[$class]]\n;')); + +foreach (spl_autoload_functions() AS $func) +{ +spl_autoload_unregister($func); +} + +print_r(spl_autoload_functions()); +? +--EXPECTF-- +Array +( +) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: fix test, the key may be a float value: ext/standard/tests/file/realpath_cache.phpt
Commit:41a9c681a0a8b27ab121d2a4649fccd16c97cadd Author:Xinchen Hui larue...@php.net Wed, 18 Jul 2012 19:21:25 +0800 Parents: 25be12a3bcd4a56a094d28b73cdc5cee68970bf3 Branches: PHP-5.4 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=41a9c681a0a8b27ab121d2a4649fccd16c97cadd Log: fix test, the key may be a float value Changed paths: M ext/standard/tests/file/realpath_cache.phpt Diff: diff --git a/ext/standard/tests/file/realpath_cache.phpt b/ext/standard/tests/file/realpath_cache.phpt index 92d6fc5..2dac21e 100644 --- a/ext/standard/tests/file/realpath_cache.phpt +++ b/ext/standard/tests/file/realpath_cache.phpt @@ -19,7 +19,7 @@ echo Done\n; int(%d) array(4) { [key]= - %s(%d) + %s(%s) [is_dir]= bool(true) [realpath]= -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: fix test (dos2unix, typo): ext/standard/tests/general_functions/uniqid_basic.phpt
Commit:282a6659aab94133bb9f95148b2540018333a8ca Author:Xinchen Hui larue...@php.net Wed, 18 Jul 2012 19:25:22 +0800 Parents: 41a9c681a0a8b27ab121d2a4649fccd16c97cadd Branches: PHP-5.4 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=282a6659aab94133bb9f95148b2540018333a8ca Log: fix test (dos2unix, typo) Changed paths: M ext/standard/tests/general_functions/uniqid_basic.phpt Diff: diff --git a/ext/standard/tests/general_functions/uniqid_basic.phpt b/ext/standard/tests/general_functions/uniqid_basic.phpt index 9a9c573..2da832b 100644 --- a/ext/standard/tests/general_functions/uniqid_basic.phpt +++ b/ext/standard/tests/general_functions/uniqid_basic.phpt @@ -1,73 +1,72 @@ ---TEST-- -Test uniqid() function : basic functionality ---FILE-- -?php -/* Prototype : string uniqid ([ string $prefix= [, bool $more_entropy= false ]] ) - * Description: Gets a prefixed unique identifier based on the current time in microseconds. - * Source code: ext/standard/uniqid.c -*/ -echo *** Testing uniqid() : basic functionality ***\n; - -echo \nuniqid() without a prefix\n; -var_dump(uniqid()); -var_dump(uniqid(null, true)); -var_dump(uniqid(null, false)); -echo \n\n; - -echo uniqid() with a prefix\n; - -// Use a fixed prefix so we can ensure length of o/p id is fixed -$prefix = array ( - 9, - 9, - 10.5e2, - null, - true, - false - ); - -for ($i = 0; $i count($prefix); $i++) { - var_dump(uniqid($prefix[$i])); - var_dump(uniqid($prefix[$i], true)); - var_dump(uniqid($prefix[$i], false)); - echo \n; -} - -? -===DONE=== ---EXPECTF-- -*** Testing uniqid() : basic functionality *** - -uniqid() without a prefix -string(13) %s -string(23) %s.%s -string(13) %s - - -uniqid() with a prefix -string(18) 9%s -string(28) 9%s.%s -string(18) 9%s - -string(18) 94%s -string(28) 94%s.%s -string(18) 94%s - -string(17) 1050%s -string(27) 1050%s.%s -string(17) 1050%s - -string(13) %s -string(23) %s.%s -string(13) %s - -string(14) 1%s -string(24) 1%s.%s -string(14) 1%s - -string(13) %s -string(23) %s.%s -string(13) %s - -===DONE=== - \ No newline at end of file +--TEST-- +Test uniqid() function : basic functionality +--FILE-- +?php +/* Prototype : string uniqid ([ string $prefix= [, bool $more_entropy= false ]] ) + * Description: Gets a prefixed unique identifier based on the current time in microseconds. + * Source code: ext/standard/uniqid.c +*/ +echo *** Testing uniqid() : basic functionality ***\n; + +echo \nuniqid() without a prefix\n; +var_dump(uniqid()); +var_dump(uniqid(null, true)); +var_dump(uniqid(null, false)); +echo \n\n; + +echo uniqid() with a prefix\n; + +// Use a fixed prefix so we can ensure length of o/p id is fixed +$prefix = array ( + 9, + 9, + 10.5e2, + null, + true, + false + ); + +for ($i = 0; $i count($prefix); $i++) { + var_dump(uniqid($prefix[$i])); + var_dump(uniqid($prefix[$i], true)); + var_dump(uniqid($prefix[$i], false)); + echo \n; +} + +? +===DONE=== +--EXPECTF-- +*** Testing uniqid() : basic functionality *** + +uniqid() without a prefix +string(13) %s +string(23) %s.%s +string(13) %s + + +uniqid() with a prefix +string(18) 9%s +string(28) 9%s.%s +string(18) 9%s + +string(18) 9%s +string(28) 9%s.%s +string(18) 9%s + +string(17) 1050%s +string(27) 1050%s.%s +string(17) 1050%s + +string(13) %s +string(23) %s.%s +string(13) %s + +string(14) 1%s +string(24) 1%s.%s +string(14) 1%s + +string(13) %s +string(23) %s.%s +string(13) %s + +===DONE=== -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Fix test (no charset outputed): sapi/cgi/tests/apache_request_headers.phpt
Commit:8f89cfb548a733ec0d8004920be7d2e7e3cfe107 Author:Xinchen Hui larue...@php.net Wed, 18 Jul 2012 19:50:30 +0800 Parents: 11d05589282a7f9c795a0af77dcd2b3cc0a158ce Branches: PHP-5.4 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=8f89cfb548a733ec0d8004920be7d2e7e3cfe107 Log: Fix test (no charset outputed) Changed paths: M sapi/cgi/tests/apache_request_headers.phpt Diff: diff --git a/sapi/cgi/tests/apache_request_headers.phpt b/sapi/cgi/tests/apache_request_headers.phpt index 3dc3580..881b6bb 100644 --- a/sapi/cgi/tests/apache_request_headers.phpt +++ b/sapi/cgi/tests/apache_request_headers.phpt @@ -31,7 +31,7 @@ echo Done\n; ? --EXPECTF-- X-Powered-By: PHP/%s -Content-type: text/html; charset=UTF-8 +Content-type: text/%s Array ( -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Fixed bug #62597 (segfault in php_stream_wrapper_log_error with ZTS build): NEWS ext/standard/file.c
Commit:2d9d2cadadf0fdf12a01b4a689d0554e1450904f Author:Xinchen Hui larue...@php.net Wed, 18 Jul 2012 20:16:27 +0800 Parents: 8f89cfb548a733ec0d8004920be7d2e7e3cfe107 Branches: PHP-5.4 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=2d9d2cadadf0fdf12a01b4a689d0554e1450904f Log: Fixed bug #62597 (segfault in php_stream_wrapper_log_error with ZTS build) Bugs: https://bugs.php.net/62597 Changed paths: M NEWS M ext/standard/file.c Diff: diff --git a/NEWS b/NEWS index 280eb1f..34b48d9 100644 --- a/NEWS +++ b/NEWS @@ -35,6 +35,10 @@ PHP NEWS . Fixed bug #61527 (ArrayIterator gives misleading notice on next() when moved to the end). (reeze@gmail.com) +- Streams: + . Fixed bug #62597 (segfault in php_stream_wrapper_log_error with ZTS build). +(Laruence) + ?? ??? 2012, PHP 5.4.5 - Core: diff --git a/ext/standard/file.c b/ext/standard/file.c index 7d01d31..cce0143 100644 --- a/ext/standard/file.c +++ b/ext/standard/file.c @@ -161,6 +161,7 @@ static void file_globals_ctor(php_file_globals *file_globals_p TSRMLS_DC) FG(pclose_ret) = 0; FG(user_stream_current_filename) = NULL; FG(def_chunk_size) = PHP_SOCK_CHUNK_SIZE; + FG(wrapper_errors) = NULL; } static void file_globals_dtor(php_file_globals *file_globals_p TSRMLS_DC) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.4': ext/standard/file.c
Commit:e7535e06e63104ccc0c90c4425b6c2541aa3c939 Author:Xinchen Hui larue...@php.net Wed, 18 Jul 2012 20:17:42 +0800 Parents: 401230c7e181d97e9a8bf1abeeb294341c98727b 2d9d2cadadf0fdf12a01b4a689d0554e1450904f Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=e7535e06e63104ccc0c90c4425b6c2541aa3c939 Log: Merge branch 'PHP-5.4' * PHP-5.4: Fixed bug #62597 (segfault in php_stream_wrapper_log_error with ZTS build) Bugs: https://bugs.php.net/62597 Changed paths: MM ext/standard/file.c Diff: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: this initialization is unnecessary anymore after commit 2d9d2cadadf0fdf12a01b4a689d0554e1450904f: ext/standard/basic_functions.c
Commit:b81b8bf77d75d719a9785f71796e56ad2b676147 Author:Xinchen Hui larue...@php.net Wed, 18 Jul 2012 21:45:37 +0800 Parents: 2d9d2cadadf0fdf12a01b4a689d0554e1450904f Branches: PHP-5.4 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=b81b8bf77d75d719a9785f71796e56ad2b676147 Log: this initialization is unnecessary anymore after commit 2d9d2cadadf0fdf12a01b4a689d0554e1450904f Changed paths: M ext/standard/basic_functions.c Diff: diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index a5637db..e6de34e 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -3719,8 +3719,6 @@ PHP_RINIT_FUNCTION(basic) /* {{{ */ /* Default to global filters only */ FG(stream_filters) = NULL; - FG(wrapper_errors) = NULL; - return SUCCESS; } /* }}} */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.4': ext/standard/basic_functions.c
Commit:da7cd966ffb2e3c5534f2eb5ba7068a17658f23f Author:Xinchen Hui larue...@php.net Wed, 18 Jul 2012 21:49:46 +0800 Parents: e7535e06e63104ccc0c90c4425b6c2541aa3c939 b81b8bf77d75d719a9785f71796e56ad2b676147 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=da7cd966ffb2e3c5534f2eb5ba7068a17658f23f Log: Merge branch 'PHP-5.4' * PHP-5.4: this initialization is unnecessary anymore after commit 2d9d2cadadf0fdf12a01b4a689d0554e1450904f Changed paths: MM ext/standard/basic_functions.c Diff: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Revert fix test: ext/curl/tests/curl_escape.phpt
Commit:94a0f8722b1f480f2cd8c0fc044cff40f2418607 Author:Xinchen Hui larue...@php.net Wed, 18 Jul 2012 22:35:03 +0800 Parents: da7cd966ffb2e3c5534f2eb5ba7068a17658f23f Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=94a0f8722b1f480f2cd8c0fc044cff40f2418607 Log: Revert fix test This reverts commit cea3f0f3635179c052ba2d13d889a82b5a327ddb. seems the behavior is different between certain versions Changed paths: M ext/curl/tests/curl_escape.phpt Diff: diff --git a/ext/curl/tests/curl_escape.phpt b/ext/curl/tests/curl_escape.phpt index 9a11e61..7c90fb9 100644 Binary files a/ext/curl/tests/curl_escape.phpt and b/ext/curl/tests/curl_escape.phpt differ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Update libmagic.patch: ext/fileinfo/libmagic.patch
Commit:c8f285d190f6a970ac156d7f704496aa06d33e66 Author:Xinchen Hui larue...@php.net Sun, 15 Jul 2012 18:25:58 +0800 Parents: f4809424cd0041e6fdf030cef2d556d92332fe3a Branches: PHP-5.4 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=c8f285d190f6a970ac156d7f704496aa06d33e66 Log: Update libmagic.patch Changed paths: M ext/fileinfo/libmagic.patch diff --git a/ext/fileinfo/libmagic.patch b/ext/fileinfo/libmagic.patch index 48a0236..30364fb 100644 --- a/ext/fileinfo/libmagic.patch +++ b/ext/fileinfo/libmagic.patch @@ -1,6 +1,6 @@ -diff -u libmagic.orig/apprentice.c libmagic/apprentice.c libmagic.orig/apprentice.c 2012-05-29 14:40:41.710960045 +0200 -+++ libmagic/apprentice.c 2012-04-22 18:57:16.215980866 +0200 +diff -u libmagic.origin/apprentice.c libmagic/apprentice.c +--- libmagic.origin/apprentice.c 2012-07-15 18:17:24.802087661 +0800 libmagic/apprentice.c 2012-07-15 18:22:49.650087425 +0800 @@ -29,6 +29,8 @@ * apprentice - make one pass through /etc/magic, learning its secrets. */ @@ -271,7 +271,9 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c + size_t lineno = 0; + + php_stream *stream; -+ + +- FILE *f = fopen(ms-file = fn, r); +- if (f == NULL) { + TSRMLS_FETCH(); + +#if PHP_API_VERSION 20100412 @@ -279,9 +281,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c +#else + stream = php_stream_open_wrapper((char *)fn, rb, REPORT_ERRORS, NULL); +#endif - -- FILE *f = fopen(ms-file = fn, r); -- if (f == NULL) { ++ + if (stream == NULL) { if (errno != ENOENT) file_error(ms, errno, cannot read magic file `%s', @@ -312,8 +312,12 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c } /* -@@ -757,20 +756,16 @@ - int errs = 0; +@@ -754,23 +753,19 @@ + apprentice_load(struct magic_set *ms, struct magic **magicp, uint32_t *nmagicp, + const char *fn, int action) + { +- int errs = 0; ++ int errs = 0, mflen = 0; struct magic_entry *marray; uint32_t marraycount, i, mentrycount = 0, starttest; - size_t slen, files = 0, maxfiles = 0; @@ -352,7 +356,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c } while ((d = readdir(dir)) != NULL) { - if (asprintf(mfn, %s/%s, fn, d-d_name) 0) { -+ if (snprintf(mfn, sizeof(mfn), %s/%s, fn, d-d_name) 0) { ++ if ((mflen = snprintf(mfn, sizeof(mfn), %s/%s, fn, d-d_name)) 0) { file_oomem(ms, strlen(fn) + strlen(d-d_name) + 2); errs++; @@ -364,7 +368,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c continue; } if (files = maxfiles) { -@@ -803,7 +799,6 @@ +@@ -803,20 +799,19 @@ if ((filearr = CAST(char **, realloc(filearr, mlen))) == NULL) { file_oomem(ms, mlen); @@ -372,6 +376,21 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c closedir(dir); errs++; goto out; + } + } +- filearr[files++] = mfn; ++ filearr[files++] = estrndup(mfn, mflen); + } + closedir(dir); + qsort(filearr, files, sizeof(*filearr), cmpstrp); + for (i = 0; i files; i++) { + load_1(ms, action, filearr[i], errs, marray, + marraycount); +- free(filearr[i]); ++ efree(filearr[i]); + } + free(filearr); + } else @@ -882,12 +877,7 @@ for (i = 0; i marraycount; i++) mentrycount += marray[i].cont_count; @@ -386,18 +405,31 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c mentrycount = 0; for (i = 0; i marraycount; i++) { -@@ -897,8 +887,8 @@ +@@ -896,9 +886,14 @@ + mentrycount += marray[i].cont_count; } out: - for (i = 0; i marraycount; i++) +- for (i = 0; i marraycount; i++) - free(marray[i].mp); - free(marray); -+ efree(marray[i].mp); -+ efree(marray); ++ for (i = 0; i marraycount; i++) { ++ if (marray[i].mp) { ++ efree(marray[i].mp); ++ } ++ } ++ if (marray) { ++ efree(marray); ++ } if (errs) { *magicp = NULL; *nmagicp = 0; -@@ -1178,11 +1168,7 @@ +@@ -1175,14 +1170,13 @@ + return -1
[PHP-CVS] com php-src: Fixed Bug #62500 (Segfault in DateInterval class when extended): NEWS ext/date/php_date.c ext/date/tests/bug62500.phpt
Commit:bcf5853eaa8b8be793d4a1bd325eaea68cfe57bb Author:Xinchen Hui larue...@php.net Tue, 10 Jul 2012 18:43:11 +0800 Parents: c819cf9d6bd43d79b894f1d0f0c6c282893fd9bd Branches: PHP-5.3 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=bcf5853eaa8b8be793d4a1bd325eaea68cfe57bb Log: Fixed Bug #62500 (Segfault in DateInterval class when extended) Bugs: https://bugs.php.net/62500 Changed paths: M NEWS M ext/date/php_date.c A ext/date/tests/bug62500.phpt Diff: diff --git a/NEWS b/NEWS index c9f3fc4..902185c 100644 --- a/NEWS +++ b/NEWS @@ -10,6 +10,9 @@ PHP NEWS . Fixed bug #62499 (curl_setopt($ch, CURLOPT_COOKIEFILE, ) returns false). (r.hampartsum...@gmail.com, Laruence) +- DateTime: + . Fixed Bug #62500 (Segfault in DateInterval class when extended). (Laruence) + 14 Jun 2012, PHP 5.3.14 - CLI SAPI: diff --git a/ext/date/php_date.c b/ext/date/php_date.c index 527894d..e8a4570 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -3511,6 +3511,14 @@ zval *date_interval_read_property(zval *object, zval *member, int type TSRMLS_DC obj = (php_interval_obj *)zend_objects_get_address(object TSRMLS_CC); + if (!obj-initialized) { + retval = (zend_get_std_object_handlers())-read_property(object, member, type TSRMLS_CC); + if (member == tmp_member) { + zval_dtor(member); + } + return retval; + } + #define GET_VALUE_FROM_STRUCT(n,m)\ if (strcmp(Z_STRVAL_P(member), m) == 0) { \ value = obj-diff-n; \ @@ -3560,8 +3568,17 @@ void date_interval_write_property(zval *object, zval *member, zval *value TSRMLS convert_to_string(tmp_member); member = tmp_member; } + obj = (php_interval_obj *)zend_objects_get_address(object TSRMLS_CC); + if (!obj-initialized) { + (zend_get_std_object_handlers())-write_property(object, member, value TSRMLS_CC); + if (member == tmp_member) { + zval_dtor(member); + } + return; + } + #define SET_VALUE_FROM_STRUCT(n,m)\ if (strcmp(Z_STRVAL_P(member), m) == 0) { \ if (value-type != IS_LONG) { \ diff --git a/ext/date/tests/bug62500.phpt b/ext/date/tests/bug62500.phpt new file mode 100644 index 000..6952332 --- /dev/null +++ b/ext/date/tests/bug62500.phpt @@ -0,0 +1,28 @@ +--TEST-- +Bug #62500 (Segfault in DateInterval class when extended) +--INI-- +date.timezone=GMT +--FILE-- +?php +class Crasher extends DateInterval { +public $foo; +public function __construct($time_spec) { +var_dump($this-foo); +$this-foo = 3; +var_dump($this-foo); +var_dump($this-{2}); +parent::__construct($time_spec); +} +} +try { +$c = new Crasher('blah'); +} catch (Exception $e) { +var_dump($e-getMessage()); +} +--EXPECTF-- +NULL +int(3) + +Notice: Undefined property: Crasher::$2 in %sbug62500.php on line %d +NULL +string(%s) DateInterval::__construct(): Unknown or bad format (blah) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] com php-src: Merge branch 'PHP-5.4': ext/curl/interface.c
Sent from my iPhone 在 2012-7-9,14:43,Pierre Joye pierre@gmail.com 写道: Hi Laruence! Thanks for the quick fix! Can you add a test too please? hi: a relevant test has been updated, which should reflected this minor Chang. So I didnt introduce a new one. :) Thanks Thanks! On Mon, Jul 9, 2012 at 2:46 AM, Xinchen Hui larue...@php.net wrote: Commit:0e97cdf86b8db73c5d80e5eaeb7efc99ae6383de Author:Xinchen Hui larue...@php.net Mon, 9 Jul 2012 08:46:38 +0800 Parents: e6d9cd983b3503d38389d0c67267c773a98af174 4323a7acedf0eff76f709456930d89380c16f0b8 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=0e97cdf86b8db73c5d80e5eaeb7efc99ae6383de Log: Merge branch 'PHP-5.4' * PHP-5.4: update NEWS Fixed bug #62499 (curl_setopt($ch, CURLOPT_COOKIEFILE, ) returns false) appease MSVC (doesnt like unary minus of unsigned ints) appease MSVC (doesnt like unary minus of unsigned ints) Bugs: https://bugs.php.net/62499 Changed paths: MM ext/curl/interface.c Diff: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Pierre @pierrejoye | http://blog.thepimp.net | http://www.libgd.org -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Fixed Bug #62500 (Segfault in DateInterval class when extended): NEWS ext/date/php_date.c ext/date/tests/bug62500.phpt
Commit:e3b9b1e6dc016d9128ac5e9ed95aa5b1a5065e5f Author:Xinchen Hui larue...@php.net Mon, 9 Jul 2012 00:25:48 +0800 Parents: a213c10ef2125ac2da7a71ddb668d6f0aea8a05c Branches: PHP-5.4 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=e3b9b1e6dc016d9128ac5e9ed95aa5b1a5065e5f Log: Fixed Bug #62500 (Segfault in DateInterval class when extended) This fix also fixed bug #62508 (Segfault while access a non-string property of DateInterval object) Bugs: https://bugs.php.net/62500 https://bugs.php.net/62508 Changed paths: M NEWS M ext/date/php_date.c A ext/date/tests/bug62500.phpt Diff: diff --git a/NEWS b/NEWS index c1ad183..a0763ae 100644 --- a/NEWS +++ b/NEWS @@ -5,6 +5,9 @@ PHP NEWS - SimpleXML: . Implemented FR #55218 Get namespaces from current node. (Lonny) +- DateTime: + . Fixed Bug #62500 (Segfault in DateInterval class when extended). (Laruence) + ?? ??? 2012, PHP 5.4.5 - Core: diff --git a/ext/date/php_date.c b/ext/date/php_date.c index cd48de2..13e7b75 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -3430,10 +3430,19 @@ zval *date_interval_read_property(zval *object, zval *member, int type, const ze zval_copy_ctor(tmp_member); convert_to_string(tmp_member); member = tmp_member; + key = NULL; } obj = (php_interval_obj *)zend_objects_get_address(object TSRMLS_CC); + if (!obj-initialized) { + retval = (zend_get_std_object_handlers())-read_property(object, member, type, key TSRMLS_CC); + if (member == tmp_member) { + zval_dtor(member); + } + return retval; + } + #define GET_VALUE_FROM_STRUCT(n,m)\ if (strcmp(Z_STRVAL_P(member), m) == 0) { \ value = obj-diff-n; \ @@ -3482,9 +3491,19 @@ void date_interval_write_property(zval *object, zval *member, zval *value, const zval_copy_ctor(tmp_member); convert_to_string(tmp_member); member = tmp_member; + key = NULL; } + obj = (php_interval_obj *)zend_objects_get_address(object TSRMLS_CC); + if (!obj-initialized) { + (zend_get_std_object_handlers())-write_property(object, member, value, key TSRMLS_CC); + if (member == tmp_member) { + zval_dtor(member); + } + return; + } + #define SET_VALUE_FROM_STRUCT(n,m)\ if (strcmp(Z_STRVAL_P(member), m) == 0) { \ if (value-type != IS_LONG) { \ diff --git a/ext/date/tests/bug62500.phpt b/ext/date/tests/bug62500.phpt new file mode 100644 index 000..6952332 --- /dev/null +++ b/ext/date/tests/bug62500.phpt @@ -0,0 +1,28 @@ +--TEST-- +Bug #62500 (Segfault in DateInterval class when extended) +--INI-- +date.timezone=GMT +--FILE-- +?php +class Crasher extends DateInterval { +public $foo; +public function __construct($time_spec) { +var_dump($this-foo); +$this-foo = 3; +var_dump($this-foo); +var_dump($this-{2}); +parent::__construct($time_spec); +} +} +try { +$c = new Crasher('blah'); +} catch (Exception $e) { +var_dump($e-getMessage()); +} +--EXPECTF-- +NULL +int(3) + +Notice: Undefined property: Crasher::$2 in %sbug62500.php on line %d +NULL +string(%s) DateInterval::__construct(): Unknown or bad format (blah) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Fixed bug #62499 (curl_setopt($ch, CURLOPT_COOKIEFILE, ) returns false): NEWS ext/curl/interface.c ext/curl/tests/bug61948.phpt
Commit:c819cf9d6bd43d79b894f1d0f0c6c282893fd9bd Author:Xinchen Hui larue...@php.net Mon, 9 Jul 2012 08:32:40 +0800 Parents: b2b018d5f7d0d7a0bc88e6a95fe804c39bd65b9a Branches: PHP-5.3 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=c819cf9d6bd43d79b894f1d0f0c6c282893fd9bd Log: Fixed bug #62499 (curl_setopt($ch, CURLOPT_COOKIEFILE, ) returns false) this bc break is caused by the fix for #61948 Bugs: https://bugs.php.net/62499 https://bugs.php.net/61948 Changed paths: M NEWS M ext/curl/interface.c M ext/curl/tests/bug61948.phpt Diff: diff --git a/NEWS b/NEWS index 782bb62..c9f3fc4 100644 --- a/NEWS +++ b/NEWS @@ -6,6 +6,10 @@ PHP NEWS (NEWS will be merged after release by johannes. Formerging changes to the PHP-5.3.15 release branch talk to johannes) +- CURL: + . Fixed bug #62499 (curl_setopt($ch, CURLOPT_COOKIEFILE, ) returns false). +(r.hampartsum...@gmail.com, Laruence) + 14 Jun 2012, PHP 5.3.14 - CLI SAPI: diff --git a/ext/curl/interface.c b/ext/curl/interface.c index 270a7dd..94be60f 100644 --- a/ext/curl/interface.c +++ b/ext/curl/interface.c @@ -2167,7 +2167,7 @@ string_copy: convert_to_string_ex(zvalue); - if (!Z_STRLEN_PP(zvalue) || php_check_open_basedir(Z_STRVAL_PP(zvalue) TSRMLS_CC) || (PG(safe_mode) !php_checkuid(Z_STRVAL_PP(zvalue), rb+, CHECKUID_CHECK_MODE_PARAM))) { + if ((Z_STRLEN_PP(zvalue) php_check_open_basedir(Z_STRVAL_PP(zvalue) TSRMLS_CC)) || (PG(safe_mode) !php_checkuid(Z_STRVAL_PP(zvalue), rb+, CHECKUID_CHECK_MODE_PARAM))) { RETVAL_FALSE; return 1; } diff --git a/ext/curl/tests/bug61948.phpt b/ext/curl/tests/bug61948.phpt index 23bbda7..00df07d 100644 --- a/ext/curl/tests/bug61948.phpt +++ b/ext/curl/tests/bug61948.phpt @@ -16,7 +16,7 @@ open_basedir=/tmp curl_close($ch); ? --EXPECTF-- -bool(false) +bool(true) bool(true) Warning: curl_setopt(): open_basedir restriction in effect. File(/xxx/bar) is not within the allowed path(s): (/tmp) in %sbug61948.php on line %d -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: update NEWS: NEWS
Commit:4323a7acedf0eff76f709456930d89380c16f0b8 Author:Xinchen Hui larue...@php.net Mon, 9 Jul 2012 08:44:59 +0800 Parents: 0398cc22a9fda50ad9ba0fb2d717f07a711e1732 Branches: PHP-5.4 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=4323a7acedf0eff76f709456930d89380c16f0b8 Log: update NEWS Changed paths: M NEWS Diff: diff --git a/NEWS b/NEWS index a0763ae..3d91e50 100644 --- a/NEWS +++ b/NEWS @@ -2,12 +2,16 @@ PHP NEWS ||| ?? ??? 2012, PHP 5.4.6 -- SimpleXML: - . Implemented FR #55218 Get namespaces from current node. (Lonny) +- CURL: + . Fixed bug #62499 (curl_setopt($ch, CURLOPT_COOKIEFILE, ) returns false). +(r.hampartsum...@gmail.com, Laruence) - DateTime: . Fixed Bug #62500 (Segfault in DateInterval class when extended). (Laruence) +- SimpleXML: + . Implemented FR #55218 Get namespaces from current node. (Lonny) + ?? ??? 2012, PHP 5.4.5 - Core: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.3' into PHP-5.4: ext/curl/interface.c
Commit:0398cc22a9fda50ad9ba0fb2d717f07a711e1732 Author:Xinchen Hui larue...@php.net Mon, 9 Jul 2012 08:38:03 +0800 Parents: 5910d8d4f499bf84bcaa1161bd0b89c15a19a304 c819cf9d6bd43d79b894f1d0f0c6c282893fd9bd Branches: PHP-5.4 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=0398cc22a9fda50ad9ba0fb2d717f07a711e1732 Log: Merge branch 'PHP-5.3' into PHP-5.4 * PHP-5.3: Fixed bug #62499 (curl_setopt($ch, CURLOPT_COOKIEFILE, ) returns false) appease MSVC (doesnt like unary minus of unsigned ints) Conflicts: ext/curl/interface.c Bugs: https://bugs.php.net/62499 Changed paths: MM ext/curl/interface.c Diff: diff --cc ext/curl/interface.c index b03f346,94be60f..d7d5c51 --- a/ext/curl/interface.c +++ b/ext/curl/interface.c @@@ -2177,7 -2167,7 +2177,7 @@@ string_copy convert_to_string_ex(zvalue); - if (!Z_STRLEN_PP(zvalue) || php_check_open_basedir(Z_STRVAL_PP(zvalue) TSRMLS_CC)) { - if ((Z_STRLEN_PP(zvalue) php_check_open_basedir(Z_STRVAL_PP(zvalue) TSRMLS_CC)) || (PG(safe_mode) !php_checkuid(Z_STRVAL_PP(zvalue), rb+, CHECKUID_CHECK_MODE_PARAM))) { ++ if (Z_STRLEN_PP(zvalue) php_check_open_basedir(Z_STRVAL_PP(zvalue) TSRMLS_CC)) { RETVAL_FALSE; return 1; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.4': ext/curl/interface.c
Commit:0e97cdf86b8db73c5d80e5eaeb7efc99ae6383de Author:Xinchen Hui larue...@php.net Mon, 9 Jul 2012 08:46:38 +0800 Parents: e6d9cd983b3503d38389d0c67267c773a98af174 4323a7acedf0eff76f709456930d89380c16f0b8 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=0e97cdf86b8db73c5d80e5eaeb7efc99ae6383de Log: Merge branch 'PHP-5.4' * PHP-5.4: update NEWS Fixed bug #62499 (curl_setopt($ch, CURLOPT_COOKIEFILE, ) returns false) appease MSVC (doesnt like unary minus of unsigned ints) appease MSVC (doesnt like unary minus of unsigned ints) Bugs: https://bugs.php.net/62499 Changed paths: MM ext/curl/interface.c Diff: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Fixed bug #62433 (Inconsistent behavior of RecursiveDirectoryIterator to dot files).: NEWS ext/spl/spl_directory.c ext/spl/tests/bug62433.phpt
Commit:be4053cea0462c9de5396641f4e4fa2f56f5a675 Author:Xinchen Hui larue...@php.net Mon, 2 Jul 2012 11:33:38 +0800 Parents: ff41bfc87882440cfde0ed5673bd6c3f2347c892 Branches: PHP-5.4 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=be4053cea0462c9de5396641f4e4fa2f56f5a675 Log: Fixed bug #62433 (Inconsistent behavior of RecursiveDirectoryIterator to dot files). Bugs: https://bugs.php.net/62433 Changed paths: M NEWS M ext/spl/spl_directory.c A ext/spl/tests/bug62433.phpt Diff: diff --git a/NEWS b/NEWS index 6dd1feb..70a8eb9 100644 --- a/NEWS +++ b/NEWS @@ -76,6 +76,8 @@ PHP NEWS . Fixed bug #62025 (__ss_family was changed on AIX 5.3). (Felipe) - SPL: + . Fixed bug #62433 (Inconsistent behavior of RecursiveDirectoryIterator to +dot files). (Laruence) . Fixed bug #62262 (RecursiveArrayIterator does not implement Countable). (Nikita Popov) diff --git a/ext/spl/spl_directory.c b/ext/spl/spl_directory.c index dbae3e2..0fcbd31 100755 --- a/ext/spl/spl_directory.c +++ b/ext/spl/spl_directory.c @@ -1432,6 +1432,7 @@ SPL_METHOD(FilesystemIterator, __construct) SPL_METHOD(FilesystemIterator, rewind) { spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); + int skip_dots = SPL_HAS_FLAG(intern-flags, SPL_FILE_DIR_SKIPDOTS); if (zend_parse_parameters_none() == FAILURE) { return; @@ -1443,7 +1444,7 @@ SPL_METHOD(FilesystemIterator, rewind) } do { spl_filesystem_dir_read(intern TSRMLS_CC); - } while (spl_filesystem_is_dot(intern-u.dir.entry.d_name)); + } while (skip_dots spl_filesystem_is_dot(intern-u.dir.entry.d_name)); } /* }}} */ diff --git a/ext/spl/tests/bug62433.phpt b/ext/spl/tests/bug62433.phpt new file mode 100644 index 000..86b5df8 --- /dev/null +++ b/ext/spl/tests/bug62433.phpt @@ -0,0 +1,18 @@ +--TEST-- +Bug #62433 Inconsistent behavior of RecursiveDirectoryIterator to dot files (. and ..) +--FILE-- +?php +$dots = array_keys(iterator_to_array(new RecursiveDirectoryIterator(__DIR__))); +$ndots = array_keys(iterator_to_array(new RecursiveDirectoryIterator(__DIR__, FilesystemIterator::SKIP_DOTS))); + +var_dump(in_array(__DIR__ . '/.', $dots)); +var_dump(in_array(__DIR__ . '/..', $dots)); + +var_dump(in_array(__DIR__ . '/.', $ndots)); +var_dump(in_array(__DIR__ . '/..', $ndots)); +? +--EXPECT-- +bool(true) +bool(true) +bool(false) +bool(false) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Fixed bug #62357 (compile failure: (S) Arguments missing for built-in function __memcmp).: NEWS Zend/zend_language_parser.y
Commit:a44a1dc194e60c51a4b7716f78f34a7dc334744b Author:Xinchen Hui larue...@php.net Tue, 26 Jun 2012 18:42:33 +0800 Parents: 91e1df704eed40325fd963a308e466bbbf96184f Branches: PHP-5.4 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=a44a1dc194e60c51a4b7716f78f34a7dc334744b Log: Fixed bug #62357 (compile failure: (S) Arguments missing for built-in function __memcmp). Any C library function may be a macro, We should avoid using ZEND_STRS(L) as their arguments Bugs: https://bugs.php.net/62357 Changed paths: M NEWS M Zend/zend_language_parser.y Diff: diff --git a/NEWS b/NEWS index e93d717..f8a98c7 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,8 @@ PHP NEWS ?? ??? 2012, PHP 5.4.5 - Core: + . Fixed bug #62357 (compile failure: (S) Arguments missing for built-in +function __memcmp). (Laruence) . Fixed bug #61998 (Using traits with method aliases appears to result in crash during execution). (Dmitry) . Fixed bug #51094 (parse_ini_file() with INI_SCANNER_RAW cuts a value that diff --git a/Zend/zend_language_parser.y b/Zend/zend_language_parser.y index d0730b7..9a0b320 100644 --- a/Zend/zend_language_parser.y +++ b/Zend/zend_language_parser.y @@ -1191,7 +1191,7 @@ static YYSIZE_T zend_yytnamerr(char *yyres, const char *yystr) if (LANG_SCNG(yy_text)[0] == 0 LANG_SCNG(yy_leng) == 1 - memcmp(yystr, ZEND_STRL(\end of file\)) == 0) { + memcmp(yystr, \end of file\, sizeof(\end of file\) - 1) == 0) { yystpcpy(yyres, end of file); return sizeof(end of file)-1; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.4': Zend/zend_language_parser.y
Commit:a027ba3afe8b6f5144f928f510d9af8ffe10a532 Author:Xinchen Hui larue...@php.net Tue, 26 Jun 2012 18:50:52 +0800 Parents: 02d8e8959b855e72b4d5cafc71666a1bbe3de672 a44a1dc194e60c51a4b7716f78f34a7dc334744b Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=a027ba3afe8b6f5144f928f510d9af8ffe10a532 Log: Merge branch 'PHP-5.4' * PHP-5.4: Fixed bug #62357 (compile failure: (S) Arguments missing for built-in function __memcmp). Bugs: https://bugs.php.net/62357 Changed paths: MM Zend/zend_language_parser.y Diff: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Fix potential leak in cli server: sapi/cli/php_cli_server.c
Commit:11a202ef50fdcd92b5cc3b3e1d5a739cd85b7541 Author:stealth35 jinm...@hotmail.com Sat, 16 Jun 2012 00:56:54 +0300 Parents: 280e3a4ec8616f4a32a5186463d475592d1eebda Branches: PHP-5.4 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=11a202ef50fdcd92b5cc3b3e1d5a739cd85b7541 Log: Fix potential leak in cli server Changed paths: M sapi/cli/php_cli_server.c Diff: diff --git a/sapi/cli/php_cli_server.c b/sapi/cli/php_cli_server.c index 87ab7b4..876c57a 100644 --- a/sapi/cli/php_cli_server.c +++ b/sapi/cli/php_cli_server.c @@ -1826,6 +1826,9 @@ static int php_cli_server_send_error_page(php_cli_server *server, php_cli_server return SUCCESS; fail: + if (errstr) { + pefree(errstr, 1); + } efree(escaped_request_uri); return FAILURE; } /* }}} */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Remove unused codes: win32/time.c
Commit:6ecc9f1d9dfbfa264725aabcf52b75e31ce59deb Author:Xinchen Hui larue...@php.net Thu, 7 Jun 2012 14:31:35 +0800 Parents: d9810af45ae9e3cbd2c97543b5dfa2d7c93e81c1 Branches: PHP-5.3 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=6ecc9f1d9dfbfa264725aabcf52b75e31ce59deb Log: Remove unused codes Changed paths: M win32/time.c Diff: diff --git a/win32/time.c b/win32/time.c index 8b847b0..391a8a8 100644 --- a/win32/time.c +++ b/win32/time.c @@ -34,23 +34,21 @@ int getfilesystemtime(struct timeval *time_Info) { -FILETIME ft; -__int64 ff; -ULARGE_INTEGER convFromft; +FILETIME ft; +__int64 ff; +ULARGE_INTEGER convFromft; GetSystemTimeAsFileTime(ft); /* 100 ns blocks since 01-Jan-1641 */ -/* resolution seems to be 0.01 sec */ -/* ff = *(__int64*)(ft); */ +/* resolution seems to be 0.01 sec */ /* -Do not cast a pointer to a FILETIME structure to either a -ULARGE_INTEGER* or __int64* value because it can cause alignment faults on 64-bit Windows. - -via http://technet.microsoft.com/en-us/library/ms724284(v=vs.85).aspx + * Do not cast a pointer to a FILETIME structure to either a + * ULARGE_INTEGER* or __int64* value because it can cause alignment faults on 64-bit Windows. + * via http://technet.microsoft.com/en-us/library/ms724284(v=vs.85).aspx */ convFromft.HighPart = ft.dwHighDateTime; convFromft.LowPart = ft.dwLowDateTime; ff = convFromft.QuadPart; - + time_Info-tv_sec = (int)(ff/(__int64)1000-(__int64)11644473600); time_Info-tv_usec = (int)(ff % 1000)/10; return 0; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: based on microsoft's description,the direct convert from FILETIME struct to __int64 is unsafe.: win32/time.c
Commit:d9810af45ae9e3cbd2c97543b5dfa2d7c93e81c1 Author:slayercat llz916...@yahoo.com.cn Wed, 23 May 2012 20:30:16 +0800 Committer: Xinchen Hui larue...@php.net Thu, 7 Jun 2012 14:28:05 +0800 Parents: c1ac3252288c2eeb0b9278458ad15e19912a945a Branches: PHP-5.3 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=d9810af45ae9e3cbd2c97543b5dfa2d7c93e81c1 Log: based on microsoft's description,the direct convert from FILETIME struct to __int64 is unsafe. via http://technet.microsoft.com/en-us/library/ms724284(v=vs.85).aspx Do not cast a pointer to a FILETIME structure to either a ULARGE_INTEGER* or __int64* value because it can cause alignment faults on 64-bit Windows. Changed paths: M win32/time.c Diff: diff --git a/win32/time.c b/win32/time.c index a376fd6..8b847b0 100644 --- a/win32/time.c +++ b/win32/time.c @@ -1,4 +1,3 @@ - /* * * * DH_TIME.C * @@ -37,10 +36,21 @@ int getfilesystemtime(struct timeval *time_Info) { FILETIME ft; __int64 ff; +ULARGE_INTEGER convFromft; GetSystemTimeAsFileTime(ft); /* 100 ns blocks since 01-Jan-1641 */ /* resolution seems to be 0.01 sec */ -ff = *(__int64*)(ft); +/* ff = *(__int64*)(ft); */ +/* +Do not cast a pointer to a FILETIME structure to either a +ULARGE_INTEGER* or __int64* value because it can cause alignment faults on 64-bit Windows. + +via http://technet.microsoft.com/en-us/library/ms724284(v=vs.85).aspx + */ +convFromft.HighPart = ft.dwHighDateTime; +convFromft.LowPart = ft.dwLowDateTime; +ff = convFromft.QuadPart; + time_Info-tv_sec = (int)(ff/(__int64)1000-(__int64)11644473600); time_Info-tv_usec = (int)(ff % 1000)/10; return 0; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.4': ext/intl/msgformat/msgformat_attr.c ext/intl/msgformat/msgformat_data.c ext/intl/msgformat/msgformat_data.h ext/intl/msgformat/msgformat_format.c
Commit:07d0eab204c19ceca259319c38af79e64b61aecd Author:Xinchen Hui larue...@php.net Thu, 7 Jun 2012 14:42:35 +0800 Parents: c22a29b57639178581210ec377ea4e9909f828c9 83542dcf3b84767cc950e2def7b35ec3b4839edc Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=07d0eab204c19ceca259319c38af79e64b61aecd Log: Merge branch 'PHP-5.4' By Gustavo André dos Santos Lopes (4) and others via Felipe Pena (2) and Xinchen Hui (2) * PHP-5.4: Remove unused codes based on microsoft's description,the direct convert from FILETIME struct to __int64 is unsafe. merge 5.3 entries restore NEWS Fix ext/intl build on ICU 4.8 Optimization in ext/intl/msgformat Fixed tests in ext/intl Changed XFAILed collator_get_sort_key.phpt Changed paths: MM ext/intl/msgformat/msgformat_attr.c MM ext/intl/msgformat/msgformat_data.c MM ext/intl/msgformat/msgformat_data.h MM ext/intl/msgformat/msgformat_format.c Diff: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Fixed Bug #62202 (ReflectionParameter::getDefaultValue() memory leaks with constant): NEWS ext/reflection/php_reflection.c
Commit:1f5327a6022fedc1985d2daa6d189313d808b08b Author:Xinchen Hui larue...@php.net Fri, 1 Jun 2012 14:55:14 +0800 Parents: fa05f038cb2cd9e9fa17efd2286c42dcb3e9aa05 Branches: PHP-5.3 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=1f5327a6022fedc1985d2daa6d189313d808b08b Log: Fixed Bug #62202 (ReflectionParameter::getDefaultValue() memory leaks with constant) Bugs: https://bugs.php.net/62202 Changed paths: M NEWS M ext/reflection/php_reflection.c Diff: diff --git a/NEWS b/NEWS index 0297393..d031c3c 100644 --- a/NEWS +++ b/NEWS @@ -35,6 +35,10 @@ PHP NEWS pattern). (Gustavo) . Fixed bug #60785 (memory leak in IntlDateFormatter constructor). (Gustavo) +- Reflection: + . Fixed bug #62202 (ReflectionParameter::getDefaultValue() memory leaks +with constant). (Laruence) + - XML Writer: . Fixed bug #62064 (memory leak in the XML Writer module). (jean-pierre dot lozi at lip6 dot fr) diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 8141275..ca90269 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -2420,7 +2420,8 @@ ZEND_METHOD(reflection_parameter, getDefaultValue) *return_value = precv-op2.u.constant; INIT_PZVAL(return_value); - if (Z_TYPE_P(return_value) != IS_CONSTANT Z_TYPE_P(return_value) != IS_CONSTANT_ARRAY) { + if ((Z_TYPE_P(return_value) IS_CONSTANT_TYPE_MASK) != IS_CONSTANT +(Z_TYPE_P(return_value) IS_CONSTANT_TYPE_MASK) != IS_CONSTANT_ARRAY) { zval_copy_ctor(return_value); } zval_update_constant_ex(return_value, (void*)0, param-fptr-common.scope TSRMLS_CC); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.3' into PHP-5.4: ext/reflection/php_reflection.c
Commit:b548d9ad2e02f3f216320b5f47e26046021a5bac Author:Xinchen Hui larue...@php.net Fri, 1 Jun 2012 15:00:02 +0800 Parents: 5ebb0e520f4c31d09d9e5acd323162eca3fee0e3 1f5327a6022fedc1985d2daa6d189313d808b08b Branches: PHP-5.4 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=b548d9ad2e02f3f216320b5f47e26046021a5bac Log: Merge branch 'PHP-5.3' into PHP-5.4 * PHP-5.3: Fixed Bug #62202 (ReflectionParameter::getDefaultValue() memory leaks with constant) Bugs: https://bugs.php.net/62202 Changed paths: MM ext/reflection/php_reflection.c Diff: diff --cc ext/reflection/php_reflection.c index 1cf65ce,ca90269..9346587 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@@ -2559,9 -2418,10 +2559,10 @@@ ZEND_METHOD(reflection_parameter, getDe return; } - *return_value = precv-op2.u.constant; + *return_value = *precv-op2.zv; INIT_PZVAL(return_value); - if (Z_TYPE_P(return_value) != IS_CONSTANT Z_TYPE_P(return_value) != IS_CONSTANT_ARRAY) { + if ((Z_TYPE_P(return_value) IS_CONSTANT_TYPE_MASK) != IS_CONSTANT +(Z_TYPE_P(return_value) IS_CONSTANT_TYPE_MASK) != IS_CONSTANT_ARRAY) { zval_copy_ctor(return_value); } zval_update_constant_ex(return_value, (void*)0, param-fptr-common.scope TSRMLS_CC); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Typofix in comment in proc_open.c: ext/standard/proc_open.c
Commit:a331f43f8cc8f2b9c23ddee95632b765e2e440e5 Author:Jille Timmermans ji...@quis.cx Tue, 29 May 2012 15:44:04 +0200 Committer: Xinchen Hui larue...@php.net Wed, 30 May 2012 14:42:39 +0800 Parents: aab49e934de1fff046e659cbec46e3d053b41c34 Branches: PHP-5.3 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=a331f43f8cc8f2b9c23ddee95632b765e2e440e5 Log: Typofix in comment in proc_open.c Changed paths: M ext/standard/proc_open.c Diff: diff --git a/ext/standard/proc_open.c b/ext/standard/proc_open.c index 98288e4..db63a67 100644 --- a/ext/standard/proc_open.c +++ b/ext/standard/proc_open.c @@ -57,7 +57,7 @@ /* This symbol is defined in ext/standard/config.m4. * Essentially, it is set if you HAVE_FORK || PHP_WIN32 - * Otherplatforms may modify that configure check and add suitable #ifdefs + * Other platforms may modify that configure check and add suitable #ifdefs * around the alternate code. * */ #ifdef PHP_CAN_SUPPORT_PROC_OPEN -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.3' into PHP-5.4: ext/standard/proc_open.c
Commit:7511f972fdc395c4770896576bb8752370e46c21 Author:Xinchen Hui larue...@php.net Wed, 30 May 2012 14:43:55 +0800 Parents: 692b3bcd88ece3eefbc5131ecdf971ff18f191cf a331f43f8cc8f2b9c23ddee95632b765e2e440e5 Branches: PHP-5.4 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=7511f972fdc395c4770896576bb8752370e46c21 Log: Merge branch 'PHP-5.3' into PHP-5.4 * PHP-5.3: Typofix in comment in proc_open.c Changed paths: MM ext/standard/proc_open.c Diff: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Fixed bug #62128 superfluous ;: php.ini-development php.ini-production
Commit:c3547f19359c7150a9bbd35aa2a7adc9da900da5 Author:Xinchen Hui larue...@php.net Fri, 25 May 2012 22:31:26 +0800 Parents: 86d2fafded73511e762671a60d6935ac87d6e39d Branches: PHP-5.3 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=c3547f19359c7150a9bbd35aa2a7adc9da900da5 Log: Fixed bug #62128 superfluous ; Bugs: https://bugs.php.net/62128 Changed paths: M php.ini-development M php.ini-production Diff: diff --git a/php.ini-development b/php.ini-development index c198ccc..1375516 100644 --- a/php.ini-development +++ b/php.ini-development @@ -842,7 +842,7 @@ enable_dl = Off ; will look for to know it is OK to continue execution. Setting this variable MAY ; cause security issues, KNOW WHAT YOU ARE DOING FIRST. ; http://php.net/cgi.redirect-status-env -;cgi.redirect_status_env = ; +;cgi.redirect_status_env = ; cgi.fix_pathinfo provides *real* PATH_INFO/PATH_TRANSLATED support for CGI. PHP's ; previous behaviour was to set PATH_TRANSLATED to SCRIPT_FILENAME, and to not grok @@ -859,7 +859,7 @@ enable_dl = Off ; does not currently support this feature (03/17/2002) ; Set to 1 if running under IIS. Default is zero. ; http://php.net/fastcgi.impersonate -;fastcgi.impersonate = 1; +;fastcgi.impersonate = 1 ; Disable logging through FastCGI connection. PHP's default behavior is to enable ; this feature. diff --git a/php.ini-production b/php.ini-production index 3c0ae21..495fb01 100644 --- a/php.ini-production +++ b/php.ini-production @@ -842,7 +842,7 @@ enable_dl = Off ; will look for to know it is OK to continue execution. Setting this variable MAY ; cause security issues, KNOW WHAT YOU ARE DOING FIRST. ; http://php.net/cgi.redirect-status-env -;cgi.redirect_status_env = ; +;cgi.redirect_status_env = ; cgi.fix_pathinfo provides *real* PATH_INFO/PATH_TRANSLATED support for CGI. PHP's ; previous behaviour was to set PATH_TRANSLATED to SCRIPT_FILENAME, and to not grok @@ -859,7 +859,7 @@ enable_dl = Off ; does not currently support this feature (03/17/2002) ; Set to 1 if running under IIS. Default is zero. ; http://php.net/fastcgi.impersonate -;fastcgi.impersonate = 1; +;fastcgi.impersonate = 1 ; Disable logging through FastCGI connection. PHP's default behavior is to enable ; this feature. -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.3' into PHP-5.4: php.ini-development php.ini-production
Commit:91ad40d9bbc772709fb9f88c55d7ce55f55df71b Author:Xinchen Hui larue...@php.net Fri, 25 May 2012 22:33:17 +0800 Parents: 16a592b13a7909aa9d370fd020a10e00772bc254 c3547f19359c7150a9bbd35aa2a7adc9da900da5 Branches: PHP-5.4 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=91ad40d9bbc772709fb9f88c55d7ce55f55df71b Log: Merge branch 'PHP-5.3' into PHP-5.4 * PHP-5.3: Fixed bug #62128 superfluous ; Bugs: https://bugs.php.net/62128 Changed paths: MM php.ini-development MM php.ini-production Diff: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.4': php.ini-development php.ini-production
Commit:61a13773bcbf761ecc03faa99877d3cac90529a0 Author:Xinchen Hui larue...@php.net Fri, 25 May 2012 22:34:06 +0800 Parents: a1e97bada8894549af030b645d10d39222dfb9c6 91ad40d9bbc772709fb9f88c55d7ce55f55df71b Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=61a13773bcbf761ecc03faa99877d3cac90529a0 Log: Merge branch 'PHP-5.4' * PHP-5.4: Fixed bug #62128 superfluous ; Bugs: https://bugs.php.net/62128 Changed paths: MM php.ini-development MM php.ini-production Diff: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Fixed bug #62073 (Different ways of iterating over an SplMaxHeap result in different keys): ext/spl/spl_heap.c ext/spl/tests/bug62073.phpt ext/spl/tests/heap_005.phpt ext/spl/te
Commit:9205c4fd62a769b7db3d00eccdf2ea35b20dd87f Author:Reeze Xia reeze@gmail.com Wed, 23 May 2012 20:42:06 +0800 Parents: c973fef48d6302b9bcec898de8e39d8d7e23adef Branches: PHP-5.3 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=9205c4fd62a769b7db3d00eccdf2ea35b20dd87f Log: Fixed bug #62073 (Different ways of iterating over an SplMaxHeap result in different keys) Bugs: https://bugs.php.net/62073 Changed paths: M ext/spl/spl_heap.c A ext/spl/tests/bug62073.phpt M ext/spl/tests/heap_005.phpt M ext/spl/tests/heap_006.phpt M ext/spl/tests/pqueue_001.phpt Diff: diff --git a/ext/spl/spl_heap.c b/ext/spl/spl_heap.c index e2b8f75..a0055f4 100644 --- a/ext/spl/spl_heap.c +++ b/ext/spl/spl_heap.c @@ -950,7 +950,7 @@ static int spl_heap_it_get_current_key(zend_object_iterator *iter, char **str_ke { spl_heap_it *iterator = (spl_heap_it *)iter; - *int_key = (ulong) iterator-object-heap-count; + *int_key = (ulong) iterator-object-heap-count - 1; return HASH_KEY_IS_LONG; } /* }}} */ diff --git a/ext/spl/tests/bug62073.phpt b/ext/spl/tests/bug62073.phpt new file mode 100644 index 000..2472059 --- /dev/null +++ b/ext/spl/tests/bug62073.phpt @@ -0,0 +1,24 @@ +--TEST-- +Bug #62073 (different ways of iterating over an SplMaxHeap result in different keys) +--FILE-- +?php +$heap = new SplMaxHeap; +$heap-insert(42); +foreach ($heap as $key = $value) { + break; +} +var_dump($key); +var_dump($value); + +$heap = new SplMaxHeap; +$heap-insert(42); +var_dump($heap-key()); +var_dump($heap-current()); +? +==DONE== +--EXPECT-- +int(0) +int(42) +int(0) +int(42) +==DONE== \ No newline at end of file diff --git a/ext/spl/tests/heap_005.phpt b/ext/spl/tests/heap_005.phpt index 73daaf4..1291cda 100644 --- a/ext/spl/tests/heap_005.phpt +++ b/ext/spl/tests/heap_005.phpt @@ -18,104 +18,104 @@ foreach ($h as $k = $o) { ===DONE=== ?php exit(0); ? --EXPECTF-- -100 = 1 -99 = 2 -98 = 3 -97 = 4 -96 = 5 -95 = 6 -94 = 7 -93 = 8 -92 = 9 -91 = 10 -90 = 11 -89 = 12 -88 = 13 -87 = 14 -86 = 15 -85 = 16 -84 = 17 -83 = 18 -82 = 19 -81 = 20 -80 = 21 -79 = 22 -78 = 23 -77 = 24 -76 = 25 -75 = 26 -74 = 27 -73 = 28 -72 = 29 -71 = 30 -70 = 31 -69 = 32 -68 = 33 -67 = 34 -66 = 35 -65 = 36 -64 = 37 -63 = 38 -62 = 39 -61 = 40 -60 = 41 -59 = 42 -58 = 43 -57 = 44 -56 = 45 -55 = 46 -54 = 47 -53 = 48 -52 = 49 -51 = 50 -50 = 51 -49 = 52 -48 = 53 -47 = 54 -46 = 55 -45 = 56 -44 = 57 -43 = 58 -42 = 59 -41 = 60 -40 = 61 -39 = 62 -38 = 63 -37 = 64 -36 = 65 -35 = 66 -34 = 67 -33 = 68 -32 = 69 -31 = 70 -30 = 71 -29 = 72 -28 = 73 -27 = 74 -26 = 75 -25 = 76 -24 = 77 -23 = 78 -22 = 79 -21 = 80 -20 = 81 -19 = 82 -18 = 83 -17 = 84 -16 = 85 -15 = 86 -14 = 87 -13 = 88 -12 = 89 -11 = 90 -10 = 91 -9 = 92 -8 = 93 -7 = 94 -6 = 95 -5 = 96 -4 = 97 -3 = 98 -2 = 99 -1 = 100 +99 = 1 +98 = 2 +97 = 3 +96 = 4 +95 = 5 +94 = 6 +93 = 7 +92 = 8 +91 = 9 +90 = 10 +89 = 11 +88 = 12 +87 = 13 +86 = 14 +85 = 15 +84 = 16 +83 = 17 +82 = 18 +81 = 19 +80 = 20 +79 = 21 +78 = 22 +77 = 23 +76 = 24 +75 = 25 +74 = 26 +73 = 27 +72 = 28 +71 = 29 +70 = 30 +69 = 31 +68 = 32 +67 = 33 +66 = 34 +65 = 35 +64 = 36 +63 = 37 +62 = 38 +61 = 39 +60 = 40 +59 = 41 +58 = 42 +57 = 43 +56 = 44 +55 = 45 +54 = 46 +53 = 47 +52 = 48 +51 = 49 +50 = 50 +49 = 51 +48 = 52 +47 = 53 +46 = 54 +45 = 55 +44 = 56 +43 = 57 +42 = 58 +41 = 59 +40 = 60 +39 = 61 +38 = 62 +37 = 63 +36 = 64 +35 = 65 +34 = 66 +33 = 67 +32 = 68 +31 = 69 +30 = 70 +29 = 71 +28 = 72 +27 = 73 +26 = 74 +25 = 75 +24 = 76 +23 = 77 +22 = 78 +21 = 79 +20 = 80 +19 = 81 +18 = 82 +17 = 83 +16 = 84 +15 = 85 +14 = 86 +13 = 87 +12 = 88 +11 = 89 +10 = 90 +9 = 91 +8 = 92 +7 = 93 +6 = 94 +5 = 95 +4 = 96 +3 = 97 +2 = 98 +1 = 99 +0 = 100 ===DONE=== diff --git a/ext/spl/tests/heap_006.phpt b/ext/spl/tests/heap_006.phpt index 4422727..3218bdf 100644 --- a/ext/spl/tests/heap_006.phpt +++ b/ext/spl/tests/heap_006.phpt @@ -18,104 +18,104 @@ foreach ($h as $k = $o) { ===DONE=== ?php exit(0); ? --EXPECTF-- -100 = 100 -99 = 99 -98 = 98 -97 = 97 -96 = 96 -95 = 95 -94 = 94 -93 = 93 -92 = 92 -91 = 91 -90 = 90 -89 = 89 -88 = 88 -87 = 87 -86 = 86 -85 = 85 -84 = 84 -83 = 83 -82 = 82 -81 = 81 -80 = 80 -79 = 79 -78 = 78 -77 = 77 -76 = 76 -75 = 75 -74 = 74 -73 = 73 -72 = 72 -71 = 71 -70 = 70 -69 = 69 -68 = 68 -67 = 67 -66 = 66 -65 = 65 -64 = 64 -63 = 63 -62 = 62 -61 = 61 -60 = 60 -59 = 59 -58 = 58 -57 = 57 -56 = 56 -55 = 55 -54 = 54 -53 = 53 -52 = 52 -51 = 51 -50 = 50 -49 = 49 -48 = 48 -47 = 47 -46 = 46 -45 = 45 -44 = 44 -43 = 43 -42 = 42 -41 = 41 -40 = 40 -39 = 39 -38 = 38 -37 = 37 -36 = 36 -35 = 35 -34 = 34 -33 = 33 -32 = 32 -31 = 31 -30 = 30 -29 = 29 -28 = 28 -27 = 27 -26 = 26 -25 = 25 -24 = 24 -23 = 23 -22 = 22 -21 = 21 -20 = 20 -19 = 19 -18 = 18 -17 = 17 -16 = 16 -15 = 15 -14 = 14 -13 = 13 -12 = 12 -11 = 11 -10 = 10 -9 = 9 -8 = 8 -7 = 7 -6 = 6 -5 = 5 -4 = 4 -3 = 3 -2 = 2 -1 = 1 +99 = 100 +98 = 99 +97 = 98 +96 = 97 +95 = 96 +94 = 95 +93 = 94 +92 = 93 +91 = 92 +90 = 91 +89 = 90 +88 = 89 +87 = 88 +86 =
[PHP-CVS] com php-src: Fixed bug #62073: NEWS ext/spl/tests/bug62073.phpt
Commit:bde86a6639a661dcadb0ae4c3ce4cc8aca2a42b9 Author:Xinchen Hui larue...@php.net Thu, 24 May 2012 23:20:21 +0800 Parents: 85c777d2f1d5a12fac0100f4953d33a7380d0b03 9205c4fd62a769b7db3d00eccdf2ea35b20dd87f Branches: PHP-5.3 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=bde86a6639a661dcadb0ae4c3ce4cc8aca2a42b9 Log: Fixed bug #62073 (Different ways of iterating over an SplMaxHeap result in in different keys) Bugs: https://bugs.php.net/62073 Changed paths: MM NEWS AM ext/spl/tests/bug62073.phpt Diff: diff --cc NEWS index 5fa6ecb,5f1146a..078725f --- a/NEWS +++ b/NEWS @@@ -4,25 -4,6 +4,29 @@@ PH ?? ??? 2012, PHP 5.3.14 - - FPM ++- FPM: + . Fixed bug #61045 (fpm don't send error log to fastcgi clients). (fat) + . Fixed bug #61835 (php-fpm is not allowed to run as root). (fat) + . Fixed bug #61295 (php-fpm should not fail with commented 'user' +for non-root start). (fat) + . Fixed bug #61026 (FPM pools can listen on the same address). (fat) + - - Intl ++- Intl: + . Fixed bug #62083 (grapheme_extract() memory leaks). (Gustavo) + . Fixed bug #62082 (memory corruption in internal get_icu_disp_value_src_php +function). (Gustavo) + . Fixed bug #62081 (IntlDateFormatter constructor leaks memory when called +twice). (Gustavo) + . Fixed bug #62070 (Collator::getSortKey() returns garbage). (Gustavo) + . Fixed bug #62017 (datefmt_create with incorrectly encoded timezone leaks +pattern). (Gustavo) + . Fixed bug #60785 (memory leak in IntlDateFormatter constructor). (Gustavo) + . Fixed bug #55610 (ResourceBundle should implement Traversable). (stealth35) + ++- SPL: ++ . Fixed bug #62073 (Different ways of iterating over an SplMaxHeap result in ++in different keys). (reeze@gmail.com) ++ - XML Writer: . Fixed bug #62064 (memory leak in the XML Writer module). (jean-pierre dot lozi at lip6 dot fr) @@@ -145,7 -126,7 +149,7 @@@ . Fixed bug #60968 (Late static binding doesn't work with ReflectionMethod::invokeArgs()). (Laruence) --- SOAP ++- SOAP: . Fixed basic HTTP authentication for WSDL sub requests. (Dmitry) . Fixed bug #60887 (SoapClient ignores user_agent option and sends no User-Agent header). (carloschilazo at gmail dot com) @@@ -154,7 -135,7 +158,7 @@@ . Fixed bug #49853 (Soap Client stream context header option ignored). (Dmitry) --- SPL ++- SPL: . Fixed memory leak when calling SplFileInfo's constructor twice. (Felipe) . Fixed bug #61418 (Segmentation fault when DirectoryIterator's or FilesystemIterator's iterators are requested more than once without diff --cc ext/spl/tests/bug62073.phpt index 000,2472059..3bd3553 mode 00,100644..100644 --- a/ext/spl/tests/bug62073.phpt +++ b/ext/spl/tests/bug62073.phpt @@@ -1,0 -1,24 +1,22 @@@ + --TEST-- + Bug #62073 (different ways of iterating over an SplMaxHeap result in different keys) + --FILE-- + ?php -$heap = new SplMaxHeap; ++$heap = new SplMaxHeap(); + $heap-insert(42); + foreach ($heap as $key = $value) { - break; ++var_dump($key); ++var_dump($value); ++break; + } -var_dump($key); -var_dump($value); + -$heap = new SplMaxHeap; ++$heap = new SplMaxHeap(); + $heap-insert(42); + var_dump($heap-key()); + var_dump($heap-current()); + ? -==DONE== + --EXPECT-- + int(0) + int(42) + int(0) + int(42) -==DONE== -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.3' into PHP-5.4: ext/spl/spl_heap.c
Commit:a10da87c6a2cadc5151d185573b0125d06daad6b Author:Xinchen Hui larue...@php.net Thu, 24 May 2012 23:34:14 +0800 Parents: 04fd0b1098005a20d6acdbc7d7bf7ea4e1287242 bde86a6639a661dcadb0ae4c3ce4cc8aca2a42b9 Branches: PHP-5.4 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=a10da87c6a2cadc5151d185573b0125d06daad6b Log: Merge branch 'PHP-5.3' into PHP-5.4 * PHP-5.3: Fixed bug #62073 (Different ways of iterating over an SplMaxHeap result in different keys) Bugs: https://bugs.php.net/62073 Changed paths: MM ext/spl/spl_heap.c Diff: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Revert Implemented FR #61602 Allow access to name of constant used as default value: ext/reflection/php_reflection.c
Commit:a7df6ce664e6fe8601531d90318082bb6597 Author:Xinchen Hui larue...@php.net Wed, 23 May 2012 13:39:00 +0800 Parents: 621fddab93468219aafb0392c7056e551defa1fa Branches: PHP-5.3 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=a7df6ce664e6fe8601531d90318082bb6597 Log: Revert Implemented FR #61602 Allow access to name of constant used as default value This reverts commit 054f3e3ce5af13c2c3a6ccd54f7dc3e2f6cd4f74. See: http://news.php.net/php.cvs/69137 and the author confirmed. Will commit later after the author fixed this then make a new PR. Conflicts: ext/reflection/php_reflection.c Bugs: https://bugs.php.net/61602 Changed paths: M ext/reflection/php_reflection.c Diff: diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 522fef1..fe65731 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -2409,12 +2409,12 @@ ZEND_METHOD(reflection_parameter, getDefaultValue) return; } if (param-offset param-required) { - zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, Parameter is not optional); + zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, Parameter is not optional); return; } precv = _get_recv_op((zend_op_array*)param-fptr, param-offset); - if (!precv || precv-opcode != ZEND_RECV_INIT || precv-op2.op_type == IS_UNUSED) { - zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, Internal error); + if (!precv || precv-opcode != ZEND_RECV_INIT || precv-op2_type == IS_UNUSED) { + zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, Internal error); return; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Fix typo while resolving conflicts: ext/reflection/php_reflection.c
Commit:f733173b1f70acec4f124f3c8e9dc1b3fb422413 Author:Xinchen Hui larue...@php.net Wed, 23 May 2012 13:43:49 +0800 Parents: a7df6ce664e6fe8601531d90318082bb6597 Branches: PHP-5.3 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=f733173b1f70acec4f124f3c8e9dc1b3fb422413 Log: Fix typo while resolving conflicts Changed paths: M ext/reflection/php_reflection.c Diff: diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index fe65731..8141275 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -2413,7 +2413,7 @@ ZEND_METHOD(reflection_parameter, getDefaultValue) return; } precv = _get_recv_op((zend_op_array*)param-fptr, param-offset); - if (!precv || precv-opcode != ZEND_RECV_INIT || precv-op2_type == IS_UNUSED) { + if (!precv || precv-opcode != ZEND_RECV_INIT || precv-op2.op_type == IS_UNUSED) { zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, Internal error); return; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Revert Implemented FR #61602 Allow access to name of constant used as default value: ext/reflection/php_reflection.c ext/reflection/tests/ReflectionParameter_DefaultValueConst
Commit:df481764f34b0268025d031a082297edee124c7c Author:Xinchen Hui larue...@php.net Wed, 23 May 2012 13:50:12 +0800 Parents: 29876c5c29e737158ecfeb32a59b5bfb0607723b Branches: PHP-5.4 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=df481764f34b0268025d031a082297edee124c7c Log: Revert Implemented FR #61602 Allow access to name of constant used as default value This reverts commit 054f3e3ce5af13c2c3a6ccd54f7dc3e2f6cd4f74. See: http://news.php.net/php.cvs/69137 and the author confirmed. Will commit later after the author fixed this then make a new PR. Conflicts: ext/reflection/php_reflection.c Bugs: https://bugs.php.net/61602 Changed paths: M ext/reflection/php_reflection.c D ext/reflection/tests/ReflectionParameter_DefaultValueConstant_basic1.phpt D ext/reflection/tests/ReflectionParameter_DefaultValueConstant_basic2.phpt D ext/reflection/tests/ReflectionParameter_DefaultValueConstant_error.phpt diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 406da93..1cf65ce 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -1457,49 +1457,6 @@ static void _reflection_export(INTERNAL_FUNCTION_PARAMETERS, zend_class_entry *c } /* }}} */ -/* {{{ _reflection_param_get_default_param */ -static parameter_reference *_reflection_param_get_default_param(INTERNAL_FUNCTION_PARAMETERS) -{ - reflection_object *intern; - parameter_reference *param; - - GET_REFLECTION_OBJECT_PTR(param); - - if (param-fptr-type != ZEND_USER_FUNCTION) - { - zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, Cannot determine default value for internal functions); - return NULL; - } - - if (param-offset param-required) { - zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, Parameter is not optional); - return NULL; - } - - return param; -} -/* }}} */ - -/* {{{ _reflection_param_get_default_precv */ -static zend_op *_reflection_param_get_default_precv(INTERNAL_FUNCTION_PARAMETERS, parameter_reference *param) -{ - zend_op *precv; - - param = param ? param : _reflection_param_get_default_param(INTERNAL_FUNCTION_PARAM_PASSTHRU); - if (!param) { - return NULL; - } - - precv = _get_recv_op((zend_op_array*)param-fptr, param-offset); - if (!precv || precv-opcode != ZEND_RECV_INIT || precv-op2_type == IS_UNUSED) { - zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, Internal error); - return NULL; - } - - return precv; -} -/* }}} */ - /* {{{ Preventing __clone from being called */ ZEND_METHOD(reflection, __clone) { @@ -2578,14 +2535,27 @@ ZEND_METHOD(reflection_parameter, isDefaultValueAvailable) Returns the default value of this parameter or throws an exception */ ZEND_METHOD(reflection_parameter, getDefaultValue) { - parameter_reference *param = _reflection_param_get_default_param(INTERNAL_FUNCTION_PARAM_PASSTHRU); - zend_op *precv = _reflection_param_get_default_precv(INTERNAL_FUNCTION_PARAM_PASSTHRU, param); + reflection_object *intern; + parameter_reference *param; + zend_op *precv; if (zend_parse_parameters_none() == FAILURE) { return; } + GET_REFLECTION_OBJECT_PTR(param); - if (!(param precv)) { + if (param-fptr-type != ZEND_USER_FUNCTION) + { + zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, Cannot determine default value for internal functions); + return; + } + if (param-offset param-required) { + zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, Parameter is not optional); + return; + } + precv = _get_recv_op((zend_op_array*)param-fptr, param-offset); + if (!precv || precv-opcode != ZEND_RECV_INIT || precv-op2_type == IS_UNUSED) { + zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, Internal error); return; } @@ -2598,42 +2568,6 @@ ZEND_METHOD(reflection_parameter, getDefaultValue) } /* }}} */ -/* {{{ proto public bool ReflectionParameter::isDefaultValueConstant() - Returns whether the default value of this parameter is constant */ -ZEND_METHOD(reflection_parameter, isDefaultValueConstant) -{ - zend_op *precv = _reflection_param_get_default_precv(INTERNAL_FUNCTION_PARAM_PASSTHRU, NULL); - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - if (precv (Z_TYPE_P(precv-op2.zv) IS_CONSTANT_TYPE_MASK) == IS_CONSTANT) { - RETURN_TRUE; - } - - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto public mixed ReflectionParameter::getDefaultValueConstantName() - Returns the default value's constant name if default value is constant
[PHP-CVS] com php-src: Revert NEWS: NEWS
Commit:5b8316188c4fe209d191310a49aea9ac3fcd056a Author:Xinchen Hui larue...@php.net Wed, 23 May 2012 13:52:18 +0800 Parents: df481764f34b0268025d031a082297edee124c7c Branches: PHP-5.4 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=5b8316188c4fe209d191310a49aea9ac3fcd056a Log: Revert NEWS Changed paths: M NEWS Diff: diff --git a/NEWS b/NEWS index ba0b220..ad51a67 100644 --- a/NEWS +++ b/NEWS @@ -50,10 +50,6 @@ PHP NEWS - Pgsql: . Added pg_escape_identifier/pg_escape_literal. (Yasuo Ohgaki) -- Reflection: - . Implemented FR #61602 (Allow access to the name of constant -used as function/method parameter's default value). (reeze@gmail.com) - - Fileinfo . Fixed bug #61812 (Uninitialised value used in libmagic). (Laruence, Gustavo) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Use emalloc instead of malloc: Zend/zend_compile.c
Commit:bbcea230e1b3c48cfe0097fca84f4bd9f0dfa31f Author:Xinchen Hui larue...@php.net Mon, 21 May 2012 18:58:19 +0800 Parents: fbb86bd7b3c7425a64bb2f76532f937b3a050ea1 Branches: PHP-5.4 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=bbcea230e1b3c48cfe0097fca84f4bd9f0dfa31f Log: Use emalloc instead of malloc Changed paths: M Zend/zend_compile.c Diff: diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index b7e7cd3..28f9824 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -4077,14 +4077,14 @@ static void zend_do_traits_method_binding(zend_class_entry *ce TSRMLS_DC) /* {{{ size_t i; /* prepare copies of trait function tables for combination */ - function_tables = malloc(sizeof(HashTable*) * ce-num_traits); - resulting_table = (HashTable *) malloc(sizeof(HashTable)); + function_tables = emalloc(sizeof(HashTable*) * ce-num_traits); + resulting_table = (HashTable *)emalloc(sizeof(HashTable)); /* TODO: revisit this start size, may be its not optimal */ - zend_hash_init_ex(resulting_table, 10, NULL, NULL, 1, 0); + zend_hash_init_ex(resulting_table, 10, NULL, NULL, 0, 0); for (i = 0; i ce-num_traits; i++) { - function_tables[i] = (HashTable *) malloc(sizeof(HashTable)); + function_tables[i] = (HashTable *)emalloc(sizeof(HashTable)); zend_hash_init_ex(function_tables[i], ce-traits[i]-function_table.nNumOfElements, NULL, NULL, 1, 0); if (ce-trait_precedences) { @@ -4117,14 +4117,14 @@ static void zend_do_traits_method_binding(zend_class_entry *ce TSRMLS_DC) /* {{{ for (i = 0; i ce-num_traits; i++) { /* zend_hash_destroy(function_tables[i]); */ zend_hash_graceful_destroy(function_tables[i]); - free(function_tables[i]); + efree(function_tables[i]); } - free(function_tables); + efree(function_tables); /* free temporary resulting table */ /* zend_hash_destroy(resulting_table); */ zend_hash_graceful_destroy(resulting_table); - free(resulting_table); + efree(resulting_table); } /* }}} */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Use free instead of efree: Zend/zend_multibyte.c
Commit:4c9a11c85722a888c2bbdf3bf200b90d5c70d13f Author:Xinchen Hui larue...@php.net Mon, 21 May 2012 19:02:45 +0800 Parents: bbcea230e1b3c48cfe0097fca84f4bd9f0dfa31f Branches: PHP-5.4 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=4c9a11c85722a888c2bbdf3bf200b90d5c70d13f Log: Use free instead of efree Changed paths: M Zend/zend_multibyte.c Diff: diff --git a/Zend/zend_multibyte.c b/Zend/zend_multibyte.c index 9149fdc..379f50b 100644 --- a/Zend/zend_multibyte.c +++ b/Zend/zend_multibyte.c @@ -168,7 +168,7 @@ ZEND_API const zend_encoding *zend_multibyte_get_script_encoding(TSRMLS_D) ZEND_API int zend_multibyte_set_script_encoding(const zend_encoding **encoding_list, size_t encoding_list_size TSRMLS_DC) { if (CG(script_encoding_list)) { - efree(CG(script_encoding_list)); + free(CG(script_encoding_list)); } CG(script_encoding_list) = encoding_list; CG(script_encoding_list_size) = encoding_list_size; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Cleanup useless function declaration for traits: Zend/zend_compile.h
Commit:0cb4849e54ee860f44f0f8409a9d5c09f7c9 Author:Reeze Xia reeze@gmail.com Fri, 11 May 2012 16:52:12 +0800 Parents: d394c17293df2405b10aaec1804edd65e1d8efe8 Branches: PHP-5.4 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=0cb4849e54ee860f44f0f8409a9d5c09f7c9 Log: Cleanup useless function declaration for traits Changed paths: M Zend/zend_compile.h Diff: diff --git a/Zend/zend_compile.h b/Zend/zend_compile.h index 8a81a95..f164122 100644 --- a/Zend/zend_compile.h +++ b/Zend/zend_compile.h @@ -518,10 +518,6 @@ void zend_prepare_trait_precedence(znode *result, znode *method_reference, znode void zend_prepare_reference(znode *result, znode *class_name, znode *method_name TSRMLS_DC); void zend_prepare_trait_alias(znode *result, znode *method_reference, znode *modifiers, znode *alias TSRMLS_DC); -void init_trait_alias_list(znode* result, const znode* trait_alias TSRMLS_DC); -void add_trait_alias(znode* result, const znode* trait_alias TSRMLS_DC); -void init_trait_alias(znode* result, const znode* method_name, const znode* alias, const znode* modifiers TSRMLS_DC); - ZEND_API void zend_do_inheritance(zend_class_entry *ce, zend_class_entry *parent_ce TSRMLS_DC); void zend_do_early_binding(TSRMLS_D); ZEND_API void zend_do_delayed_early_binding(const zend_op_array *op_array TSRMLS_DC); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Fixed Bug #62005 (unexpected behavior when incrementally assigning to a member of a null object): NEWS Zend/tests/bug62005.phpt Zend/zend_execute.c
Commit:3332943c9d20a8b5e09816b11f38742de0e16085 Author:Xinchen Hui larue...@php.net Sat, 12 May 2012 13:13:44 +0800 Parents: 950d5ee590214742799836d3d939ee59f641bdf4 Branches: PHP-5.3 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=3332943c9d20a8b5e09816b11f38742de0e16085 Log: Fixed Bug #62005 (unexpected behavior when incrementally assigning to a member of a null object) Bugs: https://bugs.php.net/62005 Changed paths: M NEWS A Zend/tests/bug62005.phpt M Zend/zend_execute.c Diff: diff --git a/NEWS b/NEWS index e9c1370..1057db7 100644 --- a/NEWS +++ b/NEWS @@ -11,6 +11,8 @@ PHP NEWS (Laruence) - Core: + . Fixed bug #62005 (unexpected behavior when incrementally assigning to a +member of a null object). (Laruence) . Fixed bug #61730 (Segfault from array_walk modifying an array passed by reference). (Laruence) . Fixed missing bound check in iptcparse(). (chris at chiappa.net) diff --git a/Zend/tests/bug62005.phpt b/Zend/tests/bug62005.phpt new file mode 100644 index 000..4ff4b2c --- /dev/null +++ b/Zend/tests/bug62005.phpt @@ -0,0 +1,15 @@ +--TEST-- +Bug #62005 (unexpected behavior when incrementally assigning to a member of a null object) +--FILE-- +?php +function add_points($player, $points) { +$player-energy += $points; +print_r($player); +} +add_points(NULL, 2); +--EXPECTF-- +Strict Standards: Creating default object from empty value in %sbug62005.php on line %d +stdClass Object +( +[energy] = 2 +) diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index 705c713..4423921 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -432,11 +432,10 @@ static inline void make_real_object(zval **object_ptr TSRMLS_DC) || (Z_TYPE_PP(object_ptr) == IS_BOOL Z_LVAL_PP(object_ptr) == 0) || (Z_TYPE_PP(object_ptr) == IS_STRING Z_STRLEN_PP(object_ptr) == 0) ) { - zend_error(E_STRICT, Creating default object from empty value); - SEPARATE_ZVAL_IF_NOT_REF(object_ptr); zval_dtor(*object_ptr); object_init(*object_ptr); + zend_error(E_STRICT, Creating default object from empty value); } } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.3' into PHP-5.4: NEWS Zend/tests/bug62005.phpt Zend/zend_execute.c
Commit:6a5095582a1e3b9a065863c9990e2f001d1cdc10 Author:Xinchen Hui larue...@php.net Sat, 12 May 2012 13:19:27 +0800 Parents: 8b4b70df56e14be0f7172b5cc5f8da44b3272ac3 3332943c9d20a8b5e09816b11f38742de0e16085 Branches: PHP-5.4 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=6a5095582a1e3b9a065863c9990e2f001d1cdc10 Log: Merge branch 'PHP-5.3' into PHP-5.4 * PHP-5.3: Fixed Bug #62005 (unexpected behavior when incrementally assigning to a member of a null object) fix stack overflow in php_intlog10abs() Conflicts: Zend/zend_execute.c Bugs: https://bugs.php.net/62005 Changed paths: MM NEWS AM Zend/tests/bug62005.phpt MM Zend/zend_execute.c Diff: diff --cc NEWS index 3717537,1057db7..a872112 --- a/NEWS +++ b/NEWS @@@ -16,27 -11,19 +16,29 @@@ PH (Laruence) - Core: + . Fixed bug #62005 (unexpected behavior when incrementally assigning to a + member of a null object). (Laruence) + . Fixed bug #61978 (Object recursion not detected for classes that implement +JsonSerializable). (Felipe) . Fixed bug #61730 (Segfault from array_walk modifying an array passed by reference). (Laruence) + . Fixed bug #61922 (ZTS build doesn't accept zend.script_encoding config). +(Laruence) . Fixed missing bound check in iptcparse(). (chris at chiappa.net) - . Fixed bug #61764 ('I' unpacks n as signed if n 2^31-1 on LP64). (Gustavo) + . Fixed bug #61827 (incorrect \e processing on Windows) (Anatoliy) + . Fixed bug #61761 ('Overriding' a private static method with a different +signature causes crash). (Laruence) + . Fixed bug #61728 (PHP crash when calling ob_start in request_shutdown +phase). (Laruence) + . Fixed bug #61660 (bin2hex(hex2bin($data)) != $data). (Nikita Popov) + . Fixed bug #61650 (ini parser crashes when using ${} ini variables +(without apache2)). (Laruence) + . Fixed bug #61605 (header_remove() does not remove all headers). (Laruence) . Fixed bug #54197 ([PATH=] sections incompatibility with user_ini.filename set to null). (Anatoliy) - . Fixed bug #61713 (Logic error in charset detection for htmlentities). -(Anatoliy) . Fixed bug #61991 (long overflow in realpath_cache_get()). (Anatoliy) -- Fileinfo: +- FPM . Fixed bug #61812 (Uninitialised value used in libmagic). (Laruence, Gustavo) diff --cc Zend/tests/bug62005.phpt index 000,4ff4b2c..c99b287 mode 00,100644..100644 --- a/Zend/tests/bug62005.phpt +++ b/Zend/tests/bug62005.phpt @@@ -1,0 -1,15 +1,15 @@@ + --TEST-- + Bug #62005 (unexpected behavior when incrementally assigning to a member of a null object) + --FILE-- + ?php + function add_points($player, $points) { + $player-energy += $points; + print_r($player); + } + add_points(NULL, 2); + --EXPECTF-- -Strict Standards: Creating default object from empty value in %sbug62005.php on line %d ++Warning: Creating default object from empty value in %sbug62005.php on line %d + stdClass Object + ( + [energy] = 2 + ) diff --cc Zend/zend_execute.c index d72fc73,4423921..205531f --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@@ -557,8 -435,7 +557,7 @@@ static inline void make_real_object(zva SEPARATE_ZVAL_IF_NOT_REF(object_ptr); zval_dtor(*object_ptr); object_init(*object_ptr); - zend_error(E_STRICT, Creating default object from empty value); ++ zend_error(E_WARNING, Creating default object from empty value); } } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Fix test failed, the fsockopen will be refused immediately if the server is not set up.: sapi/cli/tests/php_cli_server.inc
Commit:7b2ab569976f63b22ba1c69e78e782a693d5076a Author:Xinchen Hui larue...@php.net Wed, 9 May 2012 11:21:24 +0800 Parents: f46a064760bd99223d8a8aec9df9807bab262022 Branches: PHP-5.4 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=7b2ab569976f63b22ba1c69e78e782a693d5076a Log: Fix test failed, the fsockopen will be refused immediately if the server is not set up. Changed paths: M sapi/cli/tests/php_cli_server.inc Diff: diff --git a/sapi/cli/tests/php_cli_server.inc b/sapi/cli/tests/php_cli_server.inc index d24a679..3479cd0 100644 --- a/sapi/cli/tests/php_cli_server.inc +++ b/sapi/cli/tests/php_cli_server.inc @@ -37,16 +37,14 @@ function php_cli_server_start($code = 'echo Hello world;', $no_router = FALSE) // note: even when server prints 'Listening on localhost:8964...Press Ctrl-C to quit.' // it might not be listening yet...need to wait until fsockopen() call returns - $fp = fsockopen(PHP_CLI_SERVER_HOSTNAME, PHP_CLI_SERVER_PORT); - if ($fp) { - // server will report Unexpected EOF error (socket opened, closed without writing - // anything) but that can be ignored - fclose($fp); - } else { - // test will fail to connect if server doesn't start listening/accepting - // in the next few microseconds - } +$i = 0; +while (($i++ 5) !($fp = @fsockopen(PHP_CLI_SERVER_HOSTNAME, PHP_CLI_SERVER_PORT))) { +usleep(1); +} +if ($fp) { +fclose($fp); +} register_shutdown_function( function($handle) use($router) { @@ -56,7 +54,6 @@ function php_cli_server_start($code = 'echo Hello world;', $no_router = FALSE) $handle ); // don't bother sleeping, server is already up - //usleep(5); // server can take a variable amount of time to be up, so just sleeping a guessed amount of time // does not work. this is why tests sometimes pass and sometimes fail. to get a reliable pass // sleeping doesn't work. -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Implemented FR #61977 (Need CLI web-server support for files with .htm svg extensions): NEWS sapi/cli/php_cli_server.c sapi/cli/tests/bug61977.phpt
Commit:1e60d0c105f065f395b5ae02608eaec9b42708f8 Author:Xinchen Hui larue...@php.net Wed, 9 May 2012 11:27:39 +0800 Parents: 7b2ab569976f63b22ba1c69e78e782a693d5076a Branches: PHP-5.4 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=1e60d0c105f065f395b5ae02608eaec9b42708f8 Log: Implemented FR #61977 (Need CLI web-server support for files with .htm svg extensions) Bugs: https://bugs.php.net/61977 Changed paths: M NEWS M sapi/cli/php_cli_server.c A sapi/cli/tests/bug61977.phpt Diff: diff --git a/NEWS b/NEWS index d989f34..cb00f7a 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,8 @@ PHP NEWS ?? ??? 2012, PHP 5.4.2 - CLI Server: + . Implemented FR #61977 (Need CLI web-server support for files with .htm +svg extensions). (Sixd, Laruence) . Fixed bug #61546 (functions related to current script failed when chdir() in cli sapi). (Laruence, reeze@gmail.com) . Improved performance while sending error page, this also fixed diff --git a/sapi/cli/php_cli_server.c b/sapi/cli/php_cli_server.c index e052aa8..87ab7b4 100644 --- a/sapi/cli/php_cli_server.c +++ b/sapi/cli/php_cli_server.c @@ -251,15 +251,17 @@ static php_cli_server_http_reponse_status_code_pair template_map[] = { }; static php_cli_server_ext_mime_type_pair mime_type_map[] = { + { html, text/html }, + { htm, text/html }, + { js, text/javascript }, + { css, text/css }, { gif, image/gif }, - { png, image/png }, - { jpe, image/jpeg }, { jpg, image/jpeg }, { jpeg, image/jpeg }, - { css, text/css }, - { html, text/html }, + { png, image/png }, + { jpe, image/jpeg }, + { svg, image/svg+xml }, { txt, text/plain }, - { js, text/javascript }, { NULL, NULL } }; diff --git a/sapi/cli/tests/bug61977.phpt b/sapi/cli/tests/bug61977.phpt new file mode 100644 index 000..edb7b78 --- /dev/null +++ b/sapi/cli/tests/bug61977.phpt @@ -0,0 +1,157 @@ +--TEST-- +Bug #60159 (Router returns false, but POST is not passed to requested resource) +--SKIPIF-- +?php +include skipif.inc; +? +--FILE-- +?php +include php_cli_server.inc; +php_cli_server_start('?php ?', true); +$doc_root = __DIR__; + +list($host, $port) = explode(':', PHP_CLI_SERVER_ADDRESS); +$port = intval($port)?:80; + +$fp = fsockopen($host, $port, $errno, $errstr, 0.5); +if (!$fp) { + die(connect failed); +} + +file_put_contents($doc_root . '/foo.html', ''); +if(fwrite($fp, HEADER +GET /foo.html HTTP/1.1 +Host: {$host} + + +HEADER +)) { + while (!feof($fp)) { + $text = fgets($fp); +if (strncasecmp(Content-type:, $text, 13) == 0) { + echo foo.html = , $text; +} + } +} +@unlink($doc_root . '/foo.html'); +fclose($fp); + + +$fp = fsockopen($host, $port, $errno, $errstr, 0.5); +if (!$fp) { + die(connect failed); +} +file_put_contents($doc_root . '/foo.htm', ''); +if(fwrite($fp, HEADER +GET /foo.htm HTTP/1.1 +Host: {$host} + + +HEADER +)) { + while (!feof($fp)) { + $text = fgets($fp); +if (strncasecmp(Content-type:, $text, 13) == 0) { + echo foo.htm = , $text; +} + } +} +@unlink($doc_root . '/foo.htm'); +fclose($fp); + + +$fp = fsockopen($host, $port, $errno, $errstr, 0.5); +if (!$fp) { + die(connect failed); +} +file_put_contents($doc_root . '/foo.svg', ''); +if(fwrite($fp, HEADER +GET /foo.svg HTTP/1.1 +Host: {$host} + + +HEADER +)) { + while (!feof($fp)) { + $text = fgets($fp); +if (strncasecmp(Content-type:, $text, 13) == 0) { + echo foo.svg = , $text; +} + } +} +@unlink($doc_root . '/foo.svg'); +fclose($fp); + +$fp = fsockopen($host, $port, $errno, $errstr, 0.5); +if (!$fp) { + die(connect failed); +} +file_put_contents($doc_root . '/foo.css', ''); +if(fwrite($fp, HEADER +GET /foo.css HTTP/1.1 +Host: {$host} + + +HEADER +)) { + while (!feof($fp)) { + $text = fgets($fp); +if (strncasecmp(Content-type:, $text, 13) == 0) { + echo foo.css = , $text; +} + } +} +@unlink($doc_root . '/foo.css'); +fclose($fp); + +$fp = fsockopen($host, $port, $errno, $errstr, 0.5); +if (!$fp) { + die(connect failed); +} +file_put_contents($doc_root . '/foo.js', ''); +if(fwrite($fp, HEADER +GET /foo.js HTTP/1.1 +Host: {$host} + + +HEADER +)) { + while (!feof($fp)) { + $text = fgets($fp); +if (strncasecmp(Content-type:, $text, 13) == 0) { + echo foo.js = , $text; +} + } +} +@unlink($doc_root . '/foo.js'); +fclose($fp); + +$fp = fsockopen($host, $port, $errno, $errstr, 0.5); +if (!$fp) { + die(connect failed); +} +file_put_contents($doc_root . '/foo.png', ''); +if(fwrite($fp, HEADER +GET /foo.png HTTP/1.1 +Host: {$host} + + +HEADER +)) { + while (!feof($fp)) { + $text = fgets($fp); +if (strncasecmp