com php-src: Merge branch 'master' into throw-error-in-extensions: ext/date/php_date.c ext/dom/document.c ext/dom/php_ dom.c ext/dom/php_dom.h
ext/imap/php_imap.c ext /intl/transliterator/transliterator_class.c ext/ldap/ldap .c ext/mbstring/php_mbregex.c ext/mysqli/mysqli.c
ext/openssl/openssl.c ext/pdo_odbc/pdo_odbc.c ex t/reflection/php_reflection.c ext/session/mod_user.c ext/session/session.c ext/simplexml/simplexml.c
ext/ spl/spl_directory.c ext/s
| From: | Aaron Piotrowski | Date: | Sat, 11 Jun 2016 03:02:23 +0000 |
| Subject: | com php-src: Merge branch 'master' into throw-error-in-extensions: ext/date/php_date.c ext/dom/document.c ext/dom/php_ dom.c ext/dom/php_dom.h ext/imap/php_imap.c ext /intl/transliterator/transliterator_class.c ext/ldap/ldap .c ext/mbstring/php_mbregex.c ext/mysqli/mysqli.c ext/openssl/openssl.c ext/pdo_odbc/pdo_odbc.c ex t/reflection/php_reflection.c ext/session/mod_user.c ext/session/session.c ext/simplexml/simplexml.c ext/ spl/spl_directory.c ext/s |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-92780@lists.php.net to get a copy of this message | ||
Commit: e3c681aa5cc71122a8d2fae42e6513fc413ccac8
Author: Aaron Piotrowski <aaron@trowski.com> Fri, 10 Jun 2016 22:02:23 -0500
Parents: fb4e3085cbaa76eb8f28eebf848a81d1c0190067 792e89385ca6fc722a03590722eb7745a2374720
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=e3c681aa5cc71122a8d2fae42e6513fc413ccac8
Log:
Merge branch 'master' into throw-error-in-extensions
Changed paths:
MM ext/date/php_date.c
MM ext/dom/document.c
MM ext/dom/php_dom.c
MM ext/dom/php_dom.h
MM ext/imap/php_imap.c
MM ext/intl/transliterator/transliterator_class.c
MM ext/ldap/ldap.c
MM ext/mbstring/php_mbregex.c
MM ext/mysqli/mysqli.c
MM ext/openssl/openssl.c
MM ext/pdo_odbc/pdo_odbc.c
MM ext/reflection/php_reflection.c
MM ext/session/mod_user.c
MM ext/session/session.c
MM ext/simplexml/simplexml.c
MM ext/spl/spl_directory.c
MM ext/spl/spl_iterators.c
MM ext/tidy/tidy.c
MM ext/xmlrpc/xmlrpc-epi-php..c
MM ext/zip/php_zip.c
Diff:
diff --cc ext/mbstring/php_mbregex.c
index 1423a6f,457ee2f..14e8da4
--- a/ext/mbstring/php_mbregex.c
+++ b/ext/mbstring/php_mbregex.c
@@@ -939,16 -935,21 +936,21 @@@ static void _php_mb_regex_ereg_replace_
if (eval) {
zval v;
+ zend_string *eval_str;
/* null terminate buffer */
smart_str_0(&eval_buf);
+
+ if (eval_buf.s) {
+ eval_str = eval_buf.s;
+ } else {
+ eval_str = ZSTR_EMPTY_ALLOC();
+ }
+
/* do eval */
- if (zend_eval_stringl(ZSTR_VAL(eval_buf.s), ZSTR_LEN(eval_buf.s), &v, description) ==
FAILURE) {
+ if (zend_eval_stringl(ZSTR_VAL(eval_str), ZSTR_LEN(eval_str), &v, description) == FAILURE)
{
efree(description);
- zend_throw_error(zend_ce_error, "Failed evaluating code: %s%s", PHP_EOL,
ZSTR_VAL(eval_buf.s));
- onig_region_free(regs, 0);
- smart_str_free(&out_buf);
- smart_str_free(&eval_buf);
- RETURN_FALSE;
- php_error_docref(NULL,E_ERROR, "Failed evaluating code: %s%s", PHP_EOL,
ZSTR_VAL(eval_str));
++ zend_throw_error(NULL, "Failed evaluating code: %s%s", PHP_EOL,
ZSTR_VAL(eval_str));
+ /* zend_error() does not return in this case */
}
/* result of eval */
diff --cc ext/reflection/php_reflection.c
index 4684954,13003ca..3138ee4
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@@ -104,10 -105,9 +105,10 @@@ ZEND_DECLARE_MODULE_GLOBALS(reflection
#define GET_REFLECTION_OBJECT()
\
intern = Z_REFLECTION_P(getThis()); \
- if (intern == NULL || intern->ptr == NULL) {
\
+ if (intern->ptr == NULL) { \
RETURN_ON_EXCEPTION
\
- php_error_docref(NULL, E_ERROR, "Internal error: Failed to retrieve the reflection
object"); \
+ zend_throw_error(zend_ce_error, "Internal error: Failed to retrieve the reflection
object"); \
+ return;
\
}
\
#define GET_REFLECTION_OBJECT_PTR(target)
\
@@@ -4956,9 -5187,9 +5189,9 @@@ ZEND_METHOD(reflection_class, isSubclas
case IS_OBJECT:
if (instanceof_function(Z_OBJCE_P(class_name), reflection_class_ptr)) {
argument = Z_REFLECTION_P(class_name);
- if (argument == NULL || argument->ptr == NULL) {
+ if (argument->ptr == NULL) {
- php_error_docref(NULL, E_ERROR, "Internal error: Failed to retrieve the argument's
reflection object");
- /* Bails out */
+ zend_throw_error(zend_ce_error, "Internal error: Failed to retrieve the argument's
reflection object");
+ return;
}
class_ce = argument->ptr;
break;
@@@ -5000,9 -5231,9 +5233,9 @@@ ZEND_METHOD(reflection_class, implement
case IS_OBJECT:
if (instanceof_function(Z_OBJCE_P(interface), reflection_class_ptr)) {
argument = Z_REFLECTION_P(interface);
- if (argument == NULL || argument->ptr == NULL) {
+ if (argument->ptr == NULL) {
- php_error_docref(NULL, E_ERROR, "Internal error: Failed to retrieve the argument's
reflection object");
- /* Bails out */
+ zend_throw_error(zend_ce_error, "Internal error: Failed to retrieve the argument's
reflection object");
+ return;
}
interface_ce = argument->ptr;
break;
@@@ -5397,10 -5633,12 +5635,12 @@@ ZEND_METHOD(reflection_property, getVal
return;
}
if (Z_TYPE(CE_STATIC_MEMBERS(intern->ce)[ref->prop.offset]) == IS_UNDEF) {
- php_error_docref(NULL, E_ERROR, "Internal error: Could not find the property %s::%s",
ZSTR_VAL(intern->ce->name), ZSTR_VAL(ref->prop.name));
+ zend_throw_error(zend_ce_error, "Internal error: Could not find the property %s::%s",
ZSTR_VAL(intern->ce->name), ZSTR_VAL(ref->prop..name));
/* Bails out */
}
- ZVAL_DUP(return_value, &CE_STATIC_MEMBERS(intern->ce)[ref->prop.offset]);
+ member_p = &CE_STATIC_MEMBERS(intern->ce)[ref->prop.offset];
+ ZVAL_DEREF(member_p);
+ ZVAL_COPY(return_value, member_p);
} else {
const char *class_name, *prop_name;
size_t prop_name_len;
diff --cc ext/session/session.c
index 7baec32,6fd0ee2..e3723a3
--- a/ext/session/session.c
+++ b/ext/session/session.c
@@@ -494,10 -522,14 +523,14 @@@ static void php_session_initialize(void
}
/* If there is no ID, use session module to create one */
- if (!PS(id)) {
+ if (!PS(id) || !ZSTR_VAL(PS(id))[0]) {
+ if (PS(id)) {
+ zend_string_release(PS(id));
+ }
PS(id) = PS(mod)->s_create_sid(&PS(mod_data));
if (!PS(id)) {
+ php_session_abort();
- php_error_docref(NULL, E_ERROR, "Failed to create session ID: %s (path: %s)",
PS(mod)->s_name, PS(save_path));
+ zend_throw_error(zend_ce_error, "Failed to create session ID: %s (path: %s)",
PS(mod)->s_name, PS(save_path));
return;
}
if (PS(use_cookies)) {