sniper          Sat Jun 11 19:55:40 2005 EDT

  Modified files:              (Branch: PHP_4_4)
    /php-src/ext/standard       url_scanner_ex.c var_unserializer.c 
  Log:
  Revert. re2c 0.9.7 obviously does not work properly (or our .re files are 
buggy)
  
  
http://cvs.php.net/diff.php/php-src/ext/standard/url_scanner_ex.c?r1=1.72.2.15.2.1&r2=1.72.2.15.2.2&ty=u
Index: php-src/ext/standard/url_scanner_ex.c
diff -u php-src/ext/standard/url_scanner_ex.c:1.72.2.15.2.1 
php-src/ext/standard/url_scanner_ex.c:1.72.2.15.2.2
--- php-src/ext/standard/url_scanner_ex.c:1.72.2.15.2.1 Sat Jun 11 16:21:50 2005
+++ php-src/ext/standard/url_scanner_ex.c       Sat Jun 11 19:55:39 2005
@@ -1,15 +1,15 @@
-/* Generated by re2c 0.9.7 on Sat Jun 11 22:56:09 2005 */
-#line 1 "/usr/src/php/php5/ext/standard/url_scanner_ex.re"
+/* Generated by re2c 0.9.6 on Sun Jun 12 02:54:26 2005 */
+#line 1 "/usr/src/php/php_4_4/ext/standard/url_scanner_ex.re"
 /*
   +----------------------------------------------------------------------+
-  | PHP Version 5                                                        |
+  | PHP Version 4                                                        |
   +----------------------------------------------------------------------+
-  | Copyright (c) 1997-2004 The PHP Group                                |
+  | Copyright (c) 1997-2003 The PHP Group                                |
   +----------------------------------------------------------------------+
-  | This source file is subject to version 3.0 of the PHP license,       |
+  | This source file is subject to version 2.02 of the PHP license,      |
   | that is bundled with this package in the file LICENSE, and is        |
-  | available through the world-wide-web at the following url:           |
-  | http://www.php.net/license/3_0.txt.                                  |
+  | available at through the world-wide-web at                           |
+  | http://www.php.net/license/2_02.txt.                                 |
   | If you did not receive a copy of the PHP license and are unable to   |
   | obtain it through the world-wide-web, please send a note to          |
   | [EMAIL PROTECTED] so we can mail you a copy immediately.               |
@@ -18,7 +18,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: url_scanner_ex.c,v 1.72.2.15.2.1 2005/06/11 20:21:50 sniper Exp $ */
+/* $Id: url_scanner_ex.c,v 1.72.2.15.2.2 2005/06/11 23:55:39 sniper Exp $ */
 
 #include "php.h"
 
@@ -91,7 +91,7 @@
        STD_PHP_INI_ENTRY("url_rewriter.tags", 
"a=href,area=href,frame=src,form=,fieldset=", PHP_INI_ALL, OnUpdateTags, 
url_adapt_state_ex, php_basic_globals, basic_globals)
 PHP_INI_END()
 
-#line 97 "/usr/src/php/php5/ext/standard/url_scanner_ex.re"
+#line 97 "/usr/src/php/php_4_4/ext/standard/url_scanner_ex.re"
 
 
 #define YYFILL(n) goto done
@@ -109,6 +109,11 @@
        q = (p = url->c) + url->len;
 
 scan:
+
+#line 7 "<stdout>"
+{
+       YYCTYPE yych;
+       unsigned int yyaccept;
        static unsigned char yybm[] = {
        128, 128, 128, 128, 128, 128, 128, 128, 
        128, 128, 128, 128, 128, 128, 128, 128, 
@@ -143,10 +148,6 @@
        128, 128, 128, 128, 128, 128, 128, 128, 
        128, 128, 128, 128, 128, 128, 128, 128, 
        };
-
-#line 148 "<stdout>"
-{
-       YYCTYPE yych;
        goto yy0;
        ++YYCURSOR;
 yy0:
@@ -161,21 +162,21 @@
 yy2:   ++YYCURSOR;
        goto yy3;
 yy3:
-#line 115 "/usr/src/php/php5/ext/standard/url_scanner_ex.re"
+#line 115 "/usr/src/php/php_4_4/ext/standard/url_scanner_ex.re"
 { smart_str_append(dest, url); return; }
-#line 167 "<stdout>"
+#line 61 "<stdout>"
 yy4:   ++YYCURSOR;
        goto yy5;
 yy5:
-#line 116 "/usr/src/php/php5/ext/standard/url_scanner_ex.re"
+#line 116 "/usr/src/php/php_4_4/ext/standard/url_scanner_ex.re"
 { sep = separator; goto scan; }
-#line 173 "<stdout>"
+#line 67 "<stdout>"
 yy6:   ++YYCURSOR;
        goto yy7;
 yy7:
-#line 117 "/usr/src/php/php5/ext/standard/url_scanner_ex.re"
+#line 117 "/usr/src/php/php_4_4/ext/standard/url_scanner_ex.re"
 { bash = p - 1; goto done; }
-#line 179 "<stdout>"
+#line 73 "<stdout>"
 yy8:   ++YYCURSOR;
        if(YYLIMIT == YYCURSOR) YYFILL(1);
        yych = *YYCURSOR;
@@ -185,11 +186,11 @@
        }
        goto yy10;
 yy10:
-#line 118 "/usr/src/php/php5/ext/standard/url_scanner_ex.re"
+#line 118 "/usr/src/php/php_4_4/ext/standard/url_scanner_ex.re"
 { goto scan; }
-#line 191 "<stdout>"
+#line 86 "<stdout>"
 }
-#line 119 "/usr/src/php/php5/ext/standard/url_scanner_ex.re"
+#line 119 "/usr/src/php/php_4_4/ext/standard/url_scanner_ex.re"
 
 done:
        
@@ -357,6 +358,11 @@
        
 state_plain:
        start = YYCURSOR;
+
+#line 90 "<stdout>"
+{
+       YYCTYPE yych;
+       unsigned int yyaccept;
        static unsigned char yybm[] = {
        128, 128, 128, 128, 128, 128, 128, 128, 
        128, 128, 128, 128, 128, 128, 128, 128, 
@@ -391,10 +397,6 @@
        128, 128, 128, 128, 128, 128, 128, 128, 
        128, 128, 128, 128, 128, 128, 128, 128, 
        };
-
-#line 396 "<stdout>"
-{
-       YYCTYPE yych;
        goto yy11;
        ++YYCURSOR;
 yy11:
@@ -407,9 +409,9 @@
 yy13:  ++YYCURSOR;
        goto yy14;
 yy14:
-#line 287 "/usr/src/php/php5/ext/standard/url_scanner_ex.re"
+#line 287 "/usr/src/php/php_4_4/ext/standard/url_scanner_ex.re"
 { passthru(STD_ARGS); STATE = STATE_TAG; goto state_tag; }
-#line 413 "<stdout>"
+#line 142 "<stdout>"
 yy15:  ++YYCURSOR;
        if(YYLIMIT == YYCURSOR) YYFILL(1);
        yych = *YYCURSOR;
@@ -419,15 +421,20 @@
        }
        goto yy17;
 yy17:
-#line 288 "/usr/src/php/php5/ext/standard/url_scanner_ex.re"
+#line 288 "/usr/src/php/php_4_4/ext/standard/url_scanner_ex.re"
 { passthru(STD_ARGS); goto state_plain; }
-#line 425 "<stdout>"
+#line 155 "<stdout>"
 }
-#line 289 "/usr/src/php/php5/ext/standard/url_scanner_ex.re"
+#line 289 "/usr/src/php/php_4_4/ext/standard/url_scanner_ex.re"
 
 
 state_tag:     
        start = YYCURSOR;
+
+#line 159 "<stdout>"
+{
+       YYCTYPE yych;
+       unsigned int yyaccept;
        static unsigned char yybm[] = {
          0,   0,   0,   0,   0,   0,   0,   0, 
          0,   0,   0,   0,   0,   0,   0,   0, 
@@ -462,10 +469,6 @@
          0,   0,   0,   0,   0,   0,   0,   0, 
          0,   0,   0,   0,   0,   0,   0,   0, 
        };
-
-#line 467 "<stdout>"
-{
-       YYCTYPE yych;
        goto yy18;
        ++YYCURSOR;
 yy18:
@@ -480,15 +483,15 @@
        yych = *YYCURSOR;
        goto yy25;
 yy21:
-#line 294 "/usr/src/php/php5/ext/standard/url_scanner_ex.re"
+#line 294 "/usr/src/php/php_4_4/ext/standard/url_scanner_ex.re"
 { handle_tag(STD_ARGS); /* Sets STATE */; passthru(STD_ARGS); if (STATE == 
STATE_PLAIN) goto state_plain; else goto state_next_arg; }
-#line 486 "<stdout>"
+#line 212 "<stdout>"
 yy22:  ++YYCURSOR;
        goto yy23;
 yy23:
-#line 295 "/usr/src/php/php5/ext/standard/url_scanner_ex.re"
+#line 295 "/usr/src/php/php_4_4/ext/standard/url_scanner_ex.re"
 { passthru(STD_ARGS); goto state_plain_begin; }
-#line 492 "<stdout>"
+#line 218 "<stdout>"
 yy24:  ++YYCURSOR;
        if(YYLIMIT == YYCURSOR) YYFILL(1);
        yych = *YYCURSOR;
@@ -498,7 +501,7 @@
        }
        goto yy21;
 }
-#line 296 "/usr/src/php/php5/ext/standard/url_scanner_ex.re"
+#line 296 "/usr/src/php/php_4_4/ext/standard/url_scanner_ex.re"
 
 
 state_next_arg_begin:
@@ -506,6 +509,11 @@
        
 state_next_arg:
        start = YYCURSOR;
+
+#line 231 "<stdout>"
+{
+       YYCTYPE yych;
+       unsigned int yyaccept;
        static unsigned char yybm[] = {
          0,   0,   0,   0,   0,   0,   0,   0, 
          0, 128, 128, 128,   0,   0,   0,   0, 
@@ -540,10 +548,6 @@
          0,   0,   0,   0,   0,   0,   0,   0, 
          0,   0,   0,   0,   0,   0,   0,   0, 
        };
-
-#line 545 "<stdout>"
-{
-       YYCTYPE yych;
        goto yy26;
        ++YYCURSOR;
 yy26:
@@ -571,28 +575,28 @@
 yy28:  ++YYCURSOR;
        goto yy29;
 yy29:
-#line 304 "/usr/src/php/php5/ext/standard/url_scanner_ex.re"
+#line 304 "/usr/src/php/php_4_4/ext/standard/url_scanner_ex.re"
 { passthru(STD_ARGS); handle_form(STD_ARGS); goto state_plain_begin; }
-#line 577 "<stdout>"
+#line 298 "<stdout>"
 yy30:  ++YYCURSOR;
        yych = *YYCURSOR;
        goto yy37;
 yy31:
-#line 305 "/usr/src/php/php5/ext/standard/url_scanner_ex.re"
+#line 305 "/usr/src/php/php_4_4/ext/standard/url_scanner_ex.re"
 { passthru(STD_ARGS); goto state_next_arg; }
-#line 584 "<stdout>"
+#line 304 "<stdout>"
 yy32:  ++YYCURSOR;
        goto yy33;
 yy33:
-#line 306 "/usr/src/php/php5/ext/standard/url_scanner_ex.re"
+#line 306 "/usr/src/php/php_4_4/ext/standard/url_scanner_ex.re"
 { --YYCURSOR; STATE = STATE_ARG; goto state_arg; }
-#line 590 "<stdout>"
+#line 310 "<stdout>"
 yy34:  ++YYCURSOR;
        goto yy35;
 yy35:
-#line 307 "/usr/src/php/php5/ext/standard/url_scanner_ex.re"
+#line 307 "/usr/src/php/php_4_4/ext/standard/url_scanner_ex.re"
 { passthru(STD_ARGS); goto state_plain_begin; }
-#line 596 "<stdout>"
+#line 316 "<stdout>"
 yy36:  ++YYCURSOR;
        if(YYLIMIT == YYCURSOR) YYFILL(1);
        yych = *YYCURSOR;
@@ -602,11 +606,16 @@
        }
        goto yy31;
 }
-#line 308 "/usr/src/php/php5/ext/standard/url_scanner_ex.re"
+#line 308 "/usr/src/php/php_4_4/ext/standard/url_scanner_ex.re"
 
 
 state_arg:
        start = YYCURSOR;
+
+#line 329 "<stdout>"
+{
+       YYCTYPE yych;
+       unsigned int yyaccept;
        static unsigned char yybm[] = {
          0,   0,   0,   0,   0,   0,   0,   0, 
          0,   0,   0,   0,   0,   0,   0,   0, 
@@ -641,10 +650,6 @@
          0,   0,   0,   0,   0,   0,   0,   0, 
          0,   0,   0,   0,   0,   0,   0,   0, 
        };
-
-#line 646 "<stdout>"
-{
-       YYCTYPE yych;
        goto yy38;
        ++YYCURSOR;
 yy38:
@@ -659,15 +664,15 @@
        yych = *YYCURSOR;
        goto yy45;
 yy41:
-#line 313 "/usr/src/php/php5/ext/standard/url_scanner_ex.re"
+#line 313 "/usr/src/php/php_4_4/ext/standard/url_scanner_ex.re"
 { passthru(STD_ARGS); handle_arg(STD_ARGS); STATE = STATE_BEFORE_VAL; goto 
state_before_val; }
-#line 665 "<stdout>"
+#line 382 "<stdout>"
 yy42:  ++YYCURSOR;
        goto yy43;
 yy43:
-#line 314 "/usr/src/php/php5/ext/standard/url_scanner_ex.re"
+#line 314 "/usr/src/php/php_4_4/ext/standard/url_scanner_ex.re"
 { passthru(STD_ARGS); STATE = STATE_NEXT_ARG; goto state_next_arg; }
-#line 671 "<stdout>"
+#line 388 "<stdout>"
 yy44:  ++YYCURSOR;
        if(YYLIMIT == YYCURSOR) YYFILL(1);
        yych = *YYCURSOR;
@@ -677,11 +682,16 @@
        }
        goto yy41;
 }
-#line 315 "/usr/src/php/php5/ext/standard/url_scanner_ex.re"
+#line 315 "/usr/src/php/php_4_4/ext/standard/url_scanner_ex.re"
 
 
 state_before_val:
        start = YYCURSOR;
+
+#line 401 "<stdout>"
+{
+       YYCTYPE yych;
+       unsigned int yyaccept;
        static unsigned char yybm[] = {
          0,   0,   0,   0,   0,   0,   0,   0, 
          0,   0,   0,   0,   0,   0,   0,   0, 
@@ -716,11 +726,6 @@
          0,   0,   0,   0,   0,   0,   0,   0, 
          0,   0,   0,   0,   0,   0,   0,   0, 
        };
-
-#line 721 "<stdout>"
-{
-       YYCTYPE yych;
-       unsigned int yyaccept;
        goto yy46;
        ++YYCURSOR;
 yy46:
@@ -735,16 +740,16 @@
        if(yych == '=') goto yy53;
        goto yy49;
 yy49:
-#line 321 "/usr/src/php/php5/ext/standard/url_scanner_ex.re"
+#line 321 "/usr/src/php/php_4_4/ext/standard/url_scanner_ex.re"
 { --YYCURSOR; goto state_next_arg_begin; }
-#line 741 "<stdout>"
+#line 455 "<stdout>"
 yy50:  ++YYCURSOR;
        yych = *YYCURSOR;
        goto yy54;
 yy51:
-#line 320 "/usr/src/php/php5/ext/standard/url_scanner_ex.re"
+#line 320 "/usr/src/php/php_4_4/ext/standard/url_scanner_ex.re"
 { passthru(STD_ARGS); STATE = STATE_VAL; goto state_val; }
-#line 748 "<stdout>"
+#line 461 "<stdout>"
 yy52:  yych = *++YYCURSOR;
        goto yy49;
 yy53:  ++YYCURSOR;
@@ -767,12 +772,17 @@
        case 0: goto yy49;
        }
 }
-#line 322 "/usr/src/php/php5/ext/standard/url_scanner_ex.re"
+#line 322 "/usr/src/php/php_4_4/ext/standard/url_scanner_ex.re"
 
 
 
 state_val:
        start = YYCURSOR;
+
+#line 488 "<stdout>"
+{
+       YYCTYPE yych;
+       unsigned int yyaccept;
        static unsigned char yybm[] = {
        248, 248, 248, 248, 248, 248, 248, 248, 
        248, 160, 160, 248, 248, 248, 248, 248, 
@@ -807,11 +817,6 @@
        248, 248, 248, 248, 248, 248, 248, 248, 
        248, 248, 248, 248, 248, 248, 248, 248, 
        };
-
-#line 812 "<stdout>"
-{
-       YYCTYPE yych;
-       unsigned int yyaccept;
        goto yy58;
        ++YYCURSOR;
 yy58:
@@ -839,9 +844,9 @@
        yych = *(YYMARKER = ++YYCURSOR);
        goto yy77;
 yy61:
-#line 330 "/usr/src/php/php5/ext/standard/url_scanner_ex.re"
+#line 330 "/usr/src/php/php_4_4/ext/standard/url_scanner_ex.re"
 { handle_val(STD_ARGS, 0, '\0'); goto state_next_arg_begin; }
-#line 845 "<stdout>"
+#line 555 "<stdout>"
 yy62:  yyaccept = 0;
        yych = *(YYMARKER = ++YYCURSOR);
        goto yy69;
@@ -850,9 +855,9 @@
 yy64:  ++YYCURSOR;
        goto yy65;
 yy65:
-#line 331 "/usr/src/php/php5/ext/standard/url_scanner_ex.re"
+#line 331 "/usr/src/php/php_4_4/ext/standard/url_scanner_ex.re"
 { passthru(STD_ARGS); goto state_next_arg_begin; }
-#line 856 "<stdout>"
+#line 566 "<stdout>"
 yy66:  ++YYCURSOR;
        if(YYLIMIT == YYCURSOR) YYFILL(1);
        yych = *YYCURSOR;
@@ -879,9 +884,9 @@
        }
        goto yy71;
 yy71:
-#line 329 "/usr/src/php/php5/ext/standard/url_scanner_ex.re"
+#line 329 "/usr/src/php/php_4_4/ext/standard/url_scanner_ex.re"
 { handle_val(STD_ARGS, 1, '\''); goto state_next_arg_begin; }
-#line 885 "<stdout>"
+#line 595 "<stdout>"
 yy72:  ++YYCURSOR;
        if(YYLIMIT == YYCURSOR) YYFILL(1);
        yych = *YYCURSOR;
@@ -915,9 +920,9 @@
        }
        goto yy79;
 yy79:
-#line 328 "/usr/src/php/php5/ext/standard/url_scanner_ex.re"
+#line 328 "/usr/src/php/php_4_4/ext/standard/url_scanner_ex.re"
 { handle_val(STD_ARGS, 1, '"'); goto state_next_arg_begin; }
-#line 921 "<stdout>"
+#line 631 "<stdout>"
 yy80:  ++YYCURSOR;
        if(YYLIMIT == YYCURSOR) YYFILL(1);
        yych = *YYCURSOR;
@@ -931,7 +936,7 @@
        yych = *YYCURSOR;
        goto yy79;
 }
-#line 332 "/usr/src/php/php5/ext/standard/url_scanner_ex.re"
+#line 332 "/usr/src/php/php_4_4/ext/standard/url_scanner_ex.re"
 
 
 stop:
@@ -1110,7 +1115,6 @@
 PHP_MSHUTDOWN_FUNCTION(url_scanner)
 {
        UNREGISTER_INI_ENTRIES();
-
        return SUCCESS;
 }
 
http://cvs.php.net/diff.php/php-src/ext/standard/var_unserializer.c?r1=1.18.4.24.2.1&r2=1.18.4.24.2.2&ty=u
Index: php-src/ext/standard/var_unserializer.c
diff -u php-src/ext/standard/var_unserializer.c:1.18.4.24.2.1 
php-src/ext/standard/var_unserializer.c:1.18.4.24.2.2
--- php-src/ext/standard/var_unserializer.c:1.18.4.24.2.1       Sat Jun 11 
16:21:50 2005
+++ php-src/ext/standard/var_unserializer.c     Sat Jun 11 19:55:39 2005
@@ -1,24 +1,24 @@
-/* Generated by re2c 0.9.7 on Sat Jun 11 22:56:18 2005 */
-#line 1 "/usr/src/php/php5/ext/standard/var_unserializer.re"
+/* Generated by re2c 0.9.6 on Sun Jun 12 02:54:02 2005 */
+#line 1 "/usr/src/php/php_4_4/ext/standard/var_unserializer.re"
 /*
-  +----------------------------------------------------------------------+
-  | PHP Version 5                                                        |
-  +----------------------------------------------------------------------+
-  | Copyright (c) 1997-2004 The PHP Group                                |
-  +----------------------------------------------------------------------+
-  | This source file is subject to version 3.0 of the PHP license,       |
-  | that is bundled with this package in the file LICENSE, and is        |
-  | available through the world-wide-web at the following url:           |
-  | http://www.php.net/license/3_0.txt.                                  |
-  | If you did not receive a copy of the PHP license and are unable to   |
-  | obtain it through the world-wide-web, please send a note to          |
-  | [EMAIL PROTECTED] so we can mail you a copy immediately.               |
-  +----------------------------------------------------------------------+
-  | Author: Sascha Schumann <[EMAIL PROTECTED]>                         |
-  +----------------------------------------------------------------------+
+   +----------------------------------------------------------------------+
+   | PHP Version 4                                                        |
+   +----------------------------------------------------------------------+
+   | Copyright (c) 1997-2003 The PHP Group                                |
+   +----------------------------------------------------------------------+
+   | This source file is subject to version 2.02 of the PHP license,      |
+   | that is bundled with this package in the file LICENSE, and is        |
+   | available at through the world-wide-web at                           |
+   | http://www.php.net/license/2_02.txt.                                 |
+   | If you did not receive a copy of the PHP license and are unable to   |
+   | obtain it through the world-wide-web, please send a note to          |
+   | [EMAIL PROTECTED] so we can mail you a copy immediately.               |
+   +----------------------------------------------------------------------+
+   | Authors: Sascha Schumann <[EMAIL PROTECTED]>                        |
+   +----------------------------------------------------------------------+
 */
 
-/* $Id: var_unserializer.c,v 1.18.4.24.2.1 2005/06/11 20:21:50 sniper Exp $ */
+/* $Id: var_unserializer.c,v 1.18.4.24.2.2 2005/06/11 23:55:39 sniper Exp $ */
 
 #include "php.h"
 #include "ext/standard/php_var.h"
@@ -89,7 +89,7 @@
                for (i = 0; i < var_hash->used_slots; i++) {
                        if (var_hash->data[i] == ozval) {
                                var_hash->data[i] = *nzval;
-                               /* do not break here */
+                               return;
                        }
                }
                var_hash = var_hash->next;
@@ -125,7 +125,7 @@
                efree(var_hash);
                var_hash = next;
        }
-
+       
        var_hash = var_hashx->first_dtor;
        
        while (var_hash) {
@@ -147,7 +147,7 @@
 #define YYMARKER marker
 
 
-#line 155 "/usr/src/php/php5/ext/standard/var_unserializer.re"
+#line 154 "/usr/src/php/php_4_4/ext/standard/var_unserializer.re"
 
 
 
@@ -277,37 +277,10 @@
        return 0;
 }
 
-static inline int object_custom(UNSERIALIZE_PARAMETER, zend_class_entry *ce)
-{
-       long datalen;
-
-       if(ce->unserialize == NULL) {
-               zend_error(E_WARNING, "Class %s has no unserializer", ce->name);
-               return 0;
-       }
-
-       datalen = parse_iv2((*p) + 2, p);
-
-       (*p) += 2;
-
-       if(datalen < 0 || (*p) + datalen >= max) {
-               zend_error(E_WARNING, "Insufficient data for unserializing - 
%ld required, %d present", datalen, max - (*p));
-               return 0;
-       }
-
-       if(ce->unserialize(rval, ce, (const unsigned char*)*p, datalen, 
(zend_unserialize_data *)var_hash TSRMLS_CC) != SUCCESS) {
-               return 0;
-       }
-
-       (*p) += datalen;
-
-       return finish_nested_data(UNSERIALIZE_PASSTHRU);
-}
-
-static inline long object_common1(UNSERIALIZE_PARAMETER, zend_class_entry *ce)
+static inline int object_common1(UNSERIALIZE_PARAMETER, zend_class_entry *ce)
 {
        long elements;
-       
+
        elements = parse_iv2((*p) + 2, p);
 
        (*p) += 2;
@@ -325,12 +298,9 @@
                return 0;
        }
 
-       if (Z_OBJCE_PP(rval) != PHP_IC_ENTRY &&
-           zend_hash_exists(&Z_OBJCE_PP(rval)->function_table, "__wakeup", 
sizeof("__wakeup"))) {
-               INIT_PZVAL(&fname);
-               ZVAL_STRINGL(&fname, "__wakeup", sizeof("__wakeup") - 1, 0);
-               call_user_function_ex(CG(function_table), rval, &fname, 
&retval_ptr, 0, 0, 1, NULL TSRMLS_CC);
-       }
+       INIT_PZVAL(&fname);
+       ZVAL_STRINGL(&fname, "__wakeup", sizeof("__wakeup") - 1, 0);
+       call_user_function_ex(CG(function_table), rval, &fname, &retval_ptr, 0, 
0, 1, NULL TSRMLS_CC);
 
        if (retval_ptr)
                zval_ptr_dtor(&retval_ptr);
@@ -339,6 +309,20 @@
 
 }
 
+static char *str_tolower_copy(char *dest, const char *source, unsigned int 
length)
+{
+       register unsigned char *str = (unsigned char*)source;
+       register unsigned char *result = (unsigned char*)dest;
+       register unsigned char *end = str + length;
+
+       while (str < end) {
+               *result++ = tolower((int)*str++);
+       }
+       *result = *end;
+
+       return dest;
+}
+
 PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
 {
        const unsigned char *cursor, *limit, *marker, *start;
@@ -354,6 +338,11 @@
 
        
        
+
+#line 7 "<stdout>"
+{
+       YYCTYPE yych;
+       unsigned int yyaccept;
        static unsigned char yybm[] = {
          0,   0,   0,   0,   0,   0,   0,   0, 
          0,   0,   0,   0,   0,   0,   0,   0, 
@@ -388,40 +377,34 @@
          0,   0,   0,   0,   0,   0,   0,   0, 
          0,   0,   0,   0,   0,   0,   0,   0, 
        };
-
-#line 393 "<stdout>"
-{
-       YYCTYPE yych;
-       unsigned int yyaccept;
        goto yy0;
        ++YYCURSOR;
 yy0:
        if((YYLIMIT - YYCURSOR) < 7) YYFILL(7);
        yych = *YYCURSOR;
-       if(yych <= 'c'){
-               if(yych <= 'O'){
-                       if(yych <= 'C'){
-                               if(yych <= 'B') goto yy16;
-                               goto yy13;
-                       } else {
+       if(yych <= 'd'){
+               if(yych <= 'R'){
+                       if(yych <= 'N'){
                                if(yych <= 'M') goto yy16;
-                               if(yych <= 'N') goto yy6;
-                               goto yy13;
+                               goto yy6;
+                       } else {
+                               if(yych <= 'O') goto yy13;
+                               if(yych <= 'Q') goto yy16;
+                               goto yy3;
                        }
                } else {
-                       if(yych <= '`'){
-                               if(yych == 'R') goto yy3;
-                               goto yy16;
+                       if(yych <= 'a'){
+                               if(yych <= '`') goto yy16;
+                               goto yy11;
                        } else {
-                               if(yych <= 'a') goto yy11;
                                if(yych <= 'b') goto yy7;
-                               goto yy16;
+                               if(yych <= 'c') goto yy16;
+                               goto yy9;
                        }
                }
        } else {
                if(yych <= 'q'){
                        if(yych <= 'i'){
-                               if(yych <= 'd') goto yy9;
                                if(yych <= 'h') goto yy16;
                                goto yy8;
                        } else {
@@ -449,9 +432,9 @@
        if(yych == ':') goto yy87;
        goto yy4;
 yy4:
-#line 626 "/usr/src/php/php5/ext/standard/var_unserializer.re"
+#line 590 "/usr/src/php/php_4_4/ext/standard/var_unserializer.re"
 { return 0; }
-#line 455 "<stdout>"
+#line 102 "<stdout>"
 yy5:   yyaccept = 0;
        yych = *(YYMARKER = ++YYCURSOR);
        if(yych == ':') goto yy81;
@@ -490,13 +473,13 @@
 yy14:  ++YYCURSOR;
        goto yy15;
 yy15:
-#line 620 "/usr/src/php/php5/ext/standard/var_unserializer.re"
+#line 584 "/usr/src/php/php_4_4/ext/standard/var_unserializer.re"
 {
        /* this is the case where we have less data than planned */
        php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Unexpected end of 
serialized data");
        return 0; /* not sure if it should be 0 or 1 here? */
 }
-#line 500 "<stdout>"
+#line 147 "<stdout>"
 yy16:  yych = *++YYCURSOR;
        goto yy4;
 yy17:  yych = *++YYCURSOR;
@@ -525,25 +508,18 @@
 yy22:  ++YYCURSOR;
        goto yy23;
 yy23:
-#line 508 "/usr/src/php/php5/ext/standard/var_unserializer.re"
+#line 495 "/usr/src/php/php_4_4/ext/standard/var_unserializer.re"
 {
        size_t len, len2, len3, maxlen;
        long elements;
        char *class_name;
        zend_class_entry *ce;
-       zend_class_entry **pce;
        int incomplete_class = 0;
-
-       int custom_object = 0;
-
+       
        zval *user_func;
        zval *retval_ptr;
        zval **args[1];
        zval *arg_func_name;
-
-       if(*start == 'C') {
-               custom_object = 1;
-       }
        
        INIT_PZVAL(*rval);
        len2 = len = parse_uiv(start + 2);
@@ -565,79 +541,63 @@
                *p = YYCURSOR+1;
                return 0;
        }
-
-       len3 = strspn(class_name, 
"0123456789_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\177\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377");
+       
+       class_name = str_tolower_copy((char *)emalloc(len+1), class_name, len);
+       class_name[len] = '\0';
+       
+       len3 = strspn(class_name, "0123456789_abcdefghijklmnopqrstuvwxyz");
        if (len3 != len)
        {
                *p = YYCURSOR + len3 - len;
+               efree(class_name);
                return 0;
        }
 
-       class_name = estrndup(class_name, len);
-
-       do {
-               /* Try to find class directly */
-               if (zend_lookup_class(class_name, len2, &pce TSRMLS_CC) == 
SUCCESS) {
-                       ce = *pce;
-                       break;
-               }
-               
-               /* Check for unserialize callback */
+       if (zend_hash_find(CG(class_table), class_name, len + 1, (void **) &ce) 
!= SUCCESS) {
                if ((PG(unserialize_callback_func) == NULL) || 
(PG(unserialize_callback_func)[0] == '\0')) {
                        incomplete_class = 1;
                        ce = PHP_IC_ENTRY;
-                       break;
-               }
-               
-               /* Call unserialize callback */
-               MAKE_STD_ZVAL(user_func);
-               ZVAL_STRING(user_func, PG(unserialize_callback_func), 1);
-               args[0] = &arg_func_name;
-               MAKE_STD_ZVAL(arg_func_name);
-               ZVAL_STRING(arg_func_name, class_name, 1);
-               if (call_user_function_ex(CG(function_table), NULL, user_func, 
&retval_ptr, 1, args, 0, NULL TSRMLS_CC) != SUCCESS) {
-                       php_error_docref(NULL TSRMLS_CC, E_WARNING, "defined 
(%s) but not found", user_func->value.str.val);
-                       incomplete_class = 1;
-                       ce = PHP_IC_ENTRY;
-                       zval_ptr_dtor(&user_func);
-                       zval_ptr_dtor(&arg_func_name);
-                       break;
-               }
-               if (retval_ptr) {
-                       zval_ptr_dtor(&retval_ptr);
-               }
-               
-               /* The callback function may have defined the class */
-               if (zend_lookup_class(class_name, len2, &pce TSRMLS_CC) == 
SUCCESS) {
-                       ce = *pce;
                } else {
-                       php_error_docref(NULL TSRMLS_CC, E_WARNING, "Function 
%s() hasn't defined the class it was called for", user_func->value.str.val);
-                       incomplete_class = 1;
-                       ce = PHP_IC_ENTRY;
-               }
+                       MAKE_STD_ZVAL(user_func);
+                       ZVAL_STRING(user_func, PG(unserialize_callback_func), 
1);
 
-               zval_ptr_dtor(&user_func);
-               zval_ptr_dtor(&arg_func_name);
-               break;
-       } while (1);
+                       args[0] = &arg_func_name;
+                       MAKE_STD_ZVAL(arg_func_name);
+                       ZVAL_STRING(arg_func_name, class_name, 1);
+                               
+                       if (call_user_function_ex(CG(function_table), NULL, 
user_func, &retval_ptr, 1, args, 0, NULL TSRMLS_CC) != SUCCESS) {
+                               zend_error(E_WARNING, 
"'unserialize_callback_func' defined (%s) but not found", 
user_func->value.str.val);
+                               incomplete_class = 1;
+                               ce = PHP_IC_ENTRY;
+                       } else {
+                               if (zend_hash_find(CG(class_table), class_name, 
len + 1, (void **) &ce) != SUCCESS) {
+                                       zend_error(E_WARNING, 
"'unserialize_callback_func' (%s) hasn't defined the class it was called for", 
user_func->value.str.val);
+                                       incomplete_class = 1;
+                                       ce = PHP_IC_ENTRY;
+                               } else {
+#ifdef ZEND_ENGINE_2
+                                       ce = *(zend_class_entry **)ce; /* Bad 
hack, TBF! */
+#endif 
+                               }
+                       }
+               }
+       } else {
+#ifdef ZEND_ENGINE_2
+               ce = *(zend_class_entry **)ce; /* Bad hack, TBF! */
+#endif 
+       }
 
        *p = YYCURSOR;
-
-       if(custom_object) {
-               efree(class_name);
-               return object_custom(UNSERIALIZE_PASSTHRU, ce);
-       }
-       
        elements = object_common1(UNSERIALIZE_PASSTHRU, ce);
 
        if (incomplete_class) {
-               php_store_class_name(*rval, class_name, len2);
+               php_store_class_name(*rval, class_name, len2 TSRMLS_CC);
        }
        efree(class_name);
 
        return object_common2(UNSERIALIZE_PASSTHRU, elements);
 }
-#line 641 "<stdout>"
+#line 266 "<stdout>"
 yy24:  yych = *++YYCURSOR;
        if(yych <= ','){
                if(yych != '+') goto yy2;
@@ -666,7 +626,7 @@
 yy29:  ++YYCURSOR;
        goto yy30;
 yy30:
-#line 500 "/usr/src/php/php5/ext/standard/var_unserializer.re"
+#line 487 "/usr/src/php/php_4_4/ext/standard/var_unserializer.re"
 {
 
        INIT_PZVAL(*rval);
@@ -674,7 +634,7 @@
        return object_common2(UNSERIALIZE_PASSTHRU,
                        object_common1(UNSERIALIZE_PASSTHRU, 
ZEND_STANDARD_CLASS_DEF_PTR));
 }
-#line 678 "<stdout>"
+#line 304 "<stdout>"
 yy31:  yych = *++YYCURSOR;
        if(yych == '+') goto yy32;
        if(yych <= '/') goto yy2;
@@ -698,7 +658,7 @@
 yy36:  ++YYCURSOR;
        goto yy37;
 yy37:
-#line 478 "/usr/src/php/php5/ext/standard/var_unserializer.re"
+#line 461 "/usr/src/php/php_4_4/ext/standard/var_unserializer.re"
 {
        long elements = parse_iv(start + 2);
        /* use iv() not uiv() in order to check data range */
@@ -708,6 +668,10 @@
                return 0;
        }
 
+       if (elements < 0) {
+               return 0;
+       }
+
        INIT_PZVAL(*rval);
        Z_TYPE_PP(rval) = IS_ARRAY;
        ALLOC_HASHTABLE(Z_ARRVAL_PP(rval));
@@ -720,7 +684,7 @@
 
        return finish_nested_data(UNSERIALIZE_PASSTHRU);
 }
-#line 724 "<stdout>"
+#line 355 "<stdout>"
 yy38:  yych = *++YYCURSOR;
        if(yych == '+') goto yy39;
        if(yych <= '/') goto yy2;
@@ -744,7 +708,7 @@
 yy43:  ++YYCURSOR;
        goto yy44;
 yy44:
-#line 450 "/usr/src/php/php5/ext/standard/var_unserializer.re"
+#line 433 "/usr/src/php/php_4_4/ext/standard/var_unserializer.re"
 {
        size_t len, maxlen;
        char *str;
@@ -772,7 +736,7 @@
        ZVAL_STRINGL(*rval, str, len, 1);
        return 1;
 }
-#line 776 "<stdout>"
+#line 408 "<stdout>"
 yy45:  yych = *++YYCURSOR;
        if(yych <= '/'){
                if(yych <= ','){
@@ -861,14 +825,14 @@
 yy55:  ++YYCURSOR;
        goto yy56;
 yy56:
-#line 443 "/usr/src/php/php5/ext/standard/var_unserializer.re"
+#line 426 "/usr/src/php/php_4_4/ext/standard/var_unserializer.re"
 {
        *p = YYCURSOR;
        INIT_PZVAL(*rval);
        ZVAL_DOUBLE(*rval, zend_strtod((const char *)start + 2, NULL));
        return 1;
 }
-#line 872 "<stdout>"
+#line 506 "<stdout>"
 yy57:  yych = *++YYCURSOR;
        if(yych <= ','){
                if(yych != '+') goto yy2;
@@ -928,7 +892,7 @@
 yy66:  ++YYCURSOR;
        goto yy67;
 yy67:
-#line 428 "/usr/src/php/php5/ext/standard/var_unserializer.re"
+#line 411 "/usr/src/php/php_4_4/ext/standard/var_unserializer.re"
 {
        *p = YYCURSOR;
        INIT_PZVAL(*rval);
@@ -943,7 +907,7 @@
 
        return 1;
 }
-#line 947 "<stdout>"
+#line 583 "<stdout>"
 yy68:  yych = *++YYCURSOR;
        if(yych == 'N') goto yy65;
        goto yy2;
@@ -972,14 +936,14 @@
 yy73:  ++YYCURSOR;
        goto yy74;
 yy74:
-#line 421 "/usr/src/php/php5/ext/standard/var_unserializer.re"
+#line 404 "/usr/src/php/php_4_4/ext/standard/var_unserializer.re"
 {
        *p = YYCURSOR;
        INIT_PZVAL(*rval);
        ZVAL_LONG(*rval, parse_iv(start + 2));
        return 1;
 }
-#line 983 "<stdout>"
+#line 620 "<stdout>"
 yy75:  yych = *++YYCURSOR;
        if(yych <= '/') goto yy2;
        if(yych >= '2') goto yy2;
@@ -990,25 +954,25 @@
 yy77:  ++YYCURSOR;
        goto yy78;
 yy78:
-#line 414 "/usr/src/php/php5/ext/standard/var_unserializer.re"
+#line 397 "/usr/src/php/php_4_4/ext/standard/var_unserializer.re"
 {
        *p = YYCURSOR;
        INIT_PZVAL(*rval);
        ZVAL_BOOL(*rval, parse_iv(start + 2));
        return 1;
 }
-#line 1001 "<stdout>"
+#line 638 "<stdout>"
 yy79:  ++YYCURSOR;
        goto yy80;
 yy80:
-#line 407 "/usr/src/php/php5/ext/standard/var_unserializer.re"
+#line 390 "/usr/src/php/php_4_4/ext/standard/var_unserializer.re"
 {
        *p = YYCURSOR;
        INIT_PZVAL(*rval);
        ZVAL_NULL(*rval);
        return 1;
 }
-#line 1012 "<stdout>"
+#line 649 "<stdout>"
 yy81:  yych = *++YYCURSOR;
        if(yych <= ','){
                if(yych != '+') goto yy2;
@@ -1034,7 +998,7 @@
 yy85:  ++YYCURSOR;
        goto yy86;
 yy86:
-#line 384 "/usr/src/php/php5/ext/standard/var_unserializer.re"
+#line 367 "/usr/src/php/php_4_4/ext/standard/var_unserializer.re"
 {
        long id;
 
@@ -1045,19 +1009,19 @@
        if (id == -1 || var_access(var_hash, id, &rval_ref) != SUCCESS) {
                return 0;
        }
-
+       
        if (*rval == *rval_ref) return 0;
 
        if (*rval != NULL) {
-               zval_ptr_dtor(rval);
+       zval_ptr_dtor(rval);
        }
        *rval = *rval_ref;
        (*rval)->refcount++;
-       (*rval)->is_ref = 0;
+       (*rval)->is_ref = 1;
        
        return 1;
 }
-#line 1061 "<stdout>"
+#line 699 "<stdout>"
 yy87:  yych = *++YYCURSOR;
        if(yych <= ','){
                if(yych != '+') goto yy2;
@@ -1083,7 +1047,7 @@
 yy91:  ++YYCURSOR;
        goto yy92;
 yy92:
-#line 363 "/usr/src/php/php5/ext/standard/var_unserializer.re"
+#line 346 "/usr/src/php/php_4_4/ext/standard/var_unserializer.re"
 {
        long id;
 
@@ -1096,7 +1060,7 @@
        }
 
        if (*rval != NULL) {
-               zval_ptr_dtor(rval);
+       zval_ptr_dtor(rval);
        }
        *rval = *rval_ref;
        (*rval)->refcount++;
@@ -1104,9 +1068,9 @@
        
        return 1;
 }
-#line 1108 "<stdout>"
+#line 747 "<stdout>"
 }
-#line 628 "/usr/src/php/php5/ext/standard/var_unserializer.re"
+#line 592 "/usr/src/php/php_4_4/ext/standard/var_unserializer.re"
 
 
        return 0;

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

Reply via email to