From: Ilia Alshanetsky Date: Wed, 23 Dec 2009 16:33:58 +0000 (+0000) Subject: Fixed bug #47409 (extract() problem with array containing word "this"). X-Git-Tag: php-5.2.13RC1~84 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c8d4d751a98f7b55e56714cfbd5572c5f6fc4415;p=php Fixed bug #47409 (extract() problem with array containing word "this"). --- diff --git a/NEWS b/NEWS index 5247f079a3..e3c27756be 100644 --- a/NEWS +++ b/NEWS @@ -9,10 +9,12 @@ PHP NEWS (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) diff --git a/ext/standard/array.c b/ext/standard/array.c index 2f9f3fb17f..e89833da5f 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -1507,7 +1507,10 @@ PHP_FUNCTION(extract) 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);