stas                                     Sun, 29 Nov 2009 04:38:46 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=291413

Log:
fix interrupt problem in serialize()

Changed paths:
    U   php/php-src/branches/PHP_5_2/ext/standard/var.c
    U   php/php-src/branches/PHP_5_3/ext/standard/var.c
    U   php/php-src/trunk/ext/standard/var.c

Modified: php/php-src/branches/PHP_5_2/ext/standard/var.c
===================================================================
--- php/php-src/branches/PHP_5_2/ext/standard/var.c     2009-11-29 04:11:31 UTC 
(rev 291412)
+++ php/php-src/branches/PHP_5_2/ext/standard/var.c     2009-11-29 04:38:46 UTC 
(rev 291413)
@@ -631,9 +631,9 @@
                                                        break;
                                                }
                                                pefree(prot_name, ce->type & 
ZEND_INTERNAL_CLASS);
-                                               php_error_docref(NULL 
TSRMLS_CC, E_NOTICE, "\"%s\" returned as member variable from __sleep() but 
does not exist", Z_STRVAL_PP(name));
                                                php_var_serialize_string(buf, 
Z_STRVAL_PP(name), Z_STRLEN_PP(name));
                                                php_var_serialize_intern(buf, 
nvalp, var_hash TSRMLS_CC);
+                                               php_error_docref(NULL 
TSRMLS_CC, E_NOTICE, "\"%s\" returned as member variable from __sleep() but 
does not exist", Z_STRVAL_PP(name));
                                        } while (0);
                                } else {
                                        php_var_serialize_string(buf, 
Z_STRVAL_PP(name), Z_STRLEN_PP(name));

Modified: php/php-src/branches/PHP_5_3/ext/standard/var.c
===================================================================
--- php/php-src/branches/PHP_5_3/ext/standard/var.c     2009-11-29 04:11:31 UTC 
(rev 291412)
+++ php/php-src/branches/PHP_5_3/ext/standard/var.c     2009-11-29 04:38:46 UTC 
(rev 291413)
@@ -612,9 +612,9 @@
                                                        break;
                                                }
                                                pefree(prot_name, ce->type & 
ZEND_INTERNAL_CLASS);
-                                               php_error_docref(NULL 
TSRMLS_CC, E_NOTICE, "\"%s\" returned as member variable from __sleep() but 
does not exist", Z_STRVAL_PP(name));
                                                php_var_serialize_string(buf, 
Z_STRVAL_PP(name), Z_STRLEN_PP(name));
                                                php_var_serialize_intern(buf, 
nvalp, var_hash TSRMLS_CC);
+                                               php_error_docref(NULL 
TSRMLS_CC, E_NOTICE, "\"%s\" returned as member variable from __sleep() but 
does not exist", Z_STRVAL_PP(name));
                                        } while (0);
                                } else {
                                        php_var_serialize_string(buf, 
Z_STRVAL_PP(name), Z_STRLEN_PP(name));

Modified: php/php-src/trunk/ext/standard/var.c
===================================================================
--- php/php-src/trunk/ext/standard/var.c        2009-11-29 04:11:31 UTC (rev 
291412)
+++ php/php-src/trunk/ext/standard/var.c        2009-11-29 04:38:46 UTC (rev 
291413)
@@ -832,10 +832,10 @@
                        zend_hash_get_current_data_ex(HASH_OF(retval_ptr), 
(void **) &name, &pos);

                        if (Z_TYPE_PP(name) != IS_UNICODE) {
-                               php_error_docref(NULL TSRMLS_CC, E_NOTICE, 
"__sleep should return an array only containing the names of instance-variables 
to serialize");
                                /* we should still add element even if it's not 
OK,
                                 * since we already wrote the length of the 
array before */
                                smart_str_appendl(buf,"N;", 2);
+                               php_error_docref(NULL TSRMLS_CC, E_NOTICE, 
"__sleep should return an array only containing the names of instance-variables 
to serialize");
                                continue;
                        }
                        if (zend_u_hash_find(Z_OBJPROP_P(struc), 
Z_TYPE_PP(name), Z_UNIVAL_PP(name), Z_UNILEN_PP(name) + 1, (void *) &d) == 
SUCCESS) {
@@ -877,13 +877,13 @@
                                                        break;
                                                }
                                                pefree(prot_name.v, ce->type & 
ZEND_INTERNAL_CLASS);
-                                               php_error_docref(NULL 
TSRMLS_CC, E_NOTICE, "\"%R\" returned as member variable from __sleep() but 
does not exist", Z_TYPE_PP(name), Z_UNIVAL_PP(name));
                                                if (Z_TYPE_PP(name) == 
IS_UNICODE) {
                                                        
php_var_serialize_unicode(buf, Z_USTRVAL_PP(name), Z_USTRLEN_PP(name));
                                                } else {
                                                        
php_var_serialize_string(buf, Z_STRVAL_PP(name), Z_STRLEN_PP(name));
                                                }
                                                php_var_serialize_intern(buf, 
nvalp, var_hash TSRMLS_CC);
+                                               php_error_docref(NULL 
TSRMLS_CC, E_NOTICE, "\"%R\" returned as member variable from __sleep() but 
does not exist", Z_TYPE_PP(name), Z_UNIVAL_PP(name));
                                        } while (0);
                                } else {
                                        if (Z_TYPE_PP(name) == IS_UNICODE) {

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to