]> granicus.if.org Git - php/commitdiff
Merge branch 'master' into throw-error-in-extensions
authorAaron Piotrowski <aaron@trowski.com>
Sat, 11 Jun 2016 03:02:23 +0000 (22:02 -0500)
committerAaron Piotrowski <aaron@trowski.com>
Sat, 11 Jun 2016 03:02:23 +0000 (22:02 -0500)
20 files changed:
1  2 
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
ext/reflection/php_reflection.c
ext/session/mod_user.c
ext/session/session.c
ext/simplexml/simplexml.c
ext/spl/spl_directory.c
ext/spl/spl_iterators.c
ext/tidy/tidy.c
ext/xmlrpc/xmlrpc-epi-php.c
ext/zip/php_zip.c

Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc ext/ldap/ldap.c
Simple merge
index 1423a6ffa63d913e5ffeffe0914762ea735d5bdd,457ee2ff08b27296f565e5bfdf3ac7b71b2c631b..14e8da4548376fa6d74ec11f8cc3a59afa926698
@@@ -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 */
Simple merge
Simple merge
Simple merge
index 4684954567fddcd8b00152c870f480c536d29b42,13003cae845b769a2497168433e8c74c80ef1221..3138ee41d7ea2854b6dd7624d5b867b2b85db472
@@@ -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;
Simple merge
index 7baec3255d1cb5a90e239e844a8d90cc5f3264cc,6fd0ee2f37b15bfa1003b8ac476b39f92ffd0ed4..e3723a34c68ca35ca419e2b55dbbee882e0f71b7
@@@ -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_error_docref(NULL, E_ERROR, "Failed to create session ID: %s (path: %s)", PS(mod)->s_name, PS(save_path));
+                       php_session_abort();
 +                      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)) {
Simple merge
Simple merge
Simple merge
diff --cc ext/tidy/tidy.c
Simple merge
Simple merge
Simple merge