r34698 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r34697‎ | r34698 | r34699 >
Date:23:46, 12 May 2008
Author:brion
Status:old
Tags:
Comment:
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
Modified paths:
  • /trunk/phase3/includes/SpecialUpload.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/SpecialUpload.php
@@ -900,11 +900,6 @@
901901 $useAjaxDestCheck = $wgUseAjax && $wgAjaxUploadDestCheck;
902902 $useAjaxLicensePreview = $wgUseAjax && $wgAjaxLicensePreview;
903903
904 - // Initilaize $extensionList here in case it is not set later on
905 - // (which would cause a E_NOTICE) and it must not be set only if it
906 - // isn't set to avoid a possible register_globals issue.
907 - $extensionList = '';
908 -
909904 $adc = wfBoolToStr( $useAjaxDestCheck );
910905 $alp = wfBoolToStr( $useAjaxLicensePreview );
911906 $autofill = wfBoolToStr( $this->mDesiredDestName == '' );
@@ -985,6 +980,9 @@
986981 wfMsgWikiHtml( 'upload-prohibited', implode( $wgFileBlacklist, $delim ) ) .
987982 "</div>\n";
988983 }
 984+ } else {
 985+ # Everything is permitted.
 986+ $extensionsList = '';
989987 }
990988
991989 # Get the maximum file size from php.ini as $wgMaxUploadSize works for uploads from URL via CURL only

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r34619Notice: Undefined variable: extensionsList in includes/SpecialUpload.php on ...minuteelectron17:15, 11 May 2008
r34622Avoid possible register_globals issue.minuteelectron17:31, 11 May 2008

Status & tagging log