r77419 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r77418‎ | r77419 | r77420 >
Date:05:35, 29 November 2010
Author:yaron
Status:deferred
Tags:
Comment:
Added code from regular SpecialUpload.php file so that "default filename" parameter will actually work - apparently this has never worked for MW 1.16+
Modified paths:
  • /trunk/extensions/SemanticForms/specials/SF_UploadWindow2.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/specials/SF_UploadWindow2.php
@@ -213,6 +213,7 @@
214214 'forreupload' => $this->mForReUpload,
215215 'sessionkey' => $sessionKey,
216216 'hideignorewarning' => $hideIgnoreWarning,
 217+ 'destfile' => $this->mDesiredDestName,
217218 'sfInputID' => $this->mInputID,
218219 'sfDelimiter' => $this->mDelimiter,
219220 ) );
@@ -713,6 +714,7 @@
714715 $this->mSessionKey = isset( $options['sessionkey'] )
715716 ? $options['sessionkey'] : '';
716717 $this->mHideIgnoreWarning = !empty( $options['hideignorewarning'] );
 718+ $this->mDestFile = isset( $options['destfile'] ) ? $options['destfile'] : '';
717719
718720 $sourceDescriptor = $this->getSourceSection();
719721 $descriptor = $sourceDescriptor
@@ -1032,7 +1034,10 @@
10331035 'wgAjaxUploadDestCheck' => $wgUseAjax && $wgAjaxUploadDestCheck,
10341036 'wgAjaxLicensePreview' => $wgUseAjax && $wgAjaxLicensePreview,
10351037 'wgEnableFirefogg' => (bool)$wgEnableFirefogg,
1036 - 'wgUploadAutoFill' => (bool)$autofill,
 1038+ 'wgUploadAutoFill' => (bool)$autofill &&
 1039+ // If we received mDestFile from the request, don't autofill
 1040+ // the wpDestFile textbox
 1041+ $this->mDestFile === '',
10371042 'wgUploadSourceIds' => $this->mSourceIds,
10381043 'wgStrictFileExtensions' => $wgStrictFileExtensions,
10391044 'wgCapitalizeUploads' => MWNamespace::isCapitalized( NS_FILE ),

Status & tagging log