iliaa                                    Wed, 23 Dec 2009 16:33:58 +0000

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

Log:
Fixed bug #47409 (extract() problem with array containing word "this").

Bug: http://bugs.php.net/47409 (Open) extract() problem with array containing 
word "this"
      
Changed paths:
    U   php/php-src/branches/PHP_5_2/NEWS
    U   php/php-src/branches/PHP_5_2/ext/standard/array.c
    U   php/php-src/branches/PHP_5_3/NEWS
    U   php/php-src/branches/PHP_5_3/ext/standard/array.c
    U   php/php-src/trunk/ext/standard/array.c

Modified: php/php-src/branches/PHP_5_2/NEWS
===================================================================
--- php/php-src/branches/PHP_5_2/NEWS   2009-12-23 16:33:35 UTC (rev 292548)
+++ php/php-src/branches/PHP_5_2/NEWS   2009-12-23 16:33:58 UTC (rev 292549)
@@ -9,10 +9,12 @@
   (Jani)
 - Fixed bug #50394 (Reference argument converted to value in __call). (Stas)
 - Fixed bug #49851 (http wrapper breaks on 1024 char long headers). (Ilia)
-- Fixed bug #45599 (strip_tags() truncates rest of string with invalid
-  attribute). (Ilia, hradtke)
+- Fixed bug #47409 (extract() problem with array containing word "this").
+  (Ilia, chrisstocktonaz at gmail dot com)
 - Fixed bug #47002 (Field truncation when reading from dbase dbs with more
   then 1024 fields). (Ilia, sjoerd-php at linuxonly dot nl)
+- Fixed bug #45599 (strip_tags() truncates rest of string with invalid
+  attribute). (Ilia, hradtke)

 17 Dec 2009, PHP 5.2.12
 - Updated timezone database to version 2009.19 (2009s). (Derick)

Modified: php/php-src/branches/PHP_5_2/ext/standard/array.c
===================================================================
--- php/php-src/branches/PHP_5_2/ext/standard/array.c   2009-12-23 16:33:35 UTC 
(rev 292548)
+++ php/php-src/branches/PHP_5_2/ext/standard/array.c   2009-12-23 16:33:58 UTC 
(rev 292549)
@@ -1507,7 +1507,10 @@

                        case EXTR_OVERWRITE:
                                /* GLOBALS protection */
-                               if (var_exists && !strcmp(var_name, "GLOBALS")) 
{
+                               if (var_exists && var_name_len == 
sizeof("GLOBALS") && !strcmp(var_name, "GLOBALS")) {
+                                       break;
+                               }
+                               if (var_exists && var_name_len == 
sizeof("this")  && !strcmp(var_name, "this") && EG(scope) && "" != 
EG(scope)->name) {
                                        break;
                                }
                                smart_str_appendl(&final_name, var_name, 
var_name_len);

Modified: php/php-src/branches/PHP_5_3/NEWS
===================================================================
--- php/php-src/branches/PHP_5_3/NEWS   2009-12-23 16:33:35 UTC (rev 292548)
+++ php/php-src/branches/PHP_5_3/NEWS   2009-12-23 16:33:58 UTC (rev 292549)
@@ -1,6 +1,8 @@
 PHP                                                                        NEWS
 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
 ?? ??? 20??, PHP 5.3.3
+- Fixed bug #47409 (extract() problem with array containing word "this").
+  (Ilia, chrisstocktonaz at gmail dot com)

 ?? ??? 20??, PHP 5.3.2
 - Upgraded bundled sqlite to version 3.6.21. (Ilia)

Modified: php/php-src/branches/PHP_5_3/ext/standard/array.c
===================================================================
--- php/php-src/branches/PHP_5_3/ext/standard/array.c   2009-12-23 16:33:35 UTC 
(rev 292548)
+++ php/php-src/branches/PHP_5_3/ext/standard/array.c   2009-12-23 16:33:58 UTC 
(rev 292549)
@@ -1383,6 +1383,9 @@
                                if (var_exists && var_name_len == 
sizeof("GLOBALS") && !strcmp(var_name, "GLOBALS")) {
                                        break;
                                }
+                               if (var_exists && var_name_len == 
sizeof("this")  && !strcmp(var_name, "this") && EG(scope) && "" != 
EG(scope)->name) {
+                                       break;
+                               }
                                ZVAL_STRINGL(&final_name, var_name, 
var_name_len, 1);
                                break;


Modified: php/php-src/trunk/ext/standard/array.c
===================================================================
--- php/php-src/trunk/ext/standard/array.c      2009-12-23 16:33:35 UTC (rev 
292548)
+++ php/php-src/trunk/ext/standard/array.c      2009-12-23 16:33:58 UTC (rev 
292549)
@@ -1445,6 +1445,9 @@
                                if (var_exists && var_name_len == 
sizeof("GLOBALS") && ZEND_U_EQUAL(key_type, var_name, var_name_len - 1, 
"GLOBALS", sizeof("GLOBALS") - 1)) {
                                        break;
                                }
+                               if (var_exists && var_name_len == 
sizeof("this") && ZEND_U_EQUAL(key_type, var_name, var_name_len - 1, "this", 
sizeof("this") - 1)) {
+                                       break;
+                               }
                                ZVAL_ZSTRL(&final_name, key_type, var_name, 
var_name_len, 1);
                                break;


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

Reply via email to