From: Rasmus Lerdorf Date: Sat, 19 May 2001 22:50:44 +0000 (+0000) Subject: Fix bug #9526 X-Git-Tag: PRE_GRANULAR_GARBAGE_FIX~337 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ae3dda82856b772da28424e229b29b07b2c95da4;p=php Fix bug #9526 --- diff --git a/ext/standard/file.c b/ext/standard/file.c index a395ab29ce..f86be131eb 100644 --- a/ext/standard/file.c +++ b/ext/standard/file.c @@ -1894,10 +1894,18 @@ PHP_FUNCTION(copy) RETURN_FALSE; } + if (php_check_open_basedir((*source)->value.str.val)) { + RETURN_FALSE; + } + if (PG(safe_mode) &&(!php_checkuid((*target)->value.str.val, NULL, CHECKUID_CHECK_FILE_AND_DIR))) { RETURN_FALSE; } + if (php_check_open_basedir((*target)->value.str.val)) { + RETURN_FALSE; + } + if (php_copy_file(Z_STRVAL_PP(source), Z_STRVAL_PP(target))==SUCCESS) { RETURN_TRUE; } else {