From d143c2b60f87f5cd221bd070bfde887374b74eb4 Mon Sep 17 00:00:00 2001 From: Stanislav Malyshev Date: Sat, 28 Sep 2013 18:04:44 -0700 Subject: [PATCH 1/4] 5.4.20 release date --- NEWS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NEWS b/NEWS index e17632543c4..37daabb18f8 100644 --- a/NEWS +++ b/NEWS @@ -23,7 +23,7 @@ PHP NEWS . Fixed bug #65721 (configure script broken in 5.5.4 and 5.4.20 when enabling imap). (ryotakatsuki at gmail dot com) -?? ??? 2013, PHP 5.4.20 +19 Sep 2013, PHP 5.4.20 - Core: . Fixed bug #60598 (cli/apache sapi segfault on objects manipulation). From f0c926564c5f7de9462d9ca7bd75014b14a63f56 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Sun, 29 Sep 2013 17:58:25 +0200 Subject: [PATCH 2/4] Fix bug #65322: compile time errors won't trigger auto loading Also fixes duplicate bugs #54054 and #42098. Furthermore this fixes incorrect error messages thrown from code running inside an error handler when a compilation is in progress. The error file and line are now correctly associated with the file/line of the executor, rather than the compiler. --- NEWS | 3 +++ Zend/tests/bug65322.phpt | 22 ++++++++++++++++++++++ Zend/tests/errmsg_045.phpt | 18 ++++++++++++++++++ Zend/zend.c | 4 +++- 4 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 Zend/tests/bug65322.phpt create mode 100644 Zend/tests/errmsg_045.phpt diff --git a/NEWS b/NEWS index 37daabb18f8..4dc7ef7c18e 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,9 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?? ??? 2013, PHP 5.4.21 +- Core: + . Fixed bug #65322 (compile time errors won't trigger auto loading). (Nikita) + - CLI server: . Fixed bug #65633 (built-in server treat some http headers as case-sensitive). (Adam) diff --git a/Zend/tests/bug65322.phpt b/Zend/tests/bug65322.phpt new file mode 100644 index 00000000000..aab163d915e --- /dev/null +++ b/Zend/tests/bug65322.phpt @@ -0,0 +1,22 @@ +--TEST-- +Bug #65322: compile time errors won't trigger auto loading +--FILE-- + +--EXPECTF-- +string(50) "Redefining already defined constructor for class A" +string(%d) "%s(%d) : eval()'d code" +string(1) "B" diff --git a/Zend/tests/errmsg_045.phpt b/Zend/tests/errmsg_045.phpt new file mode 100644 index 00000000000..b27f67ade4c --- /dev/null +++ b/Zend/tests/errmsg_045.phpt @@ -0,0 +1,18 @@ +--TEST-- +Error message in error handler during compilation +--FILE-- + +--EXPECTF-- +string(50) "Redefining already defined constructor for class A" +string(%d) "%s(%d) : eval()'d code" + +Notice: Undefined variable: undefined in %s on line %d diff --git a/Zend/zend.c b/Zend/zend.c index 162922866b6..0602c450426 100644 --- a/Zend/zend.c +++ b/Zend/zend.c @@ -1183,7 +1183,7 @@ ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */ * such scripts recursivly, but some CG() variables may be * inconsistent. */ - in_compilation = zend_is_compiling(TSRMLS_C); + in_compilation = CG(in_compilation); if (in_compilation) { saved_class_entry = CG(active_class_entry); CG(active_class_entry) = NULL; @@ -1195,6 +1195,7 @@ ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */ SAVE_STACK(declare_stack); SAVE_STACK(list_stack); SAVE_STACK(context_stack); + CG(in_compilation) = 0; } if (call_user_function_ex(CG(function_table), NULL, orig_user_error_handler, &retval, 5, params, 1, NULL TSRMLS_CC) == SUCCESS) { @@ -1219,6 +1220,7 @@ ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */ RESTORE_STACK(declare_stack); RESTORE_STACK(list_stack); RESTORE_STACK(context_stack); + CG(in_compilation) = 1; } if (!EG(user_error_handler)) { From e9e63f922303d852b6899cadd68d7ec73e8f6134 Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Mon, 30 Sep 2013 11:23:33 +0200 Subject: [PATCH 3/4] fix memleak on resetting rebind_proc --- ext/ldap/ldap.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ext/ldap/ldap.c b/ext/ldap/ldap.c index 3cfa2092e77..71d57d6d9b9 100644 --- a/ext/ldap/ldap.c +++ b/ext/ldap/ldap.c @@ -2107,6 +2107,7 @@ PHP_FUNCTION(ldap_set_rebind_proc) /* unregister rebind procedure */ if (ld->rebindproc != NULL) { zval_dtor(ld->rebindproc); + FREE_ZVAL(ld->rebindproc); ld->rebindproc = NULL; ldap_set_rebind_proc(ld->link, NULL, NULL); } From 2b78edfba25afac8f34ca65e18f98d23a4b8bcce Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Mon, 30 Sep 2013 11:41:35 +0200 Subject: [PATCH 4/4] fix test --- ext/ldap/tests/ldap_search_variation6.phpt | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/ext/ldap/tests/ldap_search_variation6.phpt b/ext/ldap/tests/ldap_search_variation6.phpt index a29e4524df4..5139ebb77de 100644 --- a/ext/ldap/tests/ldap_search_variation6.phpt +++ b/ext/ldap/tests/ldap_search_variation6.phpt @@ -217,14 +217,26 @@ array(2) { [1]=> resource(%d) of type (ldap result) } -NULL -NULL +array(1) { + ["count"]=> + int(0) +} +array(1) { + ["count"]=> + int(0) +} array(2) { [0]=> resource(%d) of type (ldap result) [1]=> resource(%d) of type (ldap result) } -NULL -NULL +array(1) { + ["count"]=> + int(0) +} +array(1) { + ["count"]=> + int(0) +} ===DONE===