svn: /php/php-src/ branches/PHP_5_2/ext/standard/array.c branches/PHP_5_3/ext/standard/array.c trunk/ext/standard/array.c
| From: | Antony Dovgal | Date: | Thu, 24 Dec 2009 13:07:33 +0000 |
| Subject: | svn: /php/php-src/ branches/PHP_5_2/ext/standard/array.c branches/PHP_5_3/ext/standard/array.c trunk/ext/standard/array.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-61414@lists.php.net to get a copy of this message | ||
tony2001 Thu, 24 Dec 2009 13:07:33 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=292594
Log:
fix the fix for #47409
use correct comparison and add missing scope checks to trunk
Bug: http://bugs.php.net/47409 (Closed) extract() problem
with array containing word "this"
Changed paths:
U php/php-src/branches/PHP_5_2/ext/standard/array.c
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/ext/standard/array.c
===================================================================
--- php/php-src/branches/PHP_5_2/ext/standard/array.c 2009-12-24 12:45:41 UTC (rev 292593)
+++ php/php-src/branches/PHP_5_2/ext/standard/array.c 2009-12-24 13:07:33 UTC (rev 292594)
@@ -1510,7 +1510,7 @@
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) {
+ if (var_exists && var_name_len == sizeof("this") &&
!strcmp(var_name, "this") && EG(scope) && EG(scope)->name_length != 0)
{
break;
}
smart_str_appendl(&final_name, var_name, var_name_len);
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-24 12:45:41 UTC (rev 292593)
+++ php/php-src/branches/PHP_5_3/ext/standard/array.c 2009-12-24 13:07:33 UTC (rev 292594)
@@ -1383,7 +1383,7 @@
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) {
+ if (var_exists && var_name_len == sizeof("this") &&
!strcmp(var_name, "this") && EG(scope) && EG(scope)->name_length != 0)
{
break;
}
ZVAL_STRINGL(&final_name, var_name, var_name_len, 1);
Modified: php/php-src/trunk/ext/standard/array.c
===================================================================
--- php/php-src/trunk/ext/standard/array.c 2009-12-24 12:45:41 UTC (rev 292593)
+++ php/php-src/trunk/ext/standard/array.c 2009-12-24 13:07:33 UTC (rev 292594)
@@ -1445,7 +1445,7 @@
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))
{
+ if (var_exists && var_name_len == sizeof("this") &&
ZEND_U_EQUAL(key_type, var_name, var_name_len - 1, "this", sizeof("this") - 1)
&& EG(scope) && EG(scope)->name_length != 0) {
break;
}
ZVAL_ZSTRL(&final_name, key_type, var_name, var_name_len, 1);