From: Brion Vibber Date: Mon, 12 May 2008 23:46:42 +0000 (+0000) Subject: Revert r34619, r34622 and do it right. :) X-Git-Tag: 1.31.0-rc.0~47687 X-Git-Url: https://git.heureux-cyclage.org/?a=commitdiff_plain;h=044dca14bce9efa7164dee652213aa19922c982d;p=lhc%2Fweb%2Fwiklou.git 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 --- 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