del php-src: NEWS Zend/tests/bug63462.phpt Zend/zend_API.h Zend/zend_compile.c Zend/zend_language_parser.y Zend/zend_object_handlers.c
Zend/zend_vm_def.h Zend/zend_vm_execute.h configure.in ext/curl/tes ts/curl_error_basic.phpt ext/date/php_date.c ext/ date/tests/bug55397.phpt
ext/libxml/libxml.c ext/libxml/php_libxml.h ext/mysqlnd/mysqlnd.c ext/mys qlnd/mysqlnd.h ext/mysqlnd/mysqlnd_block_alloc.c ex
t/mysqlnd/mysqlnd_block_alloc.h ext/mysqlnd/mysqln
| From: | Stanislav Malyshev | Date: | Fri, 01 Mar 2013 18:36:09 +0000 |
| Subject: | del php-src: NEWS Zend/tests/bug63462.phpt Zend/zend_API.h Zend/zend_compile.c Zend/zend_language_parser.y Zend/zend_object_handlers.c Zend/zend_vm_def.h Zend/zend_vm_execute.h configure.in ext/curl/tes ts/curl_error_basic.phpt ext/date/php_date.c ext/ date/tests/bug55397.phpt ext/libxml/libxml.c ext/libxml/php_libxml.h ext/mysqlnd/mysqlnd.c ext/mys qlnd/mysqlnd.h ext/mysqlnd/mysqlnd_block_alloc.c ex t/mysqlnd/mysqlnd_block_alloc.h ext/mysqlnd/mysqln |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-71357@lists.php.net to get a copy of this message | ||
Branch: PHP-5.3.23
Deleted commits count: 2
User: Stanislav Malyshev <stas@php.net> Fri, 01 Mar 2013 18:36:09 +0000
Changed paths:
M NEWS
A Zend/tests/bug63462.phpt
M Zend/zend_API.h
M Zend/zend_compile.c
M Zend/zend_language_parser.y
M Zend/zend_object_handlers.c
M Zend/zend_vm_def.h
M Zend/zend_vm_execute.h
M configure.in
M ext/curl/tests/curl_error_basic.phpt
M ext/date/php_date.c
A ext/date/tests/bug55397.phpt
M ext/libxml/libxml.c
M ext/libxml/php_libxml.h
M ext/mysqlnd/mysqlnd.c
M ext/mysqlnd/mysqlnd.h
M ext/mysqlnd/mysqlnd_block_alloc.c
M ext/mysqlnd/mysqlnd_block_alloc.h
M ext/mysqlnd/mysqlnd_charset.c
M ext/mysqlnd/mysqlnd_charset.h
M ext/mysqlnd/mysqlnd_debug.c
M ext/mysqlnd/mysqlnd_debug.h
M ext/mysqlnd/mysqlnd_enum_n_def.h
M ext/mysqlnd/mysqlnd_libmysql_compat.h
M ext/mysqlnd/mysqlnd_loaddata.c
M ext/mysqlnd/mysqlnd_net.c
M ext/mysqlnd/mysqlnd_net.h
M ext/mysqlnd/mysqlnd_priv.h
M ext/mysqlnd/mysqlnd_ps.c
M ext/mysqlnd/mysqlnd_ps_codec.c
M ext/mysqlnd/mysqlnd_result.c
M ext/mysqlnd/mysqlnd_result.h
M ext/mysqlnd/mysqlnd_result_meta.c
M ext/mysqlnd/mysqlnd_result_meta.h
M ext/mysqlnd/mysqlnd_statistics.c
M ext/mysqlnd/mysqlnd_statistics.h
M ext/mysqlnd/mysqlnd_structs.h
M ext/mysqlnd/mysqlnd_wireprotocol.c
M ext/mysqlnd/mysqlnd_wireprotocol.h
M ext/mysqlnd/php_mysqlnd.c
M ext/mysqlnd/php_mysqlnd.h
M ext/phar/dirstream.c
M ext/phar/dirstream.h
M ext/phar/func_interceptors.c
M ext/phar/func_interceptors.h
M ext/phar/phar.c
M ext/phar/phar_internal.h
M ext/phar/phar_object.c
M ext/phar/phar_path_check.c
M ext/phar/phar_path_check.re
M ext/phar/pharzip.h
M ext/phar/php_phar.h
M ext/phar/stream.c
M ext/phar/stream.h
M ext/phar/stub.h
M ext/phar/tar.c
M ext/phar/tar.h
M ext/phar/util.c
M ext/phar/zip.c
M ext/soap/php_xml.c
M ext/soap/soap.c
M ext/spl/spl_array.c
M ext/spl/spl_directory.c
M ext/spl/spl_fixedarray.c
A ext/spl/tests/bug52861.phpt
A ext/spl/tests/bug64023.phpt
A ext/spl/tests/bug64106.phpt
A ext/spl/tests/bug64228.phpt
A ext/spl/tests/bug64264.phpt
M ext/standard/string.c
M ext/standard/tests/network/http-stream.phpt
A ext/standard/tests/strings/bug63943.phpt
M ext/standard/tests/strings/strpos.phpt
M main/php_version.h
M sapi/fpm/fpm/fpm_sockets.h
M win32/build/libs_version.txt
M win32/registry.c
diff --git b/NEWS a/NEWS index 9d09aab..5f19e6d 100644 --- b/NEWS +++ a/NEWS @@ -1,5 +1,39 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| +28 Feb 2013, PHP 5.3.23RC1 + +- SPL: + . Fixed bug #64264 (SPLFixedArray toArray problem). (Laruence) + . Fixed bug #64228 (RecursiveDirectoryIterator always assumes SKIP_DOTS). + (patch by kriss@krizalys.com, Laruence) + . Fixed bug #52861 (unset fails with ArrayObject and deep arrays). + (Mike Willbanks) + +21 Feb 2013, PHP 5.3.22 + +- Zend Engine: + . Fixed bug #64099 (Wrong TSRM usage in zend_Register_class alias). (Johannes) + . Fixed bug #63899 (Use after scope error in zend_compile). (Laruence) + +- Core + . Fixed bug #63943 (Bad warning text from strpos() on empty needle). + (Laruence) + +- Date: + . Fixed bug #55397 (comparsion of incomplete DateTime causes SIGSEGV). + (Laruence, Derick) + +- FPM: + . Fixed bug #63999 (php with fpm fails to build on Solaris 10 or 11). (Adam) + +- SOAP + . Added check that soap.wsdl_cache_dir conforms to open_basedir + (CVE-2013-1635). (Dmitry) + . Disabled external entities loading (CVE-2013-1643). (Dmitry) + +- SPL: + . Fixed bug #64106 (Segfault on SplFixedArray[][x] = y when extended). (Nikita Popov) + 17 Jan 2013, PHP 5.3.21 - Zend Engine: diff --git b/Zend/tests/bug63462.phpt a/Zend/tests/bug63462.phpt new file mode 100644 index 0000000..e936a6f --- /dev/null +++ a/Zend/tests/bug63462.phpt @@ -0,0 +1,74 @@ +--TEST-- +Test script to verify that magic methods should be called only once when accessing an unset property. +--CREDITS-- +Marco Pivetta <ocramius@gmail.com> +--FILE-- +<?php +class Test { + public $publicProperty; + protected $protectedProperty; + private $privateProperty; + + public function __construct() { + unset( + $this->publicProperty, + $this->protectedProperty, + $this->privateProperty + ); + } + + function __get($name) { + echo '__get ' . $name . "\n"; + return $this->$name; + } + + function __set($name, $value) { + echo '__set ' . $name . "\n"; + $this->$name = $value; + } + + function __isset($name) { + echo '__isset ' . $name . "\n"; + return isset($this->$name); + } +} + +$test = new Test(); + +$test->nonExisting; +$test->publicProperty; +$test->protectedProperty; +$test->privateProperty; +isset($test->nonExisting); +isset($test->publicProperty); +isset($test->protectedProperty); +isset($test->privateProperty); +$test->nonExisting = 'value'; +$test->publicProperty = 'value'; +$test->protectedProperty = 'value'; +$test->privateProperty = 'value'; + +?> + +--EXPECTF-- +__get nonExisting + +Notice: Undefined property: Test::$nonExisting in %s on line %d +__get publicProperty + +Notice: Undefined property: Test::$publicProperty in %s on line %d +__get protectedProperty + +Notice: Undefined property: Test::$protectedProperty in %s on line %d +__get privateProperty + +Notice: Undefined property: Test::$privateProperty in %s on line %d +__isset nonExisting +__isset publicProperty +__isset protectedProperty +__isset privateProperty +__set nonExisting +__set publicProperty +__set protectedProperty +__set privateProperty + diff --git b/Zend/zend_API.h a/Zend/zend_API.h index 05170f2..f6f2c46 100644 --- b/Zend/zend_API.h +++ a/Zend/zend_API.h @@ -268,9 +268,9 @@ ZEND_API void zend_class_implements(zend_class_entry *class_entry TSRMLS_DC, int ZEND_API int zend_register_class_alias_ex(const char *name, int name_len, zend_class_entry *ce TSRMLS_DC); #define zend_register_class_alias(name, ce) \ - zend_register_class_alias_ex(name, sizeof(name)-1, ce TSRMLS_DC) + zend_register_class_alias_ex(name, sizeof(name)-1, ce TSRMLS_CC) #define zend_register_ns_class_alias(ns, name, ce) \ - zend_register_class_alias_ex(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name))-1, ce TSRMLS_DC) + zend_register_class_alias_ex(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name))-1, ce TSRMLS_CC) ZEND_API int zend_disable_function(char *function_name, uint function_name_length TSRMLS_DC); ZEND_API int zend_disable_class(char *class_name, uint class_name_length TSRMLS_DC); diff --git b/Zend/zend_compile.c a/Zend/zend_compile.c index 7725fb7..8382b48 100644 --- b/Zend/zend_compile.c +++ a/Zend/zend_compile.c @@ -3414,10 +3414,11 @@ void zend_do_begin_class_declaration(const znode *class_token, znode *class_name /* Prefix class name with name of current namespace */ znode tmp; + tmp.op_type = IS_CONST; tmp.u.constant = *CG(current_namespace); zval_copy_ctor(&tmp.u.constant); zend_do_build_namespace_name(&tmp, &tmp, class_name TSRMLS_CC); - class_name = &tmp; + *class_name = tmp; efree(lcname); lcname = zend_str_tolower_dup(Z_STRVAL(class_name->u.constant), Z_STRLEN(class_name->u.constant)); } @@ -3529,7 +3530,7 @@ void zend_do_end_class_declaration(const znode *class_token, const znode *parent ce->line_end = zend_get_compiled_lineno(TSRMLS_C); if (!(ce->ce_flags & (ZEND_ACC_INTERFACE|ZEND_ACC_EXPLICIT_ABSTRACT_CLASS)) - && ((parent_token->op_type != IS_UNUSED) || (ce->num_interfaces > 0))) { + && (parent_token || (ce->num_interfaces > 0))) { zend_verify_abstract_class(ce TSRMLS_CC); if (ce->num_interfaces) { do_verify_abstract_class(TSRMLS_C); diff --git b/Zend/zend_language_parser.y a/Zend/zend_language_parser.y index 2533f60..d24fc9c 100644 --- b/Zend/zend_language_parser.y +++ a/Zend/zend_language_parser.y @@ -316,13 +316,13 @@ unticked_class_declaration_statement: implements_list '{' class_statement_list - '}' { zend_do_end_class_declaration(&$1, &$2 TSRMLS_CC); } + '}' { zend_do_end_class_declaration(&$1, &$3 TSRMLS_CC); } | interface_entry T_STRING { zend_do_begin_class_declaration(&$1, &$2, NULL TSRMLS_CC); } interface_extends_list '{' class_statement_list - '}' { zend_do_end_class_declaration(&$1, &$2 TSRMLS_CC); } + '}' { zend_do_end_class_declaration(&$1, NULL TSRMLS_CC); } ; diff --git b/Zend/zend_object_handlers.c a/Zend/zend_object_handlers.c index cbd64c9..a42669f 100644 --- b/Zend/zend_object_handlers.c +++ a/Zend/zend_object_handlers.c @@ -296,6 +296,16 @@ static int zend_get_property_guard(zend_object *zobj, zend_property_info *proper info.name = Z_STRVAL_P(member); info.name_length = Z_STRLEN_P(member); info.h = zend_get_hash_value(Z_STRVAL_P(member), Z_STRLEN_P(member) + 1); + } else if(property_info->name[0] == '\0'){ + const char *class_name = NULL, *prop_name = NULL; + zend_unmangle_property_name(property_info->name, property_info->name_length, &class_name, &prop_name); + if(class_name) { + /* use unmangled name for protected properties */ + info.name = prop_name; + info.name_length = strlen(prop_name); + info.h = zend_get_hash_value(info.name, info.name_length+1); + property_info = &info; + } } if (!zobj->guards) { ALLOC_HASHTABLE(zobj->guards); diff --git b/Zend/zend_vm_def.h a/Zend/zend_vm_def.h index 3fa5327..e8d3250 100644 --- b/Zend/zend_vm_def.h +++ a/Zend/zend_vm_def.h @@ -896,23 +896,12 @@ ZEND_VM_HANDLER(40, ZEND_ECHO, CONST|TMP|VAR|CV, ANY) { zend_op *opline = EX(opline); zend_free_op free_op1; - zval z_copy; zval *z = GET_OP1_ZVAL_PTR(BP_VAR_R); - if (OP1_TYPE != IS_CONST && - Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get_method != NULL) { - if (OP1_TYPE == IS_TMP_VAR) { - INIT_PZVAL(z); - } - if (zend_std_cast_object_tostring(z, &z_copy, IS_STRING TSRMLS_CC) == SUCCESS) { - zend_print_variable(&z_copy); - zval_dtor(&z_copy); - } else { - zend_print_variable(z); - } - } else { - zend_print_variable(z); + if (OP1_TYPE == IS_TMP_VAR && Z_TYPE_P(z) == IS_OBJECT) { + INIT_PZVAL(z); } + zend_print_variable(z); FREE_OP1(); ZEND_VM_NEXT_OPCODE(); diff --git b/Zend/zend_vm_execute.h a/Zend/zend_vm_execute.h index 1ad7f77..f5cedd8 100644 --- b/Zend/zend_vm_execute.h +++ a/Zend/zend_vm_execute.h @@ -1320,23 +1320,12 @@ static int ZEND_FASTCALL ZEND_ECHO_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { zend_op *opline = EX(opline); - zval z_copy; zval *z = &opline->op1.u.constant; - if (IS_CONST != IS_CONST && - Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get_method != NULL) { - if (IS_CONST == IS_TMP_VAR) { - INIT_PZVAL(z); - } - if (zend_std_cast_object_tostring(z, &z_copy, IS_STRING TSRMLS_CC) == SUCCESS) { - zend_print_variable(&z_copy); - zval_dtor(&z_copy); - } else { - zend_print_variable(z); - } - } else { - zend_print_variable(z); + if (IS_CONST == IS_TMP_VAR && Z_TYPE_P(z) == IS_OBJECT) { + INIT_PZVAL(z); } + zend_print_variable(z); ZEND_VM_NEXT_OPCODE(); } @@ -4635,23 +4624,12 @@ static int ZEND_FASTCALL ZEND_ECHO_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { zend_op *opline = EX(opline); zend_free_op free_op1; - zval z_copy; zval *z = _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - if (IS_TMP_VAR != IS_CONST && - Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get_method != NULL) { - if (IS_TMP_VAR == IS_TMP_VAR) { - INIT_PZVAL(z); - } - if (zend_std_cast_object_tostring(z, &z_copy, IS_STRING TSRMLS_CC) == SUCCESS) { - zend_print_variable(&z_copy); - zval_dtor(&z_copy); - } else { - zend_print_variable(z); - } - } else { - zend_print_variable(z); + if (IS_TMP_VAR == IS_TMP_VAR && Z_TYPE_P(z) == IS_OBJECT) { + INIT_PZVAL(z); } + zend_print_variable(z); zval_dtor(free_op1.var); ZEND_VM_NEXT_OPCODE(); @@ -7898,23 +7876,12 @@ static int ZEND_FASTCALL ZEND_ECHO_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { zend_op *opline = EX(opline); zend_free_op free_op1; - zval z_copy; zval *z = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - if (IS_VAR != IS_CONST && - Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get_method != NULL) { - if (IS_VAR == IS_TMP_VAR) { - INIT_PZVAL(z); - } - if (zend_std_cast_object_tostring(z, &z_copy, IS_STRING TSRMLS_CC) == SUCCESS) { - zend_print_variable(&z_copy); - zval_dtor(&z_copy); - } else { - zend_print_variable(z); - } - } else { - zend_print_variable(z); + if (IS_VAR == IS_TMP_VAR && Z_TYPE_P(z) == IS_OBJECT) { + INIT_PZVAL(z); } + zend_print_variable(z); if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; ZEND_VM_NEXT_OPCODE(); @@ -21823,23 +21790,12 @@ static int ZEND_FASTCALL ZEND_ECHO_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { zend_op *opline = EX(opline); - zval z_copy; zval *z = _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); - if (IS_CV != IS_CONST && - Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get_method != NULL) { - if (IS_CV == IS_TMP_VAR) { - INIT_PZVAL(z); - } - if (zend_std_cast_object_tostring(z, &z_copy, IS_STRING TSRMLS_CC) == SUCCESS) { - zend_print_variable(&z_copy); - zval_dtor(&z_copy); - } else { - zend_print_variable(z); - } - } else { - zend_print_variable(z); + if (IS_CV == IS_TMP_VAR && Z_TYPE_P(z) == IS_OBJECT) { + INIT_PZVAL(z); } + zend_print_variable(z); ZEND_VM_NEXT_OPCODE(); } diff --git b/configure.in a/configure.in index 9677c18..c461df2 100644 --- b/configure.in +++ a/configure.in @@ -41,8 +41,8 @@ AC_CONFIG_HEADER(main/php_config.h) PHP_MAJOR_VERSION=5 PHP_MINOR_VERSION=3 -PHP_RELEASE_VERSION=21 -PHP_EXTRA_VERSION="" +PHP_RELEASE_VERSION=23 +PHP_EXTRA_VERSION="RC1" PHP_VERSION="$PHP_MAJOR_VERSION.$PHP_MINOR_VERSION.$PHP_RELEASE_VERSION$PHP_EXTRA_VERSION" PHP_VERSION_ID=`expr [$]PHP_MAJOR_VERSION \* 10000 + [$]PHP_MINOR_VERSION \* 100 + [$]PHP_RELEASE_VERSION` diff --git b/ext/curl/tests/curl_error_basic.phpt a/ext/curl/tests/curl_error_basic.phpt index bd01847..3d35023 100644 --- b/ext/curl/tests/curl_error_basic.phpt +++ a/ext/curl/tests/curl_error_basic.phpt @@ -38,4 +38,4 @@ curl_close($ch); ?> --EXPECTF-- == Testing curl_error with a fake URL == -string(%d) "%sfakeURL%s" +string(%d) "%sfakeURL%S" diff --git b/ext/date/php_date.c a/ext/date/php_date.c index 2b4b4b5..2e616b1 100644 --- b/ext/date/php_date.c +++ a/ext/date/php_date.c @@ -2079,7 +2079,11 @@ static int date_object_compare_date(zval *d1, zval *d2 TSRMLS_DC) instanceof_function(Z_OBJCE_P(d2), date_ce_date TSRMLS_CC)) { php_date_obj *o1 = zend_object_store_get_object(d1 TSRMLS_CC); php_date_obj *o2 = zend_object_store_get_object(d2 TSRMLS_CC); - + + if (!o1->time || !o2->time) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Trying to compare an incomplete DateTime object"); + return 1; + } if (!o1->time->sse_uptodate) { timelib_update_ts(o1->time, o1->time->tz_info); } diff --git b/ext/date/tests/bug55397.phpt a/ext/date/tests/bug55397.phpt new file mode 100644 index 0000000..efc09b5 --- /dev/null +++ a/ext/date/tests/bug55397.phpt @@ -0,0 +1,11 @@ +--TEST-- +Bug #55397 (comparsion of incomplete DateTime causes SIGSEGV) +--INI-- +--FILE-- +<?php +date_default_timezone_set('Europe/Prague'); +var_dump(unserialize('O:8:"DateTime":0:{}') == new DateTime); +?> +--EXPECTF-- +Warning: %s: Trying to compare an incomplete DateTime object in %s on line %d +bool(false) diff --git b/ext/libxml/libxml.c a/ext/libxml/libxml.c index 5db1f31..920a90c 100644 --- b/ext/libxml/libxml.c +++ a/ext/libxml/libxml.c @@ -261,6 +261,7 @@ static PHP_GINIT_FUNCTION(libxml) libxml_globals->stream_context = NULL; libxml_globals->error_buffer.c = NULL; libxml_globals->error_list = NULL; + libxml_globals->entity_loader_disabled = 0; } /* Channel libxml file io layer through the PHP streams subsystem. @@ -348,16 +349,15 @@ static int php_libxml_streams_IO_close(void *context) } static xmlParserInputBufferPtr -php_libxml_input_buffer_noload(const char *URI, xmlCharEncoding enc) -{ - return NULL; -} - -static xmlParserInputBufferPtr php_libxml_input_buffer_create_filename(const char *URI, xmlCharEncoding enc) { xmlParserInputBufferPtr ret; void *context = NULL; + TSRMLS_FETCH(); + + if (LIBXML(entity_loader_disabled)) { + return NULL; + } if (URI == NULL) return(NULL); @@ -834,28 +834,25 @@ static PHP_FUNCTION(libxml_clear_errors) } /* }}} */ +PHP_LIBXML_API zend_bool php_libxml_disable_entity_loader(zend_bool disable TSRMLS_DC) +{ + zend_bool old = LIBXML(entity_loader_disabled); + + LIBXML(entity_loader_disabled) = disable; + return old; +} + /* {{{ proto bool libxml_disable_entity_loader([boolean disable]) Disable/Enable ability to load external entities */ static PHP_FUNCTION(libxml_disable_entity_loader) { zend_bool disable = 1; - xmlParserInputBufferCreateFilenameFunc old; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &disable) == FAILURE) { return; } - if (disable == 0) { - old = xmlParserInputBufferCreateFilenameDefault(php_libxml_input_buffer_create_filename); - } else { - old = xmlParserInputBufferCreateFilenameDefault(php_libxml_input_buffer_noload); - } - - if (old == php_libxml_input_buffer_noload) { - RETURN_TRUE; - } - - RETURN_FALSE; + RETURN_BOOL(php_libxml_disable_entity_loader(disable TSRMLS_CC)); } /* }}} */ diff --git b/ext/libxml/php_libxml.h a/ext/libxml/php_libxml.h index 91a6d24..a7d8466 100644 --- b/ext/libxml/php_libxml.h +++ a/ext/libxml/php_libxml.h @@ -43,6 +43,7 @@ ZEND_BEGIN_MODULE_GLOBALS(libxml) zval *stream_context; smart_str error_buffer; zend_llist *error_list; + zend_bool entity_loader_disabled; ZEND_END_MODULE_GLOBALS(libxml) typedef struct _libxml_doc_props { @@ -93,6 +94,7 @@ PHP_LIBXML_API void php_libxml_ctx_error(void *ctx, const char *msg, ...); PHP_LIBXML_API int php_libxml_xmlCheckUTF8(const unsigned char *s); PHP_LIBXML_API zval *php_libxml_switch_context(zval *context TSRMLS_DC); PHP_LIBXML_API void php_libxml_issue_error(int level, const char *msg TSRMLS_DC); +PHP_LIBXML_API zend_bool php_libxml_disable_entity_loader(zend_bool disable TSRMLS_DC); /* Init/shutdown functions*/ PHP_LIBXML_API void php_libxml_initialize(void); diff --git b/ext/mysqlnd/mysqlnd.c a/ext/mysqlnd/mysqlnd.c index b539c51..20bab91 100644 --- b/ext/mysqlnd/mysqlnd.c +++ a/ext/mysqlnd/mysqlnd.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2012 The PHP Group | + | Copyright (c) 2006-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -691,6 +691,8 @@ MYSQLND_METHOD(mysqlnd_conn, connect)(MYSQLND * conn, mysql_flags |= CLIENT_LOCAL_FILES | CLIENT_PS_MULTI_RESULTS; mysql_flags |= MYSQLND_CAPABILITIES; + mysql_flags |= conn->options.flags; /* use the flags from set_client_option() */ + if (db) { mysql_flags |= CLIENT_CONNECT_WITH_DB; } diff --git b/ext/mysqlnd/mysqlnd.h a/ext/mysqlnd/mysqlnd.h index 65fe78e..731e5b8 100644 --- b/ext/mysqlnd/mysqlnd.h +++ a/ext/mysqlnd/mysqlnd.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2012 The PHP Group | + | Copyright (c) 2006-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git b/ext/mysqlnd/mysqlnd_block_alloc.c a/ext/mysqlnd/mysqlnd_block_alloc.c index b78efff..b9d7887 100644 --- b/ext/mysqlnd/mysqlnd_block_alloc.c +++ a/ext/mysqlnd/mysqlnd_block_alloc.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2012 The PHP Group | + | Copyright (c) 2006-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git b/ext/mysqlnd/mysqlnd_block_alloc.h a/ext/mysqlnd/mysqlnd_block_alloc.h index e2cf60f..39ccbdc 100644 --- b/ext/mysqlnd/mysqlnd_block_alloc.h +++ a/ext/mysqlnd/mysqlnd_block_alloc.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2012 The PHP Group | + | Copyright (c) 2006-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git b/ext/mysqlnd/mysqlnd_charset.c a/ext/mysqlnd/mysqlnd_charset.c index 704c119..2b477db 100644 --- b/ext/mysqlnd/mysqlnd_charset.c +++ a/ext/mysqlnd/mysqlnd_charset.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2012 The PHP Group | + | Copyright (c) 2006-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git b/ext/mysqlnd/mysqlnd_charset.h a/ext/mysqlnd/mysqlnd_charset.h index 2f5d1db..e71157a 100644 --- b/ext/mysqlnd/mysqlnd_charset.h +++ a/ext/mysqlnd/mysqlnd_charset.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2012 The PHP Group | + | Copyright (c) 2006-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git b/ext/mysqlnd/mysqlnd_debug.c a/ext/mysqlnd/mysqlnd_debug.c index 66f6466..0947d00 100644 --- b/ext/mysqlnd/mysqlnd_debug.c +++ a/ext/mysqlnd/mysqlnd_debug.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2012 The PHP Group | + | Copyright (c) 2006-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git b/ext/mysqlnd/mysqlnd_debug.h a/ext/mysqlnd/mysqlnd_debug.h index 01d9e89..a8bf680 100644 --- b/ext/mysqlnd/mysqlnd_debug.h +++ a/ext/mysqlnd/mysqlnd_debug.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2012 The PHP Group | + | Copyright (c) 2006-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git b/ext/mysqlnd/mysqlnd_enum_n_def.h a/ext/mysqlnd/mysqlnd_enum_n_def.h index 6dfb0aa..10deb03 100644 --- b/ext/mysqlnd/mysqlnd_enum_n_def.h +++ a/ext/mysqlnd/mysqlnd_enum_n_def.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2012 The PHP Group | + | Copyright (c) 2006-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git b/ext/mysqlnd/mysqlnd_libmysql_compat.h a/ext/mysqlnd/mysqlnd_libmysql_compat.h index c95539b..c967fb3 100644 --- b/ext/mysqlnd/mysqlnd_libmysql_compat.h +++ a/ext/mysqlnd/mysqlnd_libmysql_compat.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2012 The PHP Group | + | Copyright (c) 2006-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git b/ext/mysqlnd/mysqlnd_loaddata.c a/ext/mysqlnd/mysqlnd_loaddata.c index 557caa2..b980c81 100644 --- b/ext/mysqlnd/mysqlnd_loaddata.c +++ a/ext/mysqlnd/mysqlnd_loaddata.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2012 The PHP Group | + | Copyright (c) 2006-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git b/ext/mysqlnd/mysqlnd_net.c a/ext/mysqlnd/mysqlnd_net.c index e801928..512c844 100644 --- b/ext/mysqlnd/mysqlnd_net.c +++ a/ext/mysqlnd/mysqlnd_net.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2012 The PHP Group | + | Copyright (c) 2006-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git b/ext/mysqlnd/mysqlnd_net.h a/ext/mysqlnd/mysqlnd_net.h index d4077ae..4c20111 100644 --- b/ext/mysqlnd/mysqlnd_net.h +++ a/ext/mysqlnd/mysqlnd_net.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2012 The PHP Group | + | Copyright (c) 2006-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git b/ext/mysqlnd/mysqlnd_priv.h a/ext/mysqlnd/mysqlnd_priv.h index 52600a4..336e73a 100644 --- b/ext/mysqlnd/mysqlnd_priv.h +++ a/ext/mysqlnd/mysqlnd_priv.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2012 The PHP Group | + | Copyright (c) 2006-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git b/ext/mysqlnd/mysqlnd_ps.c a/ext/mysqlnd/mysqlnd_ps.c index d762689..c553aa5 100644 --- b/ext/mysqlnd/mysqlnd_ps.c +++ a/ext/mysqlnd/mysqlnd_ps.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2012 The PHP Group | + | Copyright (c) 2006-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git b/ext/mysqlnd/mysqlnd_ps_codec.c a/ext/mysqlnd/mysqlnd_ps_codec.c index 8e1db9b..eb4b32c 100644 --- b/ext/mysqlnd/mysqlnd_ps_codec.c +++ a/ext/mysqlnd/mysqlnd_ps_codec.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2012 The PHP Group | + | Copyright (c) 2006-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git b/ext/mysqlnd/mysqlnd_result.c a/ext/mysqlnd/mysqlnd_result.c index f238cc4..884de8b 100644 --- b/ext/mysqlnd/mysqlnd_result.c +++ a/ext/mysqlnd/mysqlnd_result.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2012 The PHP Group | + | Copyright (c) 2006-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git b/ext/mysqlnd/mysqlnd_result.h a/ext/mysqlnd/mysqlnd_result.h index 658db74..afddab4 100644 --- b/ext/mysqlnd/mysqlnd_result.h +++ a/ext/mysqlnd/mysqlnd_result.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2012 The PHP Group | + | Copyright (c) 2006-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git b/ext/mysqlnd/mysqlnd_result_meta.c a/ext/mysqlnd/mysqlnd_result_meta.c index f19bc02..23663a2 100644 --- b/ext/mysqlnd/mysqlnd_result_meta.c +++ a/ext/mysqlnd/mysqlnd_result_meta.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2012 The PHP Group | + | Copyright (c) 2006-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git b/ext/mysqlnd/mysqlnd_result_meta.h a/ext/mysqlnd/mysqlnd_result_meta.h index cf45b88..1ebbabd 100644 --- b/ext/mysqlnd/mysqlnd_result_meta.h +++ a/ext/mysqlnd/mysqlnd_result_meta.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2012 The PHP Group | + | Copyright (c) 2006-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git b/ext/mysqlnd/mysqlnd_statistics.c a/ext/mysqlnd/mysqlnd_statistics.c index 55eb0d1..eaabaa6 100644 --- b/ext/mysqlnd/mysqlnd_statistics.c +++ a/ext/mysqlnd/mysqlnd_statistics.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2012 The PHP Group | + | Copyright (c) 2006-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git b/ext/mysqlnd/mysqlnd_statistics.h a/ext/mysqlnd/mysqlnd_statistics.h index 9a5e31c..4c10501 100644 --- b/ext/mysqlnd/mysqlnd_statistics.h +++ a/ext/mysqlnd/mysqlnd_statistics.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2012 The PHP Group | + | Copyright (c) 2006-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git b/ext/mysqlnd/mysqlnd_structs.h a/ext/mysqlnd/mysqlnd_structs.h index 1a6b790..6c093ce 100644 --- b/ext/mysqlnd/mysqlnd_structs.h +++ a/ext/mysqlnd/mysqlnd_structs.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2012 The PHP Group | + | Copyright (c) 2006-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git b/ext/mysqlnd/mysqlnd_wireprotocol.c a/ext/mysqlnd/mysqlnd_wireprotocol.c index ec0ff49..d78191a 100644 --- b/ext/mysqlnd/mysqlnd_wireprotocol.c +++ a/ext/mysqlnd/mysqlnd_wireprotocol.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2012 The PHP Group | + | Copyright (c) 2006-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git b/ext/mysqlnd/mysqlnd_wireprotocol.h a/ext/mysqlnd/mysqlnd_wireprotocol.h index be14e09..34e79d0 100644 --- b/ext/mysqlnd/mysqlnd_wireprotocol.h +++ a/ext/mysqlnd/mysqlnd_wireprotocol.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2012 The PHP Group | + | Copyright (c) 2006-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git b/ext/mysqlnd/php_mysqlnd.c a/ext/mysqlnd/php_mysqlnd.c index 5863244..77880ed 100644 --- b/ext/mysqlnd/php_mysqlnd.c +++ a/ext/mysqlnd/php_mysqlnd.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2012 The PHP Group | + | Copyright (c) 2006-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git b/ext/mysqlnd/php_mysqlnd.h a/ext/mysqlnd/php_mysqlnd.h index 5e7a5e5..d07700e 100644 --- b/ext/mysqlnd/php_mysqlnd.h +++ a/ext/mysqlnd/php_mysqlnd.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2012 The PHP Group | + | Copyright (c) 2006-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git b/ext/phar/dirstream.c a/ext/phar/dirstream.c index a1c5b09..277d058 100644 --- b/ext/phar/dirstream.c +++ a/ext/phar/dirstream.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | phar:// stream wrapper support | +----------------------------------------------------------------------+ - | Copyright (c) 2005-2012 The PHP Group | + | Copyright (c) 2005-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git b/ext/phar/dirstream.h a/ext/phar/dirstream.h index c5fe18b..9b07c9d 100644 --- b/ext/phar/dirstream.h +++ a/ext/phar/dirstream.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | phar php single-file executable PHP extension | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2012 The PHP Group | + | Copyright (c) 2006-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git b/ext/phar/func_interceptors.c a/ext/phar/func_interceptors.c index 2e0739e..7812274 100644 --- b/ext/phar/func_interceptors.c +++ a/ext/phar/func_interceptors.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | phar php single-file executable PHP extension | +----------------------------------------------------------------------+ - | Copyright (c) 2005-2012 The PHP Group | + | Copyright (c) 2005-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git b/ext/phar/func_interceptors.h a/ext/phar/func_interceptors.h index 3afba31..59d6bf6 100644 --- b/ext/phar/func_interceptors.h +++ a/ext/phar/func_interceptors.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | phar php single-file executable PHP extension | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2012 The PHP Group | + | Copyright (c) 2006-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git b/ext/phar/phar.c a/ext/phar/phar.c index 7b7d559..21d7630 100644 --- b/ext/phar/phar.c +++ a/ext/phar/phar.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | phar php single-file executable PHP extension | +----------------------------------------------------------------------+ - | Copyright (c) 2005-2012 The PHP Group | + | Copyright (c) 2005-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git b/ext/phar/phar_internal.h a/ext/phar/phar_internal.h index bd50bb9..d9523b5 100644 --- b/ext/phar/phar_internal.h +++ a/ext/phar/phar_internal.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | phar php single-file executable PHP extension | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2012 The PHP Group | + | Copyright (c) 2006-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git b/ext/phar/phar_object.c a/ext/phar/phar_object.c index d19f30c..eb6b4cf 100644 --- b/ext/phar/phar_object.c +++ a/ext/phar/phar_object.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | phar php single-file executable PHP extension | +----------------------------------------------------------------------+ - | Copyright (c) 2005-2012 The PHP Group | + | Copyright (c) 2005-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git b/ext/phar/phar_path_check.c a/ext/phar/phar_path_check.c index 01e8c79..11f52bb 100644 --- b/ext/phar/phar_path_check.c +++ a/ext/phar/phar_path_check.c @@ -4,7 +4,7 @@ +----------------------------------------------------------------------+ | phar php single-file executable PHP extension | +----------------------------------------------------------------------+ - | Copyright (c) 2007-2012 The PHP Group | + | Copyright (c) 2007-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git b/ext/phar/phar_path_check.re a/ext/phar/phar_path_check.re index 6141da0..e43b3f8 100644 --- b/ext/phar/phar_path_check.re +++ a/ext/phar/phar_path_check.re @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | phar php single-file executable PHP extension | +----------------------------------------------------------------------+ - | Copyright (c) 2007-2012 The PHP Group | + | Copyright (c) 2007-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git b/ext/phar/pharzip.h a/ext/phar/pharzip.h index 4937e57..9c088d3 100644 --- b/ext/phar/pharzip.h +++ a/ext/phar/pharzip.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | phar php single-file executable PHP extension | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2012 The PHP Group | + | Copyright (c) 2006-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git b/ext/phar/php_phar.h a/ext/phar/php_phar.h index e34d51c..a6d7bff 100644 --- b/ext/phar/php_phar.h +++ a/ext/phar/php_phar.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | phar php single-file executable PHP extension | +----------------------------------------------------------------------+ - | Copyright (c) 2005-2012 The PHP Group | + | Copyright (c) 2005-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git b/ext/phar/stream.c a/ext/phar/stream.c index ccfe2a5..0831b02 100644 --- b/ext/phar/stream.c +++ a/ext/phar/stream.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | phar:// stream wrapper support | +----------------------------------------------------------------------+ - | Copyright (c) 2005-2012 The PHP Group | + | Copyright (c) 2005-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -458,8 +458,11 @@ static int phar_stream_flush(php_stream *stream TSRMLS_DC) /* {{{ */ { char *error; int ret; - if (stream->mode[0] == 'w' || (stream->mode[0] == 'r' && stream->mode[1] == '+')) { - ret = phar_flush(((phar_entry_data *)stream->abstract)->phar, 0, 0, 0, &error TSRMLS_CC); + phar_entry_data *data = (phar_entry_data *) stream->abstract; + + if (data->internal_file->is_modified) { + data->internal_file->timestamp = time(0); + ret = phar_flush(data->phar, 0, 0, 0, &error TSRMLS_CC); if (error) { php_stream_wrapper_log_error(stream->wrapper, REPORT_ERRORS TSRMLS_CC, "%s", error); efree(error); diff --git b/ext/phar/stream.h a/ext/phar/stream.h index 6fdc20e..b22b67a 100644 --- b/ext/phar/stream.h +++ a/ext/phar/stream.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | phar php single-file executable PHP extension | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2012 The PHP Group | + | Copyright (c) 2006-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git b/ext/phar/stub.h a/ext/phar/stub.h index 3bb12c0..daafa39 100644 --- b/ext/phar/stub.h +++ a/ext/phar/stub.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | phar php single-file executable PHP extension generated stub | +----------------------------------------------------------------------+ - | Copyright (c) 2005-2012 The PHP Group | + | Copyright (c) 2005-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git b/ext/phar/tar.c a/ext/phar/tar.c index 43d1ede..f170335 100644 --- b/ext/phar/tar.c +++ a/ext/phar/tar.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | TAR archive support for Phar | +----------------------------------------------------------------------+ - | Copyright (c) 2005-2012 The PHP Group | + | Copyright (c) 2005-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git b/ext/phar/tar.h a/ext/phar/tar.h index ed99346..8bfc381 100644 --- b/ext/phar/tar.h +++ a/ext/phar/tar.h @@ -4,7 +4,7 @@ +----------------------------------------------------------------------+ | TAR archive support for Phar | +----------------------------------------------------------------------+ - | Copyright (c) 2005-2012 The PHP Group | + | Copyright (c) 2005-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git b/ext/phar/util.c a/ext/phar/util.c index 08faaa6..4f36478 100644 --- b/ext/phar/util.c +++ a/ext/phar/util.c @@ -3,7 +3,7 @@ | phar php single-file executable PHP extension | | utility functions | +----------------------------------------------------------------------+ - | Copyright (c) 2005-2012 The PHP Group | + | Copyright (c) 2005-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git b/ext/phar/zip.c a/ext/phar/zip.c index 3372622..33732fb 100644 --- b/ext/phar/zip.c +++ a/ext/phar/zip.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | ZIP archive support for Phar | +----------------------------------------------------------------------+ - | Copyright (c) 2007-2012 The PHP Group | + | Copyright (c) 2007-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git b/ext/soap/php_xml.c a/ext/soap/php_xml.c index 65abed1..2f2c5c9 100644 --- b/ext/soap/php_xml.c +++ a/ext/soap/php_xml.c @@ -20,6 +20,7 @@ /* $Id$ */ #include "php_soap.h" +#include "ext/libxml/php_libxml.h" #include "libxml/parser.h" #include "libxml/parserInternals.h" @@ -91,13 +92,17 @@ xmlDocPtr soap_xmlParseFile(const char *filename TSRMLS_DC) ctxt = xmlCreateFileParserCtxt(filename); PG(allow_url_fopen) = old_allow_url_fopen; if (ctxt) { + zend_bool old; + ctxt->keepBlanks = 0; ctxt->sax->ignorableWhitespace = soap_ignorableWhitespace; ctxt->sax->comment = soap_Comment; ctxt->sax->warning = NULL; ctxt->sax->error = NULL; /*ctxt->sax->fatalError = NULL;*/ + old = php_libxml_disable_entity_loader(1 TSRMLS_CC); xmlParseDocument(ctxt); + php_libxml_disable_entity_loader(old TSRMLS_CC); if (ctxt->wellFormed) { ret = ctxt->myDoc; if (ret->URL == NULL && ctxt->directory != NULL) { @@ -128,11 +133,15 @@ xmlDocPtr soap_xmlParseMemory(const void *buf, size_t buf_size) xmlParserCtxtPtr ctxt = NULL; xmlDocPtr ret; + TSRMLS_FETCH(); + /* xmlInitParser(); */ ctxt = xmlCreateMemoryParserCtxt(buf, buf_size); if (ctxt) { + zend_bool old; + ctxt->sax->ignorableWhitespace = soap_ignorableWhitespace; ctxt->sax->comment = soap_Comment; ctxt->sax->warning = NULL; @@ -141,7 +150,9 @@ xmlDocPtr soap_xmlParseMemory(const void *buf, size_t buf_size) #if LIBXML_VERSION >= 20703 ctxt->options |= XML_PARSE_HUGE; #endif + old = php_libxml_disable_entity_loader(1 TSRMLS_CC); xmlParseDocument(ctxt); + php_libxml_disable_entity_loader(old TSRMLS_CC); if (ctxt->wellFormed) { ret = ctxt->myDoc; if (ret->URL == NULL && ctxt->directory != NULL) { diff --git b/ext/soap/soap.c a/ext/soap/soap.c index 843f49b..6851a9b 100644 --- b/ext/soap/soap.c +++ a/ext/soap/soap.c @@ -568,10 +568,44 @@ ZEND_INI_MH(OnUpdateCacheMode) return SUCCESS; } +static PHP_INI_MH(OnUpdateCacheDir) +{ + /* Only do the safemode/open_basedir check at runtime */ + if (stage == PHP_INI_STAGE_RUNTIME || stage == PHP_INI_STAGE_HTACCESS) { + char *p; + + if (memchr(new_value, '\0', new_value_length) != NULL) { + return FAILURE; + } + + /* we do not use zend_memrchr() since path can contain ; itself */ + if ((p = strchr(new_value, ';'))) { + char *p2; + p++; + if ((p2 = strchr(p, ';'))) { + p = p2 + 1; + } + } else { + p = new_value; + } + + if (PG(safe_mode) && *p && (!php_checkuid(p, NULL, CHECKUID_CHECK_FILE_AND_DIR))) { + return FAILURE; + } + + if (PG(open_basedir) && *p && php_check_open_basedir(p TSRMLS_CC)) { + return FAILURE; + } + } + + OnUpdateString(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC); + return SUCCESS; +} + PHP_INI_BEGIN() STD_PHP_INI_ENTRY("soap.wsdl_cache_enabled", "1", PHP_INI_ALL, OnUpdateBool, cache_enabled, zend_soap_globals, soap_globals) -STD_PHP_INI_ENTRY("soap.wsdl_cache_dir", "/tmp", PHP_INI_ALL, OnUpdateString, +STD_PHP_INI_ENTRY("soap.wsdl_cache_dir", "/tmp", PHP_INI_ALL, OnUpdateCacheDir, cache_dir, zend_soap_globals, soap_globals) STD_PHP_INI_ENTRY("soap.wsdl_cache_ttl", "86400", PHP_INI_ALL, OnUpdateLong, cache_ttl, zend_soap_globals, soap_globals) diff --git b/ext/spl/spl_array.c a/ext/spl/spl_array.c index 7c2e148..77453d6 100644 --- b/ext/spl/spl_array.c +++ a/ext/spl/spl_array.c @@ -387,7 +387,11 @@ static zval *spl_array_read_dimension_ex(int check_inherited, zval *object, zval spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC); if (intern->fptr_offset_get) { zval *rv; - SEPARATE_ARG_IF_REF(offset); + if (!offset) { + ALLOC_INIT_ZVAL(offset); + } else { + SEPARATE_ARG_IF_REF(offset); + } zend_call_method_with_1_params(&object, Z_OBJCE_P(object), &intern->fptr_offset_get, "offsetGet", &rv, offset); zval_ptr_dtor(&offset); if (rv) { @@ -404,7 +408,7 @@ static zval *spl_array_read_dimension_ex(int check_inherited, zval *object, zval /* When in a write context, * ZE has to be fooled into thinking this is in a reference set * by separating (if necessary) and returning as an is_ref=1 zval (even if refcount == 1) */ - if ((type == BP_VAR_W || type == BP_VAR_RW) && !Z_ISREF_PP(ret)) { + if ((type == BP_VAR_W || type == BP_VAR_RW || type == BP_VAR_UNSET) && !Z_ISREF_PP(ret)) { if (Z_REFCOUNT_PP(ret) > 1) { zval *newval; diff --git b/ext/spl/spl_directory.c a/ext/spl/spl_directory.c index 0638836..13af781 100644 --- b/ext/spl/spl_directory.c +++ a/ext/spl/spl_directory.c @@ -1431,6 +1431,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; @@ -1442,7 +1443,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)); } /* }}} */ @@ -1873,6 +1874,10 @@ static int spl_filesystem_object_cast(zval *readobj, zval *writeobj, int type TS spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(readobj TSRMLS_CC); if (type == IS_STRING) { + if (Z_OBJCE_P(readobj)->__tostring) { + return std_object_handlers.cast_object(readobj, writeobj, type TSRMLS_CC); + } + switch (intern->type) { case SPL_FS_INFO: case SPL_FS_FILE: diff --git b/ext/spl/spl_fixedarray.c a/ext/spl/spl_fixedarray.c index 559cac2..646c002 100644 --- b/ext/spl/spl_fixedarray.c +++ a/ext/spl/spl_fixedarray.c @@ -361,7 +361,11 @@ static zval *spl_fixedarray_object_read_dimension(zval *object, zval *offset, in if (intern->fptr_offset_get) { zval *rv; - SEPARATE_ARG_IF_REF(offset); + if (!offset) { + ALLOC_INIT_ZVAL(offset); + } else { + SEPARATE_ARG_IF_REF(offset); + } zend_call_method_with_1_params(&object, intern->std.ce, &intern->fptr_offset_get, "offsetGet", &rv, offset); zval_ptr_dtor(&offset); if (rv) { @@ -607,8 +611,6 @@ SPL_METHOD(SplFixedArray, count) SPL_METHOD(SplFixedArray, toArray) { spl_fixedarray_object *intern; - zval *ret, *tmp; - HashTable *ret_ht, *obj_ht; if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "")) { return; @@ -616,15 +618,19 @@ SPL_METHOD(SplFixedArray, toArray) intern = (spl_fixedarray_object *)zend_object_store_get_object(getThis() TSRMLS_CC); - ALLOC_HASHTABLE(ret_ht); - zend_hash_init(ret_ht, 0, NULL, ZVAL_PTR_DTOR, 0); - ALLOC_INIT_ZVAL(ret); - Z_TYPE_P(ret) = IS_ARRAY; - obj_ht = spl_fixedarray_object_get_properties(getThis() TSRMLS_CC); - zend_hash_copy(ret_ht, obj_ht, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *)); - Z_ARRVAL_P(ret) = ret_ht; - - RETURN_ZVAL(ret, 1, 1); + array_init(return_value); + if (intern->array) { + int i = 0; + for (; i < intern->array->size; i++) { + if (intern->array->elements[i]) { + zend_hash_index_update(Z_ARRVAL_P(return_value), i, (void *)&intern->array->elements[i], sizeof(zval *), NULL); + Z_ADDREF_P(intern->array->elements[i]); + } else { + zend_hash_index_update(Z_ARRVAL_P(return_value), i, (void *)&EG(uninitialized_zval_ptr), sizeof(zval *), NULL); + Z_ADDREF_P(EG(uninitialized_zval_ptr)); + } + } + } } /* }}} */ diff --git b/ext/spl/tests/bug52861.phpt a/ext/spl/tests/bug52861.phpt new file mode 100644 index 0000000..30a3261 --- /dev/null +++ a/ext/spl/tests/bug52861.phpt @@ -0,0 +1,22 @@ +--TEST-- +Bug #52861 (unset failes with ArrayObject and deep arrays) +--FILE-- +<?php +$arrayObject = new ArrayObject(array('foo' => array('bar' => array('baz' => 'boo')))); + +unset($arrayObject['foo']['bar']['baz']); +print_r($arrayObject->getArrayCopy()); +?> +--EXPECT-- +Array +( + [foo] => Array + ( + [bar] => Array + ( + ) + + ) + +) + diff --git b/ext/spl/tests/bug64023.phpt a/ext/spl/tests/bug64023.phpt new file mode 100644 index 0000000..2c177f9 --- /dev/null +++ a/ext/spl/tests/bug64023.phpt @@ -0,0 +1,20 @@ +--TEST-- +Bug #64023: Overloading __toString() in SplFileInfo has no effect +--FILE-- +<?php +class A extends \SplFileInfo +{ + public function __toString() {return ' -expected- ';} +} + +$a = new A('/'); + +// Works +echo $a, $a->__toString(), $a->__toString() . '', "\n"; + +// Does not work - outputs parent::__toString() +echo $a . '', "\n"; + +--EXPECT-- + -expected- -expected- -expected- + -expected- diff --git b/ext/spl/tests/bug64106.phpt a/ext/spl/tests/bug64106.phpt new file mode 100644 index 0000000..855caef --- /dev/null +++ a/ext/spl/tests/bug64106.phpt @@ -0,0 +1,15 @@ +--TEST-- +Bug #64106: Segfault on SplFixedArray[][x] = y when extended +--FILE-- +<?php + +class MyFixedArray extends SplFixedArray { + public function offsetGet($offset) {} +} + +$array = new MyFixedArray(10); +$array[][1] = 10; + +?> +--EXPECTF-- +Notice: Indirect modification of overloaded element of MyFixedArray has no effect in %s on line %d diff --git b/ext/spl/tests/bug64228.phpt a/ext/spl/tests/bug64228.phpt new file mode 100644 index 0000000..3f30dd2 --- /dev/null +++ a/ext/spl/tests/bug64228.phpt @@ -0,0 +1,25 @@ +--TEST-- +Bug #64228 (RecursiveDirectoryIterator always assumes SKIP_DOTS) +--FILE-- +<?php +$dirs = array(); +$empty_dir = __DIR__ . "/empty"; +@mkdir($empty_dir); + +$i = new RecursiveDirectoryIterator($empty_dir, FilesystemIterator::KEY_AS_PATHNAME | FilesystemIterator::CURRENT_AS_FILEINFO); // Note the absence of FilesystemIterator::SKIP_DOTS +foreach ($i as $key => $value) { + $dirs[] = $value->getFileName(); +} + +@rmdir($empty_dir); + +sort($dirs); +print_r($dirs); +?> +--EXPECT-- +Array +( + [0] => . + [1] => .. +) + diff --git b/ext/spl/tests/bug64264.phpt a/ext/spl/tests/bug64264.phpt new file mode 100644 index 0000000..e7b695b --- /dev/null +++ a/ext/spl/tests/bug64264.phpt @@ -0,0 +1,29 @@ +--TEST-- +Bug #64264 (SPLFixedArray toArray problem) +--FILE-- +<?php +class MyFixedArray extends \SplFixedArray { + protected $foo; + protected $bar; +} + +$myFixedArr = new MyFixedArray(1); +$myFixedArr[0] = 'foo'; +$myFixedArr->setSize(2); +$myFixedArr[1] = 'bar'; +$myFixedArr->setSize(5); +$array = $myFixedArr->toArray(); +$array[2] = "ERROR"; +$array[3] = "ERROR"; +$array[4] = "ERROR"; +unset($array[4]); +$myFixedArr->setSize(2); + +print_r($myFixedArr->toArray()); +?> +--EXPECTF-- +Array +( + [0] => foo + [1] => bar +) diff --git b/ext/standard/string.c a/ext/standard/string.c index b17ad50..907301d 100644 --- b/ext/standard/string.c +++ a/ext/standard/string.c @@ -1744,7 +1744,7 @@ PHP_FUNCTION(strpos) if (Z_TYPE_P(needle) == IS_STRING) { if (!Z_STRLEN_P(needle)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty delimiter"); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty needle"); RETURN_FALSE; } diff --git b/ext/standard/tests/network/http-stream.phpt a/ext/standard/tests/network/http-stream.phpt index 6ee035a..99245f7 100644 --- b/ext/standard/tests/network/http-stream.phpt +++ a/ext/standard/tests/network/http-stream.phpt @@ -3,6 +3,7 @@ http-stream test --SKIPIF-- <?php if (getenv("SKIP_SLOW_TESTS")) die("skip slow test"); +if (getenv("SKIP_ONLINE_TESTS")) die("skip online test"); if (!extension_loaded("dom")) die("skip dom extension is not present"); ?> --INI-- diff --git b/ext/standard/tests/strings/bug63943.phpt a/ext/standard/tests/strings/bug63943.phpt new file mode 100644 index 0000000..6018879 --- /dev/null +++ a/ext/standard/tests/strings/bug63943.phpt @@ -0,0 +1,8 @@ +--TEST-- +Bug #63943 (Bad warning text from strpos() on empty needle) +--FILE-- +<?php +strpos("lllllll", ''); +?> +--EXPECTF-- +Warning: strpos(): Empty needle in %sbug63943.php on line %d diff --git b/ext/standard/tests/strings/strpos.phpt a/ext/standard/tests/strings/strpos.phpt index 706ddfd..9b44584 100644 Binary files b/ext/standard/tests/strings/strpos.phpt and a/ext/standard/tests/strings/strpos.phpt differ diff --git b/main/php_version.h a/main/php_version.h index e9d79f8..3add96c 100644 --- b/main/php_version.h +++ a/main/php_version.h @@ -2,7 +2,7 @@ /* edit configure.in to change version number */ #define PHP_MAJOR_VERSION 5 #define PHP_MINOR_VERSION 3 -#define PHP_RELEASE_VERSION 21 -#define PHP_EXTRA_VERSION "" -#define PHP_VERSION "5.3.21" -#define PHP_VERSION_ID 50321 +#define PHP_RELEASE_VERSION 23 +#define PHP_EXTRA_VERSION "RC1" +#define PHP_VERSION "5.3.23RC1" +#define PHP_VERSION_ID 50323 diff --git b/sapi/fpm/fpm/fpm_sockets.h a/sapi/fpm/fpm/fpm_sockets.h index 499ba6b..cce5712 100644 --- b/sapi/fpm/fpm/fpm_sockets.h +++ a/sapi/fpm/fpm/fpm_sockets.h @@ -25,7 +25,7 @@ enum fpm_address_domain fpm_sockets_domain_from_address(char *addr); int fpm_sockets_init_main(); int fpm_socket_get_listening_queue(int sock, unsigned *cur_lq, unsigned *max_lq); -int fpm_socket_unix_test_connect(struct sockaddr_un *sun, size_t socklen); +int fpm_socket_unix_test_connect(struct sockaddr_un *sock, size_t socklen); static inline int fd_set_blocked(int fd, int blocked) /* {{{ */ diff --git b/win32/build/libs_version.txt a/win32/build/libs_version.txt index 5895e7b..b5d62ae 100644 --- b/win32/build/libs_version.txt +++ a/win32/build/libs_version.txt @@ -1,17 +1,17 @@ bz2-1.0.6 cclient-2007e -freetype-2.4.3 +freetype-2.4.10 icu-49.1.2 -jpeglib-6b -libcurl-7.27.0 +jpeglib-8 +libcurl-7.29.0 libiconv-1.14 libmcrypt-2.5.8 libmpir-1.3.1 -libpng-1.2.46 +libpng-1.2.50 libpq-8.3.6 libssh2-1.4.2 libtidy-20090325 libxslt-1.1.27 libxml-2.7.8 -openssl-0.9.8x +openssl-0.9.8y diff --git b/win32/registry.c a/win32/registry.c index 638d85a..685a09d 100644 --- b/win32/registry.c +++ a/win32/registry.c @@ -91,6 +91,7 @@ static int LoadDirectory(HashTable *directories, HKEY key, char *path, int path_ INIT_PZVAL(data); Z_STRVAL_P(data) = zend_strndup(value, value_len-1); Z_STRLEN_P(data) = value_len-1; + Z_TYPE_P(data) = IS_STRING; zend_hash_update(ht, name, name_len+1, &data, sizeof(zval*), NULL); } }
diff --git b/NEWS a/NEWS index 9d09aab..5f19e6d 100644 --- b/NEWS +++ a/NEWS @@ -1,5 +1,39 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| +28 Feb 2013, PHP 5.3.23RC1 + +- SPL: + . Fixed bug #64264 (SPLFixedArray toArray problem). (Laruence) + . Fixed bug #64228 (RecursiveDirectoryIterator always assumes SKIP_DOTS). + (patch by kriss@krizalys.com, Laruence) + . Fixed bug #52861 (unset fails with ArrayObject and deep arrays). + (Mike Willbanks) + +21 Feb 2013, PHP 5.3.22 + +- Zend Engine: + . Fixed bug #64099 (Wrong TSRM usage in zend_Register_class alias). (Johannes) + . Fixed bug #63899 (Use after scope error in zend_compile). (Laruence) + +- Core + . Fixed bug #63943 (Bad warning text from strpos() on empty needle). + (Laruence) + +- Date: + . Fixed bug #55397 (comparsion of incomplete DateTime causes SIGSEGV). + (Laruence, Derick) + +- FPM: + . Fixed bug #63999 (php with fpm fails to build on Solaris 10 or 11). (Adam) + +- SOAP + . Added check that soap.wsdl_cache_dir conforms to open_basedir + (CVE-2013-1635). (Dmitry) + . Disabled external entities loading (CVE-2013-1643). (Dmitry) + +- SPL: + . Fixed bug #64106 (Segfault on SplFixedArray[][x] = y when extended). (Nikita Popov) + 17 Jan 2013, PHP 5.3.21 - Zend Engine: diff --git b/Zend/tests/bug63462.phpt a/Zend/tests/bug63462.phpt new file mode 100644 index 0000000..e936a6f --- /dev/null +++ a/Zend/tests/bug63462.phpt @@ -0,0 +1,74 @@ +--TEST-- +Test script to verify that magic methods should be called only once when accessing an unset property. +--CREDITS-- +Marco Pivetta <ocramius@gmail.com> +--FILE-- +<?php +class Test { + public $publicProperty; + protected $protectedProperty; + private $privateProperty; + + public function __construct() { + unset( + $this->publicProperty, + $this->protectedProperty, + $this->privateProperty + ); + } + + function __get($name) { + echo '__get ' . $name . "\n"; + return $this->$name; + } + + function __set($name, $value) { + echo '__set ' . $name . "\n"; + $this->$name = $value; + } + + function __isset($name) { + echo '__isset ' . $name . "\n"; + return isset($this->$name); + } +} + +$test = new Test(); + +$test->nonExisting; +$test->publicProperty; +$test->protectedProperty; +$test->privateProperty; +isset($test->nonExisting); +isset($test->publicProperty); +isset($test->protectedProperty); +isset($test->privateProperty); +$test->nonExisting = 'value'; +$test->publicProperty = 'value'; +$test->protectedProperty = 'value'; +$test->privateProperty = 'value'; + +?> + +--EXPECTF-- +__get nonExisting + +Notice: Undefined property: Test::$nonExisting in %s on line %d +__get publicProperty + +Notice: Undefined property: Test::$publicProperty in %s on line %d +__get protectedProperty + +Notice: Undefined property: Test::$protectedProperty in %s on line %d +__get privateProperty + +Notice: Undefined property: Test::$privateProperty in %s on line %d +__isset nonExisting +__isset publicProperty +__isset protectedProperty +__isset privateProperty +__set nonExisting +__set publicProperty +__set protectedProperty +__set privateProperty + diff --git b/Zend/zend_API.h a/Zend/zend_API.h index 05170f2..f6f2c46 100644 --- b/Zend/zend_API.h +++ a/Zend/zend_API.h @@ -268,9 +268,9 @@ ZEND_API void zend_class_implements(zend_class_entry *class_entry TSRMLS_DC, int ZEND_API int zend_register_class_alias_ex(const char *name, int name_len, zend_class_entry *ce TSRMLS_DC); #define zend_register_class_alias(name, ce) \ - zend_register_class_alias_ex(name, sizeof(name)-1, ce TSRMLS_DC) + zend_register_class_alias_ex(name, sizeof(name)-1, ce TSRMLS_CC) #define zend_register_ns_class_alias(ns, name, ce) \ - zend_register_class_alias_ex(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name))-1, ce TSRMLS_DC) + zend_register_class_alias_ex(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name))-1, ce TSRMLS_CC) ZEND_API int zend_disable_function(char *function_name, uint function_name_length TSRMLS_DC); ZEND_API int zend_disable_class(char *class_name, uint class_name_length TSRMLS_DC); diff --git b/Zend/zend_compile.c a/Zend/zend_compile.c index 7725fb7..8382b48 100644 --- b/Zend/zend_compile.c +++ a/Zend/zend_compile.c @@ -3414,10 +3414,11 @@ void zend_do_begin_class_declaration(const znode *class_token, znode *class_name /* Prefix class name with name of current namespace */ znode tmp; + tmp.op_type = IS_CONST; tmp.u.constant = *CG(current_namespace); zval_copy_ctor(&tmp.u.constant); zend_do_build_namespace_name(&tmp, &tmp, class_name TSRMLS_CC); - class_name = &tmp; + *class_name = tmp; efree(lcname); lcname = zend_str_tolower_dup(Z_STRVAL(class_name->u.constant), Z_STRLEN(class_name->u.constant)); } @@ -3529,7 +3530,7 @@ void zend_do_end_class_declaration(const znode *class_token, const znode *parent ce->line_end = zend_get_compiled_lineno(TSRMLS_C); if (!(ce->ce_flags & (ZEND_ACC_INTERFACE|ZEND_ACC_EXPLICIT_ABSTRACT_CLASS)) - && ((parent_token->op_type != IS_UNUSED) || (ce->num_interfaces > 0))) { + && (parent_token || (ce->num_interfaces > 0))) { zend_verify_abstract_class(ce TSRMLS_CC); if (ce->num_interfaces) { do_verify_abstract_class(TSRMLS_C); diff --git b/Zend/zend_language_parser.y a/Zend/zend_language_parser.y index 2533f60..d24fc9c 100644 --- b/Zend/zend_language_parser.y +++ a/Zend/zend_language_parser.y @@ -316,13 +316,13 @@ unticked_class_declaration_statement: implements_list '{' class_statement_list - '}' { zend_do_end_class_declaration(&$1, &$2 TSRMLS_CC); } + '}' { zend_do_end_class_declaration(&$1, &$3 TSRMLS_CC); } | interface_entry T_STRING { zend_do_begin_class_declaration(&$1, &$2, NULL TSRMLS_CC); } interface_extends_list '{' class_statement_list - '}' { zend_do_end_class_declaration(&$1, &$2 TSRMLS_CC); } + '}' { zend_do_end_class_declaration(&$1, NULL TSRMLS_CC); } ; diff --git b/Zend/zend_object_handlers.c a/Zend/zend_object_handlers.c index cbd64c9..a42669f 100644 --- b/Zend/zend_object_handlers.c +++ a/Zend/zend_object_handlers.c @@ -296,6 +296,16 @@ static int zend_get_property_guard(zend_object *zobj, zend_property_info *proper info.name = Z_STRVAL_P(member); info.name_length = Z_STRLEN_P(member); info.h = zend_get_hash_value(Z_STRVAL_P(member), Z_STRLEN_P(member) + 1); + } else if(property_info->name[0] == '\0'){ + const char *class_name = NULL, *prop_name = NULL; + zend_unmangle_property_name(property_info->name, property_info->name_length, &class_name, &prop_name); + if(class_name) { + /* use unmangled name for protected properties */ + info.name = prop_name; + info.name_length = strlen(prop_name); + info.h = zend_get_hash_value(info.name, info.name_length+1); + property_info = &info; + } } if (!zobj->guards) { ALLOC_HASHTABLE(zobj->guards); diff --git b/Zend/zend_vm_def.h a/Zend/zend_vm_def.h index 3fa5327..e8d3250 100644 --- b/Zend/zend_vm_def.h +++ a/Zend/zend_vm_def.h @@ -896,23 +896,12 @@ ZEND_VM_HANDLER(40, ZEND_ECHO, CONST|TMP|VAR|CV, ANY) { zend_op *opline = EX(opline); zend_free_op free_op1; - zval z_copy; zval *z = GET_OP1_ZVAL_PTR(BP_VAR_R); - if (OP1_TYPE != IS_CONST && - Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get_method != NULL) { - if (OP1_TYPE == IS_TMP_VAR) { - INIT_PZVAL(z); - } - if (zend_std_cast_object_tostring(z, &z_copy, IS_STRING TSRMLS_CC) == SUCCESS) { - zend_print_variable(&z_copy); - zval_dtor(&z_copy); - } else { - zend_print_variable(z); - } - } else { - zend_print_variable(z); + if (OP1_TYPE == IS_TMP_VAR && Z_TYPE_P(z) == IS_OBJECT) { + INIT_PZVAL(z); } + zend_print_variable(z); FREE_OP1(); ZEND_VM_NEXT_OPCODE(); diff --git b/Zend/zend_vm_execute.h a/Zend/zend_vm_execute.h index 1ad7f77..f5cedd8 100644 --- b/Zend/zend_vm_execute.h +++ a/Zend/zend_vm_execute.h @@ -1320,23 +1320,12 @@ static int ZEND_FASTCALL ZEND_ECHO_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { zend_op *opline = EX(opline); - zval z_copy; zval *z = &opline->op1.u.constant; - if (IS_CONST != IS_CONST && - Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get_method != NULL) { - if (IS_CONST == IS_TMP_VAR) { - INIT_PZVAL(z); - } - if (zend_std_cast_object_tostring(z, &z_copy, IS_STRING TSRMLS_CC) == SUCCESS) { - zend_print_variable(&z_copy); - zval_dtor(&z_copy); - } else { - zend_print_variable(z); - } - } else { - zend_print_variable(z); + if (IS_CONST == IS_TMP_VAR && Z_TYPE_P(z) == IS_OBJECT) { + INIT_PZVAL(z); } + zend_print_variable(z); ZEND_VM_NEXT_OPCODE(); } @@ -4635,23 +4624,12 @@ static int ZEND_FASTCALL ZEND_ECHO_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { zend_op *opline = EX(opline); zend_free_op free_op1; - zval z_copy; zval *z = _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - if (IS_TMP_VAR != IS_CONST && - Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get_method != NULL) { - if (IS_TMP_VAR == IS_TMP_VAR) { - INIT_PZVAL(z); - } - if (zend_std_cast_object_tostring(z, &z_copy, IS_STRING TSRMLS_CC) == SUCCESS) { - zend_print_variable(&z_copy); - zval_dtor(&z_copy); - } else { - zend_print_variable(z); - } - } else { - zend_print_variable(z); + if (IS_TMP_VAR == IS_TMP_VAR && Z_TYPE_P(z) == IS_OBJECT) { + INIT_PZVAL(z); } + zend_print_variable(z); zval_dtor(free_op1.var); ZEND_VM_NEXT_OPCODE(); @@ -7898,23 +7876,12 @@ static int ZEND_FASTCALL ZEND_ECHO_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { zend_op *opline = EX(opline); zend_free_op free_op1; - zval z_copy; zval *z = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - if (IS_VAR != IS_CONST && - Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get_method != NULL) { - if (IS_VAR == IS_TMP_VAR) { - INIT_PZVAL(z); - } - if (zend_std_cast_object_tostring(z, &z_copy, IS_STRING TSRMLS_CC) == SUCCESS) { - zend_print_variable(&z_copy); - zval_dtor(&z_copy); - } else { - zend_print_variable(z); - } - } else { - zend_print_variable(z); + if (IS_VAR == IS_TMP_VAR && Z_TYPE_P(z) == IS_OBJECT) { + INIT_PZVAL(z); } + zend_print_variable(z); if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; ZEND_VM_NEXT_OPCODE(); @@ -21823,23 +21790,12 @@ static int ZEND_FASTCALL ZEND_ECHO_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { zend_op *opline = EX(opline); - zval z_copy; zval *z = _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); - if (IS_CV != IS_CONST && - Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get_method != NULL) { - if (IS_CV == IS_TMP_VAR) { - INIT_PZVAL(z); - } - if (zend_std_cast_object_tostring(z, &z_copy, IS_STRING TSRMLS_CC) == SUCCESS) { - zend_print_variable(&z_copy); - zval_dtor(&z_copy); - } else { - zend_print_variable(z); - } - } else { - zend_print_variable(z); + if (IS_CV == IS_TMP_VAR && Z_TYPE_P(z) == IS_OBJECT) { + INIT_PZVAL(z); } + zend_print_variable(z); ZEND_VM_NEXT_OPCODE(); } diff --git b/configure.in a/configure.in index 9677c18..c461df2 100644 --- b/configure.in +++ a/configure.in @@ -41,8 +41,8 @@ AC_CONFIG_HEADER(main/php_config.h) PHP_MAJOR_VERSION=5 PHP_MINOR_VERSION=3 -PHP_RELEASE_VERSION=21 -PHP_EXTRA_VERSION="" +PHP_RELEASE_VERSION=23 +PHP_EXTRA_VERSION="RC1" PHP_VERSION="$PHP_MAJOR_VERSION.$PHP_MINOR_VERSION.$PHP_RELEASE_VERSION$PHP_EXTRA_VERSION" PHP_VERSION_ID=`expr [$]PHP_MAJOR_VERSION \* 10000 + [$]PHP_MINOR_VERSION \* 100 + [$]PHP_RELEASE_VERSION` diff --git b/ext/curl/tests/curl_error_basic.phpt a/ext/curl/tests/curl_error_basic.phpt index bd01847..3d35023 100644 --- b/ext/curl/tests/curl_error_basic.phpt +++ a/ext/curl/tests/curl_error_basic.phpt @@ -38,4 +38,4 @@ curl_close($ch); ?> --EXPECTF-- == Testing curl_error with a fake URL == -string(%d) "%sfakeURL%s" +string(%d) "%sfakeURL%S" diff --git b/ext/date/php_date.c a/ext/date/php_date.c index 2b4b4b5..2e616b1 100644 --- b/ext/date/php_date.c +++ a/ext/date/php_date.c @@ -2079,7 +2079,11 @@ static int date_object_compare_date(zval *d1, zval *d2 TSRMLS_DC) instanceof_function(Z_OBJCE_P(d2), date_ce_date TSRMLS_CC)) { php_date_obj *o1 = zend_object_store_get_object(d1 TSRMLS_CC); php_date_obj *o2 = zend_object_store_get_object(d2 TSRMLS_CC); - + + if (!o1->time || !o2->time) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Trying to compare an incomplete DateTime object"); + return 1; + } if (!o1->time->sse_uptodate) { timelib_update_ts(o1->time, o1->time->tz_info); } diff --git b/ext/date/tests/bug55397.phpt a/ext/date/tests/bug55397.phpt new file mode 100644 index 0000000..efc09b5 --- /dev/null +++ a/ext/date/tests/bug55397.phpt @@ -0,0 +1,11 @@ +--TEST-- +Bug #55397 (comparsion of incomplete DateTime causes SIGSEGV) +--INI-- +--FILE-- +<?php +date_default_timezone_set('Europe/Prague'); +var_dump(unserialize('O:8:"DateTime":0:{}') == new DateTime); +?> +--EXPECTF-- +Warning: %s: Trying to compare an incomplete DateTime object in %s on line %d +bool(false) diff --git b/ext/libxml/libxml.c a/ext/libxml/libxml.c index 5db1f31..920a90c 100644 --- b/ext/libxml/libxml.c +++ a/ext/libxml/libxml.c @@ -261,6 +261,7 @@ static PHP_GINIT_FUNCTION(libxml) libxml_globals->stream_context = NULL; libxml_globals->error_buffer.c = NULL; libxml_globals->error_list = NULL; + libxml_globals->entity_loader_disabled = 0; } /* Channel libxml file io layer through the PHP streams subsystem. @@ -348,16 +349,15 @@ static int php_libxml_streams_IO_close(void *context) } static xmlParserInputBufferPtr -php_libxml_input_buffer_noload(const char *URI, xmlCharEncoding enc) -{ - return NULL; -} - -static xmlParserInputBufferPtr php_libxml_input_buffer_create_filename(const char *URI, xmlCharEncoding enc) { xmlParserInputBufferPtr ret; void *context = NULL; + TSRMLS_FETCH(); + + if (LIBXML(entity_loader_disabled)) { + return NULL; + } if (URI == NULL) return(NULL); @@ -834,28 +834,25 @@ static PHP_FUNCTION(libxml_clear_errors) } /* }}} */ +PHP_LIBXML_API zend_bool php_libxml_disable_entity_loader(zend_bool disable TSRMLS_DC) +{ + zend_bool old = LIBXML(entity_loader_disabled); + + LIBXML(entity_loader_disabled) = disable; + return old; +} + /* {{{ proto bool libxml_disable_entity_loader([boolean disable]) Disable/Enable ability to load external entities */ static PHP_FUNCTION(libxml_disable_entity_loader) { zend_bool disable = 1; - xmlParserInputBufferCreateFilenameFunc old; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &disable) == FAILURE) { return; } - if (disable == 0) { - old = xmlParserInputBufferCreateFilenameDefault(php_libxml_input_buffer_create_filename); - } else { - old = xmlParserInputBufferCreateFilenameDefault(php_libxml_input_buffer_noload); - } - - if (old == php_libxml_input_buffer_noload) { - RETURN_TRUE; - } - - RETURN_FALSE; + RETURN_BOOL(php_libxml_disable_entity_loader(disable TSRMLS_CC)); } /* }}} */ diff --git b/ext/libxml/php_libxml.h a/ext/libxml/php_libxml.h index 91a6d24..a7d8466 100644 --- b/ext/libxml/php_libxml.h +++ a/ext/libxml/php_libxml.h @@ -43,6 +43,7 @@ ZEND_BEGIN_MODULE_GLOBALS(libxml) zval *stream_context; smart_str error_buffer; zend_llist *error_list; + zend_bool entity_loader_disabled; ZEND_END_MODULE_GLOBALS(libxml) typedef struct _libxml_doc_props { @@ -93,6 +94,7 @@ PHP_LIBXML_API void php_libxml_ctx_error(void *ctx, const char *msg, ...); PHP_LIBXML_API int php_libxml_xmlCheckUTF8(const unsigned char *s); PHP_LIBXML_API zval *php_libxml_switch_context(zval *context TSRMLS_DC); PHP_LIBXML_API void php_libxml_issue_error(int level, const char *msg TSRMLS_DC); +PHP_LIBXML_API zend_bool php_libxml_disable_entity_loader(zend_bool disable TSRMLS_DC); /* Init/shutdown functions*/ PHP_LIBXML_API void php_libxml_initialize(void); diff --git b/ext/mysqlnd/mysqlnd.c a/ext/mysqlnd/mysqlnd.c index b539c51..20bab91 100644 --- b/ext/mysqlnd/mysqlnd.c +++ a/ext/mysqlnd/mysqlnd.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2012 The PHP Group | + | Copyright (c) 2006-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -691,6 +691,8 @@ MYSQLND_METHOD(mysqlnd_conn, connect)(MYSQLND * conn, mysql_flags |= CLIENT_LOCAL_FILES | CLIENT_PS_MULTI_RESULTS; mysql_flags |= MYSQLND_CAPABILITIES; + mysql_flags |= conn->options.flags; /* use the flags from set_client_option() */ + if (db) { mysql_flags |= CLIENT_CONNECT_WITH_DB; } diff --git b/ext/mysqlnd/mysqlnd.h a/ext/mysqlnd/mysqlnd.h index 65fe78e..731e5b8 100644 --- b/ext/mysqlnd/mysqlnd.h +++ a/ext/mysqlnd/mysqlnd.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2012 The PHP Group | + | Copyright (c) 2006-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git b/ext/mysqlnd/mysqlnd_block_alloc.c a/ext/mysqlnd/mysqlnd_block_alloc.c index b78efff..b9d7887 100644 --- b/ext/mysqlnd/mysqlnd_block_alloc.c +++ a/ext/mysqlnd/mysqlnd_block_alloc.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2012 The PHP Group | + | Copyright (c) 2006-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git b/ext/mysqlnd/mysqlnd_block_alloc.h a/ext/mysqlnd/mysqlnd_block_alloc.h index e2cf60f..39ccbdc 100644 --- b/ext/mysqlnd/mysqlnd_block_alloc.h +++ a/ext/mysqlnd/mysqlnd_block_alloc.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2012 The PHP Group | + | Copyright (c) 2006-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git b/ext/mysqlnd/mysqlnd_charset.c a/ext/mysqlnd/mysqlnd_charset.c index 704c119..2b477db 100644 --- b/ext/mysqlnd/mysqlnd_charset.c +++ a/ext/mysqlnd/mysqlnd_charset.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2012 The PHP Group | + | Copyright (c) 2006-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git b/ext/mysqlnd/mysqlnd_charset.h a/ext/mysqlnd/mysqlnd_charset.h index 2f5d1db..e71157a 100644 --- b/ext/mysqlnd/mysqlnd_charset.h +++ a/ext/mysqlnd/mysqlnd_charset.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2012 The PHP Group | + | Copyright (c) 2006-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git b/ext/mysqlnd/mysqlnd_debug.c a/ext/mysqlnd/mysqlnd_debug.c index 66f6466..0947d00 100644 --- b/ext/mysqlnd/mysqlnd_debug.c +++ a/ext/mysqlnd/mysqlnd_debug.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2012 The PHP Group | + | Copyright (c) 2006-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git b/ext/mysqlnd/mysqlnd_debug.h a/ext/mysqlnd/mysqlnd_debug.h index 01d9e89..a8bf680 100644 --- b/ext/mysqlnd/mysqlnd_debug.h +++ a/ext/mysqlnd/mysqlnd_debug.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2012 The PHP Group | + | Copyright (c) 2006-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git b/ext/mysqlnd/mysqlnd_enum_n_def.h a/ext/mysqlnd/mysqlnd_enum_n_def.h index 6dfb0aa..10deb03 100644 --- b/ext/mysqlnd/mysqlnd_enum_n_def.h +++ a/ext/mysqlnd/mysqlnd_enum_n_def.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2012 The PHP Group | + | Copyright (c) 2006-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git b/ext/mysqlnd/mysqlnd_libmysql_compat.h a/ext/mysqlnd/mysqlnd_libmysql_compat.h index c95539b..c967fb3 100644 --- b/ext/mysqlnd/mysqlnd_libmysql_compat.h +++ a/ext/mysqlnd/mysqlnd_libmysql_compat.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2012 The PHP Group | + | Copyright (c) 2006-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git b/ext/mysqlnd/mysqlnd_loaddata.c a/ext/mysqlnd/mysqlnd_loaddata.c index 557caa2..b980c81 100644 --- b/ext/mysqlnd/mysqlnd_loaddata.c +++ a/ext/mysqlnd/mysqlnd_loaddata.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2012 The PHP Group | + | Copyright (c) 2006-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git b/ext/mysqlnd/mysqlnd_net.c a/ext/mysqlnd/mysqlnd_net.c index e801928..512c844 100644 --- b/ext/mysqlnd/mysqlnd_net.c +++ a/ext/mysqlnd/mysqlnd_net.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2012 The PHP Group | + | Copyright (c) 2006-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git b/ext/mysqlnd/mysqlnd_net.h a/ext/mysqlnd/mysqlnd_net.h index d4077ae..4c20111 100644 --- b/ext/mysqlnd/mysqlnd_net.h +++ a/ext/mysqlnd/mysqlnd_net.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2012 The PHP Group | + | Copyright (c) 2006-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git b/ext/mysqlnd/mysqlnd_priv.h a/ext/mysqlnd/mysqlnd_priv.h index 52600a4..336e73a 100644 --- b/ext/mysqlnd/mysqlnd_priv.h +++ a/ext/mysqlnd/mysqlnd_priv.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2012 The PHP Group | + | Copyright (c) 2006-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git b/ext/mysqlnd/mysqlnd_ps.c a/ext/mysqlnd/mysqlnd_ps.c index d762689..c553aa5 100644 --- b/ext/mysqlnd/mysqlnd_ps.c +++ a/ext/mysqlnd/mysqlnd_ps.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2012 The PHP Group | + | Copyright (c) 2006-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git b/ext/mysqlnd/mysqlnd_ps_codec.c a/ext/mysqlnd/mysqlnd_ps_codec.c index 8e1db9b..eb4b32c 100644 --- b/ext/mysqlnd/mysqlnd_ps_codec.c +++ a/ext/mysqlnd/mysqlnd_ps_codec.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2012 The PHP Group | + | Copyright (c) 2006-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git b/ext/mysqlnd/mysqlnd_result.c a/ext/mysqlnd/mysqlnd_result.c index f238cc4..884de8b 100644 --- b/ext/mysqlnd/mysqlnd_result.c +++ a/ext/mysqlnd/mysqlnd_result.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2012 The PHP Group | + | Copyright (c) 2006-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git b/ext/mysqlnd/mysqlnd_result.h a/ext/mysqlnd/mysqlnd_result.h index 658db74..afddab4 100644 --- b/ext/mysqlnd/mysqlnd_result.h +++ a/ext/mysqlnd/mysqlnd_result.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2012 The PHP Group | + | Copyright (c) 2006-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git b/ext/mysqlnd/mysqlnd_result_meta.c a/ext/mysqlnd/mysqlnd_result_meta.c index f19bc02..23663a2 100644 --- b/ext/mysqlnd/mysqlnd_result_meta.c +++ a/ext/mysqlnd/mysqlnd_result_meta.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2012 The PHP Group | + | Copyright (c) 2006-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git b/ext/mysqlnd/mysqlnd_result_meta.h a/ext/mysqlnd/mysqlnd_result_meta.h index cf45b88..1ebbabd 100644 --- b/ext/mysqlnd/mysqlnd_result_meta.h +++ a/ext/mysqlnd/mysqlnd_result_meta.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2012 The PHP Group | + | Copyright (c) 2006-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git b/ext/mysqlnd/mysqlnd_statistics.c a/ext/mysqlnd/mysqlnd_statistics.c index 55eb0d1..eaabaa6 100644 --- b/ext/mysqlnd/mysqlnd_statistics.c +++ a/ext/mysqlnd/mysqlnd_statistics.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2012 The PHP Group | + | Copyright (c) 2006-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git b/ext/mysqlnd/mysqlnd_statistics.h a/ext/mysqlnd/mysqlnd_statistics.h index 9a5e31c..4c10501 100644 --- b/ext/mysqlnd/mysqlnd_statistics.h +++ a/ext/mysqlnd/mysqlnd_statistics.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2012 The PHP Group | + | Copyright (c) 2006-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git b/ext/mysqlnd/mysqlnd_structs.h a/ext/mysqlnd/mysqlnd_structs.h index 1a6b790..6c093ce 100644 --- b/ext/mysqlnd/mysqlnd_structs.h +++ a/ext/mysqlnd/mysqlnd_structs.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2012 The PHP Group | + | Copyright (c) 2006-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git b/ext/mysqlnd/mysqlnd_wireprotocol.c a/ext/mysqlnd/mysqlnd_wireprotocol.c index ec0ff49..d78191a 100644 --- b/ext/mysqlnd/mysqlnd_wireprotocol.c +++ a/ext/mysqlnd/mysqlnd_wireprotocol.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2012 The PHP Group | + | Copyright (c) 2006-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git b/ext/mysqlnd/mysqlnd_wireprotocol.h a/ext/mysqlnd/mysqlnd_wireprotocol.h index be14e09..34e79d0 100644 --- b/ext/mysqlnd/mysqlnd_wireprotocol.h +++ a/ext/mysqlnd/mysqlnd_wireprotocol.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2012 The PHP Group | + | Copyright (c) 2006-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git b/ext/mysqlnd/php_mysqlnd.c a/ext/mysqlnd/php_mysqlnd.c index 5863244..77880ed 100644 --- b/ext/mysqlnd/php_mysqlnd.c +++ a/ext/mysqlnd/php_mysqlnd.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2012 The PHP Group | + | Copyright (c) 2006-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git b/ext/mysqlnd/php_mysqlnd.h a/ext/mysqlnd/php_mysqlnd.h index 5e7a5e5..d07700e 100644 --- b/ext/mysqlnd/php_mysqlnd.h +++ a/ext/mysqlnd/php_mysqlnd.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2012 The PHP Group | + | Copyright (c) 2006-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git b/ext/phar/dirstream.c a/ext/phar/dirstream.c index a1c5b09..277d058 100644 --- b/ext/phar/dirstream.c +++ a/ext/phar/dirstream.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | phar:// stream wrapper support | +----------------------------------------------------------------------+ - | Copyright (c) 2005-2012 The PHP Group | + | Copyright (c) 2005-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git b/ext/phar/dirstream.h a/ext/phar/dirstream.h index c5fe18b..9b07c9d 100644 --- b/ext/phar/dirstream.h +++ a/ext/phar/dirstream.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | phar php single-file executable PHP extension | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2012 The PHP Group | + | Copyright (c) 2006-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git b/ext/phar/func_interceptors.c a/ext/phar/func_interceptors.c index 2e0739e..7812274 100644 --- b/ext/phar/func_interceptors.c +++ a/ext/phar/func_interceptors.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | phar php single-file executable PHP extension | +----------------------------------------------------------------------+ - | Copyright (c) 2005-2012 The PHP Group | + | Copyright (c) 2005-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git b/ext/phar/func_interceptors.h a/ext/phar/func_interceptors.h index 3afba31..59d6bf6 100644 --- b/ext/phar/func_interceptors.h +++ a/ext/phar/func_interceptors.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | phar php single-file executable PHP extension | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2012 The PHP Group | + | Copyright (c) 2006-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git b/ext/phar/phar.c a/ext/phar/phar.c index 7b7d559..21d7630 100644 --- b/ext/phar/phar.c +++ a/ext/phar/phar.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | phar php single-file executable PHP extension | +----------------------------------------------------------------------+ - | Copyright (c) 2005-2012 The PHP Group | + | Copyright (c) 2005-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git b/ext/phar/phar_internal.h a/ext/phar/phar_internal.h index bd50bb9..d9523b5 100644 --- b/ext/phar/phar_internal.h +++ a/ext/phar/phar_internal.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | phar php single-file executable PHP extension | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2012 The PHP Group | + | Copyright (c) 2006-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git b/ext/phar/phar_object.c a/ext/phar/phar_object.c index d19f30c..eb6b4cf 100644 --- b/ext/phar/phar_object.c +++ a/ext/phar/phar_object.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | phar php single-file executable PHP extension | +----------------------------------------------------------------------+ - | Copyright (c) 2005-2012 The PHP Group | + | Copyright (c) 2005-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git b/ext/phar/phar_path_check.c a/ext/phar/phar_path_check.c index 01e8c79..11f52bb 100644 --- b/ext/phar/phar_path_check.c +++ a/ext/phar/phar_path_check.c @@ -4,7 +4,7 @@ +----------------------------------------------------------------------+ | phar php single-file executable PHP extension | +----------------------------------------------------------------------+ - | Copyright (c) 2007-2012 The PHP Group | + | Copyright (c) 2007-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git b/ext/phar/phar_path_check.re a/ext/phar/phar_path_check.re index 6141da0..e43b3f8 100644 --- b/ext/phar/phar_path_check.re +++ a/ext/phar/phar_path_check.re @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | phar php single-file executable PHP extension | +----------------------------------------------------------------------+ - | Copyright (c) 2007-2012 The PHP Group | + | Copyright (c) 2007-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git b/ext/phar/pharzip.h a/ext/phar/pharzip.h index 4937e57..9c088d3 100644 --- b/ext/phar/pharzip.h +++ a/ext/phar/pharzip.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | phar php single-file executable PHP extension | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2012 The PHP Group | + | Copyright (c) 2006-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git b/ext/phar/php_phar.h a/ext/phar/php_phar.h index e34d51c..a6d7bff 100644 --- b/ext/phar/php_phar.h +++ a/ext/phar/php_phar.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | phar php single-file executable PHP extension | +----------------------------------------------------------------------+ - | Copyright (c) 2005-2012 The PHP Group | + | Copyright (c) 2005-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git b/ext/phar/stream.c a/ext/phar/stream.c index ccfe2a5..0831b02 100644 --- b/ext/phar/stream.c +++ a/ext/phar/stream.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | phar:// stream wrapper support | +----------------------------------------------------------------------+ - | Copyright (c) 2005-2012 The PHP Group | + | Copyright (c) 2005-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -458,8 +458,11 @@ static int phar_stream_flush(php_stream *stream TSRMLS_DC) /* {{{ */ { char *error; int ret; - if (stream->mode[0] == 'w' || (stream->mode[0] == 'r' && stream->mode[1] == '+')) { - ret = phar_flush(((phar_entry_data *)stream->abstract)->phar, 0, 0, 0, &error TSRMLS_CC); + phar_entry_data *data = (phar_entry_data *) stream->abstract; + + if (data->internal_file->is_modified) { + data->internal_file->timestamp = time(0); + ret = phar_flush(data->phar, 0, 0, 0, &error TSRMLS_CC); if (error) { php_stream_wrapper_log_error(stream->wrapper, REPORT_ERRORS TSRMLS_CC, "%s", error); efree(error); diff --git b/ext/phar/stream.h a/ext/phar/stream.h index 6fdc20e..b22b67a 100644 --- b/ext/phar/stream.h +++ a/ext/phar/stream.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | phar php single-file executable PHP extension | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2012 The PHP Group | + | Copyright (c) 2006-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git b/ext/phar/stub.h a/ext/phar/stub.h index 3bb12c0..daafa39 100644 --- b/ext/phar/stub.h +++ a/ext/phar/stub.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | phar php single-file executable PHP extension generated stub | +----------------------------------------------------------------------+ - | Copyright (c) 2005-2012 The PHP Group | + | Copyright (c) 2005-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git b/ext/phar/tar.c a/ext/phar/tar.c index 43d1ede..f170335 100644 --- b/ext/phar/tar.c +++ a/ext/phar/tar.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | TAR archive support for Phar | +----------------------------------------------------------------------+ - | Copyright (c) 2005-2012 The PHP Group | + | Copyright (c) 2005-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git b/ext/phar/tar.h a/ext/phar/tar.h index ed99346..8bfc381 100644 --- b/ext/phar/tar.h +++ a/ext/phar/tar.h @@ -4,7 +4,7 @@ +----------------------------------------------------------------------+ | TAR archive support for Phar | +----------------------------------------------------------------------+ - | Copyright (c) 2005-2012 The PHP Group | + | Copyright (c) 2005-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git b/ext/phar/util.c a/ext/phar/util.c index 08faaa6..4f36478 100644 --- b/ext/phar/util.c +++ a/ext/phar/util.c @@ -3,7 +3,7 @@ | phar php single-file executable PHP extension | | utility functions | +----------------------------------------------------------------------+ - | Copyright (c) 2005-2012 The PHP Group | + | Copyright (c) 2005-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git b/ext/phar/zip.c a/ext/phar/zip.c index 3372622..33732fb 100644 --- b/ext/phar/zip.c +++ a/ext/phar/zip.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | ZIP archive support for Phar | +----------------------------------------------------------------------+ - | Copyright (c) 2007-2012 The PHP Group | + | Copyright (c) 2007-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git b/ext/soap/php_xml.c a/ext/soap/php_xml.c index 65abed1..2f2c5c9 100644 --- b/ext/soap/php_xml.c +++ a/ext/soap/php_xml.c @@ -20,6 +20,7 @@ /* $Id$ */ #include "php_soap.h" +#include "ext/libxml/php_libxml.h" #include "libxml/parser.h" #include "libxml/parserInternals.h" @@ -91,13 +92,17 @@ xmlDocPtr soap_xmlParseFile(const char *filename TSRMLS_DC) ctxt = xmlCreateFileParserCtxt(filename); PG(allow_url_fopen) = old_allow_url_fopen; if (ctxt) { + zend_bool old; + ctxt->keepBlanks = 0; ctxt->sax->ignorableWhitespace = soap_ignorableWhitespace; ctxt->sax->comment = soap_Comment; ctxt->sax->warning = NULL; ctxt->sax->error = NULL; /*ctxt->sax->fatalError = NULL;*/ + old = php_libxml_disable_entity_loader(1 TSRMLS_CC); xmlParseDocument(ctxt); + php_libxml_disable_entity_loader(old TSRMLS_CC); if (ctxt->wellFormed) { ret = ctxt->myDoc; if (ret->URL == NULL && ctxt->directory != NULL) { @@ -128,11 +133,15 @@ xmlDocPtr soap_xmlParseMemory(const void *buf, size_t buf_size) xmlParserCtxtPtr ctxt = NULL; xmlDocPtr ret; + TSRMLS_FETCH(); + /* xmlInitParser(); */ ctxt = xmlCreateMemoryParserCtxt(buf, buf_size); if (ctxt) { + zend_bool old; + ctxt->sax->ignorableWhitespace = soap_ignorableWhitespace; ctxt->sax->comment = soap_Comment; ctxt->sax->warning = NULL; @@ -141,7 +150,9 @@ xmlDocPtr soap_xmlParseMemory(const void *buf, size_t buf_size) #if LIBXML_VERSION >= 20703 ctxt->options |= XML_PARSE_HUGE; #endif + old = php_libxml_disable_entity_loader(1 TSRMLS_CC); xmlParseDocument(ctxt); + php_libxml_disable_entity_loader(old TSRMLS_CC); if (ctxt->wellFormed) { ret = ctxt->myDoc; if (ret->URL == NULL && ctxt->directory != NULL) { diff --git b/ext/soap/soap.c a/ext/soap/soap.c index 843f49b..6851a9b 100644 --- b/ext/soap/soap.c +++ a/ext/soap/soap.c @@ -568,10 +568,44 @@ ZEND_INI_MH(OnUpdateCacheMode) return SUCCESS; } +static PHP_INI_MH(OnUpdateCacheDir) +{ + /* Only do the safemode/open_basedir check at runtime */ + if (stage == PHP_INI_STAGE_RUNTIME || stage == PHP_INI_STAGE_HTACCESS) { + char *p; + + if (memchr(new_value, '\0', new_value_length) != NULL) { + return FAILURE; + } + + /* we do not use zend_memrchr() since path can contain ; itself */ + if ((p = strchr(new_value, ';'))) { + char *p2; + p++; + if ((p2 = strchr(p, ';'))) { + p = p2 + 1; + } + } else { + p = new_value; + } + + if (PG(safe_mode) && *p && (!php_checkuid(p, NULL, CHECKUID_CHECK_FILE_AND_DIR))) { + return FAILURE; + } + + if (PG(open_basedir) && *p && php_check_open_basedir(p TSRMLS_CC)) { + return FAILURE; + } + } + + OnUpdateString(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC); + return SUCCESS; +} + PHP_INI_BEGIN() STD_PHP_INI_ENTRY("soap.wsdl_cache_enabled", "1", PHP_INI_ALL, OnUpdateBool, cache_enabled, zend_soap_globals, soap_globals) -STD_PHP_INI_ENTRY("soap.wsdl_cache_dir", "/tmp", PHP_INI_ALL, OnUpdateString, +STD_PHP_INI_ENTRY("soap.wsdl_cache_dir", "/tmp", PHP_INI_ALL, OnUpdateCacheDir, cache_dir, zend_soap_globals, soap_globals) STD_PHP_INI_ENTRY("soap.wsdl_cache_ttl", "86400", PHP_INI_ALL, OnUpdateLong, cache_ttl, zend_soap_globals, soap_globals) diff --git b/ext/spl/spl_array.c a/ext/spl/spl_array.c index 7c2e148..77453d6 100644 --- b/ext/spl/spl_array.c +++ a/ext/spl/spl_array.c @@ -387,7 +387,11 @@ static zval *spl_array_read_dimension_ex(int check_inherited, zval *object, zval spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC); if (intern->fptr_offset_get) { zval *rv; - SEPARATE_ARG_IF_REF(offset); + if (!offset) { + ALLOC_INIT_ZVAL(offset); + } else { + SEPARATE_ARG_IF_REF(offset); + } zend_call_method_with_1_params(&object, Z_OBJCE_P(object), &intern->fptr_offset_get, "offsetGet", &rv, offset); zval_ptr_dtor(&offset); if (rv) { @@ -404,7 +408,7 @@ static zval *spl_array_read_dimension_ex(int check_inherited, zval *object, zval /* When in a write context, * ZE has to be fooled into thinking this is in a reference set * by separating (if necessary) and returning as an is_ref=1 zval (even if refcount == 1) */ - if ((type == BP_VAR_W || type == BP_VAR_RW) && !Z_ISREF_PP(ret)) { + if ((type == BP_VAR_W || type == BP_VAR_RW || type == BP_VAR_UNSET) && !Z_ISREF_PP(ret)) { if (Z_REFCOUNT_PP(ret) > 1) { zval *newval; diff --git b/ext/spl/spl_directory.c a/ext/spl/spl_directory.c index 0638836..13af781 100644 --- b/ext/spl/spl_directory.c +++ a/ext/spl/spl_directory.c @@ -1431,6 +1431,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; @@ -1442,7 +1443,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)); } /* }}} */ @@ -1873,6 +1874,10 @@ static int spl_filesystem_object_cast(zval *readobj, zval *writeobj, int type TS spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(readobj TSRMLS_CC); if (type == IS_STRING) { + if (Z_OBJCE_P(readobj)->__tostring) { + return std_object_handlers.cast_object(readobj, writeobj, type TSRMLS_CC); + } + switch (intern->type) { case SPL_FS_INFO: case SPL_FS_FILE: diff --git b/ext/spl/spl_fixedarray.c a/ext/spl/spl_fixedarray.c index 559cac2..646c002 100644 --- b/ext/spl/spl_fixedarray.c +++ a/ext/spl/spl_fixedarray.c @@ -361,7 +361,11 @@ static zval *spl_fixedarray_object_read_dimension(zval *object, zval *offset, in if (intern->fptr_offset_get) { zval *rv; - SEPARATE_ARG_IF_REF(offset); + if (!offset) { + ALLOC_INIT_ZVAL(offset); + } else { + SEPARATE_ARG_IF_REF(offset); + } zend_call_method_with_1_params(&object, intern->std.ce, &intern->fptr_offset_get, "offsetGet", &rv, offset); zval_ptr_dtor(&offset); if (rv) { @@ -607,8 +611,6 @@ SPL_METHOD(SplFixedArray, count) SPL_METHOD(SplFixedArray, toArray) { spl_fixedarray_object *intern; - zval *ret, *tmp; - HashTable *ret_ht, *obj_ht; if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "")) { return; @@ -616,15 +618,19 @@ SPL_METHOD(SplFixedArray, toArray) intern = (spl_fixedarray_object *)zend_object_store_get_object(getThis() TSRMLS_CC); - ALLOC_HASHTABLE(ret_ht); - zend_hash_init(ret_ht, 0, NULL, ZVAL_PTR_DTOR, 0); - ALLOC_INIT_ZVAL(ret); - Z_TYPE_P(ret) = IS_ARRAY; - obj_ht = spl_fixedarray_object_get_properties(getThis() TSRMLS_CC); - zend_hash_copy(ret_ht, obj_ht, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *)); - Z_ARRVAL_P(ret) = ret_ht; - - RETURN_ZVAL(ret, 1, 1); + array_init(return_value); + if (intern->array) { + int i = 0; + for (; i < intern->array->size; i++) { + if (intern->array->elements[i]) { + zend_hash_index_update(Z_ARRVAL_P(return_value), i, (void *)&intern->array->elements[i], sizeof(zval *), NULL); + Z_ADDREF_P(intern->array->elements[i]); + } else { + zend_hash_index_update(Z_ARRVAL_P(return_value), i, (void *)&EG(uninitialized_zval_ptr), sizeof(zval *), NULL); + Z_ADDREF_P(EG(uninitialized_zval_ptr)); + } + } + } } /* }}} */ diff --git b/ext/spl/tests/bug52861.phpt a/ext/spl/tests/bug52861.phpt new file mode 100644 index 0000000..30a3261 --- /dev/null +++ a/ext/spl/tests/bug52861.phpt @@ -0,0 +1,22 @@ +--TEST-- +Bug #52861 (unset failes with ArrayObject and deep arrays) +--FILE-- +<?php +$arrayObject = new ArrayObject(array('foo' => array('bar' => array('baz' => 'boo')))); + +unset($arrayObject['foo']['bar']['baz']); +print_r($arrayObject->getArrayCopy()); +?> +--EXPECT-- +Array +( + [foo] => Array + ( + [bar] => Array + ( + ) + + ) + +) + diff --git b/ext/spl/tests/bug64023.phpt a/ext/spl/tests/bug64023.phpt new file mode 100644 index 0000000..2c177f9 --- /dev/null +++ a/ext/spl/tests/bug64023.phpt @@ -0,0 +1,20 @@ +--TEST-- +Bug #64023: Overloading __toString() in SplFileInfo has no effect +--FILE-- +<?php +class A extends \SplFileInfo +{ + public function __toString() {return ' -expected- ';} +} + +$a = new A('/'); + +// Works +echo $a, $a->__toString(), $a->__toString() . '', "\n"; + +// Does not work - outputs parent::__toString() +echo $a . '', "\n"; + +--EXPECT-- + -expected- -expected- -expected- + -expected- diff --git b/ext/spl/tests/bug64106.phpt a/ext/spl/tests/bug64106.phpt new file mode 100644 index 0000000..855caef --- /dev/null +++ a/ext/spl/tests/bug64106.phpt @@ -0,0 +1,15 @@ +--TEST-- +Bug #64106: Segfault on SplFixedArray[][x] = y when extended +--FILE-- +<?php + +class MyFixedArray extends SplFixedArray { + public function offsetGet($offset) {} +} + +$array = new MyFixedArray(10); +$array[][1] = 10; + +?> +--EXPECTF-- +Notice: Indirect modification of overloaded element of MyFixedArray has no effect in %s on line %d diff --git b/ext/spl/tests/bug64228.phpt a/ext/spl/tests/bug64228.phpt new file mode 100644 index 0000000..3f30dd2 --- /dev/null +++ a/ext/spl/tests/bug64228.phpt @@ -0,0 +1,25 @@ +--TEST-- +Bug #64228 (RecursiveDirectoryIterator always assumes SKIP_DOTS) +--FILE-- +<?php +$dirs = array(); +$empty_dir = __DIR__ . "/empty"; +@mkdir($empty_dir); + +$i = new RecursiveDirectoryIterator($empty_dir, FilesystemIterator::KEY_AS_PATHNAME | FilesystemIterator::CURRENT_AS_FILEINFO); // Note the absence of FilesystemIterator::SKIP_DOTS +foreach ($i as $key => $value) { + $dirs[] = $value->getFileName(); +} + +@rmdir($empty_dir); + +sort($dirs); +print_r($dirs); +?> +--EXPECT-- +Array +( + [0] => . + [1] => .. +) + diff --git b/ext/spl/tests/bug64264.phpt a/ext/spl/tests/bug64264.phpt new file mode 100644 index 0000000..e7b695b --- /dev/null +++ a/ext/spl/tests/bug64264.phpt @@ -0,0 +1,29 @@ +--TEST-- +Bug #64264 (SPLFixedArray toArray problem) +--FILE-- +<?php +class MyFixedArray extends \SplFixedArray { + protected $foo; + protected $bar; +} + +$myFixedArr = new MyFixedArray(1); +$myFixedArr[0] = 'foo'; +$myFixedArr->setSize(2); +$myFixedArr[1] = 'bar'; +$myFixedArr->setSize(5); +$array = $myFixedArr->toArray(); +$array[2] = "ERROR"; +$array[3] = "ERROR"; +$array[4] = "ERROR"; +unset($array[4]); +$myFixedArr->setSize(2); + +print_r($myFixedArr->toArray()); +?> +--EXPECTF-- +Array +( + [0] => foo + [1] => bar +) diff --git b/ext/standard/string.c a/ext/standard/string.c index b17ad50..907301d 100644 --- b/ext/standard/string.c +++ a/ext/standard/string.c @@ -1744,7 +1744,7 @@ PHP_FUNCTION(strpos) if (Z_TYPE_P(needle) == IS_STRING) { if (!Z_STRLEN_P(needle)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty delimiter"); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty needle"); RETURN_FALSE; } diff --git b/ext/standard/tests/network/http-stream.phpt a/ext/standard/tests/network/http-stream.phpt index 6ee035a..99245f7 100644 --- b/ext/standard/tests/network/http-stream.phpt +++ a/ext/standard/tests/network/http-stream.phpt @@ -3,6 +3,7 @@ http-stream test --SKIPIF-- <?php if (getenv("SKIP_SLOW_TESTS")) die("skip slow test"); +if (getenv("SKIP_ONLINE_TESTS")) die("skip online test"); if (!extension_loaded("dom")) die("skip dom extension is not present"); ?> --INI-- diff --git b/ext/standard/tests/strings/bug63943.phpt a/ext/standard/tests/strings/bug63943.phpt new file mode 100644 index 0000000..6018879 --- /dev/null +++ a/ext/standard/tests/strings/bug63943.phpt @@ -0,0 +1,8 @@ +--TEST-- +Bug #63943 (Bad warning text from strpos() on empty needle) +--FILE-- +<?php +strpos("lllllll", ''); +?> +--EXPECTF-- +Warning: strpos(): Empty needle in %sbug63943.php on line %d diff --git b/ext/standard/tests/strings/strpos.phpt a/ext/standard/tests/strings/strpos.phpt index 706ddfd..9b44584 100644 Binary files b/ext/standard/tests/strings/strpos.phpt and a/ext/standard/tests/strings/strpos.phpt differ diff --git b/main/php_version.h a/main/php_version.h index e9d79f8..3add96c 100644 --- b/main/php_version.h +++ a/main/php_version.h @@ -2,7 +2,7 @@ /* edit configure.in to change version number */ #define PHP_MAJOR_VERSION 5 #define PHP_MINOR_VERSION 3 -#define PHP_RELEASE_VERSION 21 -#define PHP_EXTRA_VERSION "" -#define PHP_VERSION "5.3.21" -#define PHP_VERSION_ID 50321 +#define PHP_RELEASE_VERSION 23 +#define PHP_EXTRA_VERSION "RC1" +#define PHP_VERSION "5.3.23RC1" +#define PHP_VERSION_ID 50323 diff --git b/sapi/fpm/fpm/fpm_sockets.h a/sapi/fpm/fpm/fpm_sockets.h index 499ba6b..cce5712 100644 --- b/sapi/fpm/fpm/fpm_sockets.h +++ a/sapi/fpm/fpm/fpm_sockets.h @@ -25,7 +25,7 @@ enum fpm_address_domain fpm_sockets_domain_from_address(char *addr); int fpm_sockets_init_main(); int fpm_socket_get_listening_queue(int sock, unsigned *cur_lq, unsigned *max_lq); -int fpm_socket_unix_test_connect(struct sockaddr_un *sun, size_t socklen); +int fpm_socket_unix_test_connect(struct sockaddr_un *sock, size_t socklen); static inline int fd_set_blocked(int fd, int blocked) /* {{{ */ diff --git b/win32/build/libs_version.txt a/win32/build/libs_version.txt index 5895e7b..b5d62ae 100644 --- b/win32/build/libs_version.txt +++ a/win32/build/libs_version.txt @@ -1,17 +1,17 @@ bz2-1.0.6 cclient-2007e -freetype-2.4.3 +freetype-2.4.10 icu-49.1.2 -jpeglib-6b -libcurl-7.27.0 +jpeglib-8 +libcurl-7.29.0 libiconv-1.14 libmcrypt-2.5.8 libmpir-1.3.1 -libpng-1.2.46 +libpng-1.2.50 libpq-8.3.6 libssh2-1.4.2 libtidy-20090325 libxslt-1.1.27 libxml-2.7.8 -openssl-0.9.8x +openssl-0.9.8y diff --git b/win32/registry.c a/win32/registry.c index 638d85a..685a09d 100644 --- b/win32/registry.c +++ a/win32/registry.c @@ -91,6 +91,7 @@ static int LoadDirectory(HashTable *directories, HKEY key, char *path, int path_ INIT_PZVAL(data); Z_STRVAL_P(data) = zend_strndup(value, value_len-1); Z_STRLEN_P(data) = value_len-1; + Z_TYPE_P(data) = IS_STRING; zend_hash_update(ht, name, name_len+1, &data, sizeof(zval*), NULL); } }