From 044dca14bce9efa7164dee652213aa19922c982d Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Mon, 12 May 2008 23:46:42 +0000 Subject: [PATCH] Revert r34619, r34622 and do it right. :) * $extensionsList is a local variable, not a global, so there is no actual register_globals danger -- just annoying E_NOTICE spam. * Setting $extensionList won't help with warnings about unset $extensionsList ;) * Cleaner to set it in the fallback case near where it's set otherwise, rather than at the top of the function far, far away from its use --- includes/SpecialUpload.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/includes/SpecialUpload.php b/includes/SpecialUpload.php index 61c3ef5157..f86efe1ca9 100644 --- a/includes/SpecialUpload.php +++ b/includes/SpecialUpload.php @@ -900,11 +900,6 @@ class UploadForm { $useAjaxDestCheck = $wgUseAjax && $wgAjaxUploadDestCheck; $useAjaxLicensePreview = $wgUseAjax && $wgAjaxLicensePreview; - // Initilaize $extensionList here in case it is not set later on - // (which would cause a E_NOTICE) and it must not be set only if it - // isn't set to avoid a possible register_globals issue. - $extensionList = ''; - $adc = wfBoolToStr( $useAjaxDestCheck ); $alp = wfBoolToStr( $useAjaxLicensePreview ); $autofill = wfBoolToStr( $this->mDesiredDestName == '' ); @@ -985,6 +980,9 @@ wgUploadAutoFill = {$autofill}; wfMsgWikiHtml( 'upload-prohibited', implode( $wgFileBlacklist, $delim ) ) . "\n"; } + } else { + # Everything is permitted. + $extensionsList = ''; } # Get the maximum file size from php.ini as $wgMaxUploadSize works for uploads from URL via CURL only -- 2.20.1