Revert r34619, r34622 and do it right. :)
authorBrion Vibber <brion@users.mediawiki.org>
Mon, 12 May 2008 23:46:42 +0000 (23:46 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Mon, 12 May 2008 23:46:42 +0000 (23:46 +0000)
* $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

index 61c3ef5..f86efe1 100644 (file)
@@ -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 ) ) .
                                        "</div>\n";
                        }
+               } else {
+                       # Everything is permitted.
+                       $extensionsList = '';
                }
 
                # Get the maximum file size from php.ini as $wgMaxUploadSize works for uploads from URL via CURL only