MediaWiki  1.30.0
SpecialUpload.php
Go to the documentation of this file.
1 <?php
26 
33 class SpecialUpload extends SpecialPage {
38  public function __construct( $request = null ) {
39  parent::__construct( 'Upload', 'upload' );
40  }
41 
42  public function doesWrites() {
43  return true;
44  }
45 
49  public $mRequest;
50  public $mSourceType;
51 
53  public $mUpload;
54 
56  public $mLocalFile;
58 
63  public $mComment;
64  public $mLicense;
65 
69  public $mWatchthis;
72 
76 
78  public $mForReUpload;
79 
82  public $mTokenOk;
83 
85  public $mUploadSuccessful = false;
86 
90 
94  protected function loadRequest() {
95  $this->mRequest = $request = $this->getRequest();
96  $this->mSourceType = $request->getVal( 'wpSourceType', 'file' );
97  $this->mUpload = UploadBase::createFromRequest( $request );
98  $this->mUploadClicked = $request->wasPosted()
99  && ( $request->getCheck( 'wpUpload' )
100  || $request->getCheck( 'wpUploadIgnoreWarning' ) );
101 
102  // Guess the desired name from the filename if not provided
103  $this->mDesiredDestName = $request->getText( 'wpDestFile' );
104  if ( !$this->mDesiredDestName && $request->getFileName( 'wpUploadFile' ) !== null ) {
105  $this->mDesiredDestName = $request->getFileName( 'wpUploadFile' );
106  }
107  $this->mLicense = $request->getText( 'wpLicense' );
108 
109  $this->mDestWarningAck = $request->getText( 'wpDestFileWarningAck' );
110  $this->mIgnoreWarning = $request->getCheck( 'wpIgnoreWarning' )
111  || $request->getCheck( 'wpUploadIgnoreWarning' );
112  $this->mWatchthis = $request->getBool( 'wpWatchthis' ) && $this->getUser()->isLoggedIn();
113  $this->mCopyrightStatus = $request->getText( 'wpUploadCopyStatus' );
114  $this->mCopyrightSource = $request->getText( 'wpUploadSource' );
115 
116  $this->mForReUpload = $request->getBool( 'wpForReUpload' ); // updating a file
117 
118  $commentDefault = '';
119  $commentMsg = wfMessage( 'upload-default-description' )->inContentLanguage();
120  if ( !$this->mForReUpload && !$commentMsg->isDisabled() ) {
121  $commentDefault = $commentMsg->plain();
122  }
123  $this->mComment = $request->getText( 'wpUploadDescription', $commentDefault );
124 
125  $this->mCancelUpload = $request->getCheck( 'wpCancelUpload' )
126  || $request->getCheck( 'wpReUpload' ); // b/w compat
127 
128  // If it was posted check for the token (no remote POST'ing with user credentials)
129  $token = $request->getVal( 'wpEditToken' );
130  $this->mTokenOk = $this->getUser()->matchEditToken( $token );
131 
132  $this->uploadFormTextTop = '';
133  $this->uploadFormTextAfterSummary = '';
134  }
135 
144  public function userCanExecute( User $user ) {
145  return UploadBase::isEnabled() && parent::userCanExecute( $user );
146  }
147 
159  public function execute( $par ) {
160  $this->useTransactionalTimeLimit();
161 
162  $this->setHeaders();
163  $this->outputHeader();
164 
165  # Check uploading enabled
166  if ( !UploadBase::isEnabled() ) {
167  throw new ErrorPageError( 'uploaddisabled', 'uploaddisabledtext' );
168  }
169 
170  $this->addHelpLink( 'Help:Managing files' );
171 
172  # Check permissions
173  $user = $this->getUser();
174  $permissionRequired = UploadBase::isAllowed( $user );
175  if ( $permissionRequired !== true ) {
176  throw new PermissionsError( $permissionRequired );
177  }
178 
179  # Check blocks
180  if ( $user->isBlocked() ) {
181  throw new UserBlockedError( $user->getBlock() );
182  }
183 
184  // Global blocks
185  if ( $user->isBlockedGlobally() ) {
186  throw new UserBlockedError( $user->getGlobalBlock() );
187  }
188 
189  # Check whether we actually want to allow changing stuff
190  $this->checkReadOnly();
191 
192  $this->loadRequest();
193 
194  # Unsave the temporary file in case this was a cancelled upload
195  if ( $this->mCancelUpload ) {
196  if ( !$this->unsaveUploadedFile() ) {
197  # Something went wrong, so unsaveUploadedFile showed a warning
198  return;
199  }
200  }
201 
202  # Process upload or show a form
203  if (
204  $this->mTokenOk && !$this->mCancelUpload &&
205  ( $this->mUpload && $this->mUploadClicked )
206  ) {
207  $this->processUpload();
208  } else {
209  # Backwards compatibility hook
210  // Avoid PHP 7.1 warning of passing $this by reference
211  $upload = $this;
212  if ( !Hooks::run( 'UploadForm:initial', [ &$upload ] ) ) {
213  wfDebug( "Hook 'UploadForm:initial' broke output of the upload form\n" );
214 
215  return;
216  }
217  $this->showUploadForm( $this->getUploadForm() );
218  }
219 
220  # Cleanup
221  if ( $this->mUpload ) {
222  $this->mUpload->cleanupTempFile();
223  }
224  }
225 
231  protected function showUploadForm( $form ) {
232  # Add links if file was previously deleted
233  if ( $this->mDesiredDestName ) {
234  $this->showViewDeletedLinks();
235  }
236 
237  if ( $form instanceof HTMLForm ) {
238  $form->show();
239  } else {
240  $this->getOutput()->addHTML( $form );
241  }
242  }
243 
252  protected function getUploadForm( $message = '', $sessionKey = '', $hideIgnoreWarning = false ) {
253  # Initialize form
254  $context = new DerivativeContext( $this->getContext() );
255  $context->setTitle( $this->getPageTitle() ); // Remove subpage
256  $form = new UploadForm( [
257  'watch' => $this->getWatchCheck(),
258  'forreupload' => $this->mForReUpload,
259  'sessionkey' => $sessionKey,
260  'hideignorewarning' => $hideIgnoreWarning,
261  'destwarningack' => (bool)$this->mDestWarningAck,
262 
263  'description' => $this->mComment,
264  'texttop' => $this->uploadFormTextTop,
265  'textaftersummary' => $this->uploadFormTextAfterSummary,
266  'destfile' => $this->mDesiredDestName,
267  ], $context, $this->getLinkRenderer() );
268 
269  # Check the token, but only if necessary
270  if (
271  !$this->mTokenOk && !$this->mCancelUpload &&
272  ( $this->mUpload && $this->mUploadClicked )
273  ) {
274  $form->addPreText( $this->msg( 'session_fail_preview' )->parse() );
275  }
276 
277  # Give a notice if the user is uploading a file that has been deleted or moved
278  # Note that this is independent from the message 'filewasdeleted'
279  $desiredTitleObj = Title::makeTitleSafe( NS_FILE, $this->mDesiredDestName );
280  $delNotice = ''; // empty by default
281  if ( $desiredTitleObj instanceof Title && !$desiredTitleObj->exists() ) {
282  $dbr = wfGetDB( DB_REPLICA );
283 
284  LogEventsList::showLogExtract( $delNotice, [ 'delete', 'move' ],
285  $desiredTitleObj,
286  '', [ 'lim' => 10,
287  'conds' => [ 'log_action != ' . $dbr->addQuotes( 'revision' ) ],
288  'showIfEmpty' => false,
289  'msgKey' => [ 'upload-recreate-warning' ] ]
290  );
291  }
292  $form->addPreText( $delNotice );
293 
294  # Add text to form
295  $form->addPreText( '<div id="uploadtext">' .
296  $this->msg( 'uploadtext', [ $this->mDesiredDestName ] )->parseAsBlock() .
297  '</div>' );
298  # Add upload error message
299  $form->addPreText( $message );
300 
301  # Add footer to form
302  $uploadFooter = $this->msg( 'uploadfooter' );
303  if ( !$uploadFooter->isDisabled() ) {
304  $form->addPostText( '<div id="mw-upload-footer-message">'
305  . $uploadFooter->parseAsBlock() . "</div>\n" );
306  }
307 
308  return $form;
309  }
310 
314  protected function showViewDeletedLinks() {
315  $title = Title::makeTitleSafe( NS_FILE, $this->mDesiredDestName );
316  $user = $this->getUser();
317  // Show a subtitle link to deleted revisions (to sysops et al only)
318  if ( $title instanceof Title ) {
319  $count = $title->isDeleted();
320  if ( $count > 0 && $user->isAllowed( 'deletedhistory' ) ) {
321  $restorelink = $this->getLinkRenderer()->makeKnownLink(
322  SpecialPage::getTitleFor( 'Undelete', $title->getPrefixedText() ),
323  $this->msg( 'restorelink' )->numParams( $count )->text()
324  );
325  $link = $this->msg( $user->isAllowed( 'delete' ) ? 'thisisdeleted' : 'viewdeleted' )
326  ->rawParams( $restorelink )->parseAsBlock();
327  $this->getOutput()->addHTML( "<div id=\"contentSub2\">{$link}</div>" );
328  }
329  }
330  }
331 
343  protected function showRecoverableUploadError( $message ) {
344  $stashStatus = $this->mUpload->tryStashFile( $this->getUser() );
345  if ( $stashStatus->isGood() ) {
346  $sessionKey = $stashStatus->getValue()->getFileKey();
347  $uploadWarning = 'upload-tryagain';
348  } else {
349  $sessionKey = null;
350  $uploadWarning = 'upload-tryagain-nostash';
351  }
352  $message = '<h2>' . $this->msg( 'uploaderror' )->escaped() . "</h2>\n" .
353  '<div class="error">' . $message . "</div>\n";
354 
355  $form = $this->getUploadForm( $message, $sessionKey );
356  $form->setSubmitText( $this->msg( $uploadWarning )->escaped() );
357  $this->showUploadForm( $form );
358  }
359 
368  protected function showUploadWarning( $warnings ) {
369  # If there are no warnings, or warnings we can ignore, return early.
370  # mDestWarningAck is set when some javascript has shown the warning
371  # to the user. mForReUpload is set when the user clicks the "upload a
372  # new version" link.
373  if ( !$warnings || ( count( $warnings ) == 1
374  && isset( $warnings['exists'] )
375  && ( $this->mDestWarningAck || $this->mForReUpload ) )
376  ) {
377  return false;
378  }
379 
380  $stashStatus = $this->mUpload->tryStashFile( $this->getUser() );
381  if ( $stashStatus->isGood() ) {
382  $sessionKey = $stashStatus->getValue()->getFileKey();
383  $uploadWarning = 'uploadwarning-text';
384  } else {
385  $sessionKey = null;
386  $uploadWarning = 'uploadwarning-text-nostash';
387  }
388 
389  // Add styles for the warning, reused from the live preview
390  $this->getOutput()->addModuleStyles( 'mediawiki.special.upload.styles' );
391 
392  $linkRenderer = $this->getLinkRenderer();
393  $warningHtml = '<h2>' . $this->msg( 'uploadwarning' )->escaped() . "</h2>\n"
394  . '<div class="mw-destfile-warning"><ul>';
395  foreach ( $warnings as $warning => $args ) {
396  if ( $warning == 'badfilename' ) {
397  $this->mDesiredDestName = Title::makeTitle( NS_FILE, $args )->getText();
398  }
399  if ( $warning == 'exists' ) {
400  $msg = "\t<li>" . self::getExistsWarning( $args ) . "</li>\n";
401  } elseif ( $warning == 'no-change' ) {
402  $file = $args;
403  $filename = $file->getTitle()->getPrefixedText();
404  $msg = "\t<li>" . wfMessage( 'fileexists-no-change', $filename )->parse() . "</li>\n";
405  } elseif ( $warning == 'duplicate-version' ) {
406  $file = $args[0];
407  $count = count( $args );
408  $filename = $file->getTitle()->getPrefixedText();
409  $message = wfMessage( 'fileexists-duplicate-version' )
410  ->params( $filename )
411  ->numParams( $count );
412  $msg = "\t<li>" . $message->parse() . "</li>\n";
413  } elseif ( $warning == 'was-deleted' ) {
414  # If the file existed before and was deleted, warn the user of this
415  $ltitle = SpecialPage::getTitleFor( 'Log' );
416  $llink = $linkRenderer->makeKnownLink(
417  $ltitle,
418  wfMessage( 'deletionlog' )->text(),
419  [],
420  [
421  'type' => 'delete',
422  'page' => Title::makeTitle( NS_FILE, $args )->getPrefixedText(),
423  ]
424  );
425  $msg = "\t<li>" . wfMessage( 'filewasdeleted' )->rawParams( $llink )->parse() . "</li>\n";
426  } elseif ( $warning == 'duplicate' ) {
427  $msg = $this->getDupeWarning( $args );
428  } elseif ( $warning == 'duplicate-archive' ) {
429  if ( $args === '' ) {
430  $msg = "\t<li>" . $this->msg( 'file-deleted-duplicate-notitle' )->parse()
431  . "</li>\n";
432  } else {
433  $msg = "\t<li>" . $this->msg( 'file-deleted-duplicate',
434  Title::makeTitle( NS_FILE, $args )->getPrefixedText() )->parse()
435  . "</li>\n";
436  }
437  } else {
438  if ( $args === true ) {
439  $args = [];
440  } elseif ( !is_array( $args ) ) {
441  $args = [ $args ];
442  }
443  $msg = "\t<li>" . $this->msg( $warning, $args )->parse() . "</li>\n";
444  }
445  $warningHtml .= $msg;
446  }
447  $warningHtml .= "</ul></div>\n";
448  $warningHtml .= $this->msg( $uploadWarning )->parseAsBlock();
449 
450  $form = $this->getUploadForm( $warningHtml, $sessionKey, /* $hideIgnoreWarning */ true );
451  $form->setSubmitText( $this->msg( 'upload-tryagain' )->text() );
452  $form->addButton( [
453  'name' => 'wpUploadIgnoreWarning',
454  'value' => $this->msg( 'ignorewarning' )->text()
455  ] );
456  $form->addButton( [
457  'name' => 'wpCancelUpload',
458  'value' => $this->msg( 'reuploaddesc' )->text()
459  ] );
460 
461  $this->showUploadForm( $form );
462 
463  # Indicate that we showed a form
464  return true;
465  }
466 
472  protected function showUploadError( $message ) {
473  $message = '<h2>' . $this->msg( 'uploadwarning' )->escaped() . "</h2>\n" .
474  '<div class="error">' . $message . "</div>\n";
475  $this->showUploadForm( $this->getUploadForm( $message ) );
476  }
477 
482  protected function processUpload() {
483  // Fetch the file if required
484  $status = $this->mUpload->fetchFile();
485  if ( !$status->isOK() ) {
486  $this->showUploadError( $this->getOutput()->parse( $status->getWikiText() ) );
487 
488  return;
489  }
490  // Avoid PHP 7.1 warning of passing $this by reference
491  $upload = $this;
492  if ( !Hooks::run( 'UploadForm:BeforeProcessing', [ &$upload ] ) ) {
493  wfDebug( "Hook 'UploadForm:BeforeProcessing' broke processing the file.\n" );
494  // This code path is deprecated. If you want to break upload processing
495  // do so by hooking into the appropriate hooks in UploadBase::verifyUpload
496  // and UploadBase::verifyFile.
497  // If you use this hook to break uploading, the user will be returned
498  // an empty form with no error message whatsoever.
499  return;
500  }
501 
502  // Upload verification
503  $details = $this->mUpload->verifyUpload();
504  if ( $details['status'] != UploadBase::OK ) {
505  $this->processVerificationError( $details );
506 
507  return;
508  }
509 
510  // Verify permissions for this title
511  $permErrors = $this->mUpload->verifyTitlePermissions( $this->getUser() );
512  if ( $permErrors !== true ) {
513  $code = array_shift( $permErrors[0] );
514  $this->showRecoverableUploadError( $this->msg( $code, $permErrors[0] )->parse() );
515 
516  return;
517  }
518 
519  $this->mLocalFile = $this->mUpload->getLocalFile();
520 
521  // Check warnings if necessary
522  if ( !$this->mIgnoreWarning ) {
523  $warnings = $this->mUpload->checkWarnings();
524  if ( $this->showUploadWarning( $warnings ) ) {
525  return;
526  }
527  }
528 
529  // This is as late as we can throttle, after expected issues have been handled
530  if ( UploadBase::isThrottled( $this->getUser() ) ) {
532  $this->msg( 'actionthrottledtext' )->escaped()
533  );
534  return;
535  }
536 
537  // Get the page text if this is not a reupload
538  if ( !$this->mForReUpload ) {
539  $pageText = self::getInitialPageText( $this->mComment, $this->mLicense,
540  $this->mCopyrightStatus, $this->mCopyrightSource, $this->getConfig() );
541  } else {
542  $pageText = false;
543  }
544 
545  $changeTags = $this->getRequest()->getVal( 'wpChangeTags' );
546  if ( is_null( $changeTags ) || $changeTags === '' ) {
547  $changeTags = [];
548  } else {
549  $changeTags = array_filter( array_map( 'trim', explode( ',', $changeTags ) ) );
550  }
551 
552  if ( $changeTags ) {
553  $changeTagsStatus = ChangeTags::canAddTagsAccompanyingChange(
554  $changeTags, $this->getUser() );
555  if ( !$changeTagsStatus->isOK() ) {
556  $this->showUploadError( $this->getOutput()->parse( $changeTagsStatus->getWikiText() ) );
557 
558  return;
559  }
560  }
561 
562  $status = $this->mUpload->performUpload(
563  $this->mComment,
564  $pageText,
565  $this->mWatchthis,
566  $this->getUser(),
567  $changeTags
568  );
569 
570  if ( !$status->isGood() ) {
571  $this->showRecoverableUploadError( $this->getOutput()->parse( $status->getWikiText() ) );
572 
573  return;
574  }
575 
576  // Success, redirect to description page
577  $this->mUploadSuccessful = true;
578  // Avoid PHP 7.1 warning of passing $this by reference
579  $upload = $this;
580  Hooks::run( 'SpecialUploadComplete', [ &$upload ] );
581  $this->getOutput()->redirect( $this->mLocalFile->getTitle()->getFullURL() );
582  }
583 
593  public static function getInitialPageText( $comment = '', $license = '',
594  $copyStatus = '', $source = '', Config $config = null
595  ) {
596  if ( $config === null ) {
597  wfDebug( __METHOD__ . ' called without a Config instance passed to it' );
598  $config = MediaWikiServices::getInstance()->getMainConfig();
599  }
600 
601  $msg = [];
602  $forceUIMsgAsContentMsg = (array)$config->get( 'ForceUIMsgAsContentMsg' );
603  /* These messages are transcluded into the actual text of the description page.
604  * Thus, forcing them as content messages makes the upload to produce an int: template
605  * instead of hardcoding it there in the uploader language.
606  */
607  foreach ( [ 'license-header', 'filedesc', 'filestatus', 'filesource' ] as $msgName ) {
608  if ( in_array( $msgName, $forceUIMsgAsContentMsg ) ) {
609  $msg[$msgName] = "{{int:$msgName}}";
610  } else {
611  $msg[$msgName] = wfMessage( $msgName )->inContentLanguage()->text();
612  }
613  }
614 
615  if ( $config->get( 'UseCopyrightUpload' ) ) {
616  $licensetxt = '';
617  if ( $license != '' ) {
618  $licensetxt = '== ' . $msg['license-header'] . " ==\n" . '{{' . $license . '}}' . "\n";
619  }
620  $pageText = '== ' . $msg['filedesc'] . " ==\n" . $comment . "\n" .
621  '== ' . $msg['filestatus'] . " ==\n" . $copyStatus . "\n" .
622  "$licensetxt" .
623  '== ' . $msg['filesource'] . " ==\n" . $source;
624  } else {
625  if ( $license != '' ) {
626  $filedesc = $comment == '' ? '' : '== ' . $msg['filedesc'] . " ==\n" . $comment . "\n";
627  $pageText = $filedesc .
628  '== ' . $msg['license-header'] . " ==\n" . '{{' . $license . '}}' . "\n";
629  } else {
630  $pageText = $comment;
631  }
632  }
633 
634  return $pageText;
635  }
636 
649  protected function getWatchCheck() {
650  if ( $this->getUser()->getOption( 'watchdefault' ) ) {
651  // Watch all edits!
652  return true;
653  }
654 
655  $desiredTitleObj = Title::makeTitleSafe( NS_FILE, $this->mDesiredDestName );
656  if ( $desiredTitleObj instanceof Title && $this->getUser()->isWatched( $desiredTitleObj ) ) {
657  // Already watched, don't change that
658  return true;
659  }
660 
661  $local = wfLocalFile( $this->mDesiredDestName );
662  if ( $local && $local->exists() ) {
663  // We're uploading a new version of an existing file.
664  // No creation, so don't watch it if we're not already.
665  return false;
666  } else {
667  // New page should get watched if that's our option.
668  return $this->getUser()->getOption( 'watchcreations' ) ||
669  $this->getUser()->getOption( 'watchuploads' );
670  }
671  }
672 
679  protected function processVerificationError( $details ) {
680  switch ( $details['status'] ) {
682  case UploadBase::MIN_LENGTH_PARTNAME:
683  $this->showRecoverableUploadError( $this->msg( 'minlength1' )->escaped() );
684  break;
685  case UploadBase::ILLEGAL_FILENAME:
686  $this->showRecoverableUploadError( $this->msg( 'illegalfilename',
687  $details['filtered'] )->parse() );
688  break;
689  case UploadBase::FILENAME_TOO_LONG:
690  $this->showRecoverableUploadError( $this->msg( 'filename-toolong' )->escaped() );
691  break;
692  case UploadBase::FILETYPE_MISSING:
693  $this->showRecoverableUploadError( $this->msg( 'filetype-missing' )->parse() );
694  break;
695  case UploadBase::WINDOWS_NONASCII_FILENAME:
696  $this->showRecoverableUploadError( $this->msg( 'windows-nonascii-filename' )->parse() );
697  break;
698 
700  case UploadBase::EMPTY_FILE:
701  $this->showUploadError( $this->msg( 'emptyfile' )->escaped() );
702  break;
703  case UploadBase::FILE_TOO_LARGE:
704  $this->showUploadError( $this->msg( 'largefileserver' )->escaped() );
705  break;
706  case UploadBase::FILETYPE_BADTYPE:
707  $msg = $this->msg( 'filetype-banned-type' );
708  if ( isset( $details['blacklistedExt'] ) ) {
709  $msg->params( $this->getLanguage()->commaList( $details['blacklistedExt'] ) );
710  } else {
711  $msg->params( $details['finalExt'] );
712  }
713  $extensions = array_unique( $this->getConfig()->get( 'FileExtensions' ) );
714  $msg->params( $this->getLanguage()->commaList( $extensions ),
715  count( $extensions ) );
716 
717  // Add PLURAL support for the first parameter. This results
718  // in a bit unlogical parameter sequence, but does not break
719  // old translations
720  if ( isset( $details['blacklistedExt'] ) ) {
721  $msg->params( count( $details['blacklistedExt'] ) );
722  } else {
723  $msg->params( 1 );
724  }
725 
726  $this->showUploadError( $msg->parse() );
727  break;
728  case UploadBase::VERIFICATION_ERROR:
729  unset( $details['status'] );
730  $code = array_shift( $details['details'] );
731  $this->showUploadError( $this->msg( $code, $details['details'] )->parse() );
732  break;
733  case UploadBase::HOOK_ABORTED:
734  if ( is_array( $details['error'] ) ) { # allow hooks to return error details in an array
735  $args = $details['error'];
736  $error = array_shift( $args );
737  } else {
738  $error = $details['error'];
739  $args = null;
740  }
741 
742  $this->showUploadError( $this->msg( $error, $args )->parse() );
743  break;
744  default:
745  throw new MWException( __METHOD__ . ": Unknown value `{$details['status']}`" );
746  }
747  }
748 
754  protected function unsaveUploadedFile() {
755  if ( !( $this->mUpload instanceof UploadFromStash ) ) {
756  return true;
757  }
758  $success = $this->mUpload->unsaveUploadedFile();
759  if ( !$success ) {
760  $this->getOutput()->showFileDeleteError( $this->mUpload->getTempPath() );
761 
762  return false;
763  } else {
764  return true;
765  }
766  }
767 
768  /*** Functions for formatting warnings ***/
769 
777  public static function getExistsWarning( $exists ) {
778  if ( !$exists ) {
779  return '';
780  }
781 
782  $file = $exists['file'];
783  $filename = $file->getTitle()->getPrefixedText();
784  $warnMsg = null;
785 
786  if ( $exists['warning'] == 'exists' ) {
787  // Exact match
788  $warnMsg = wfMessage( 'fileexists', $filename );
789  } elseif ( $exists['warning'] == 'page-exists' ) {
790  // Page exists but file does not
791  $warnMsg = wfMessage( 'filepageexists', $filename );
792  } elseif ( $exists['warning'] == 'exists-normalized' ) {
793  $warnMsg = wfMessage( 'fileexists-extension', $filename,
794  $exists['normalizedFile']->getTitle()->getPrefixedText() );
795  } elseif ( $exists['warning'] == 'thumb' ) {
796  // Swapped argument order compared with other messages for backwards compatibility
797  $warnMsg = wfMessage( 'fileexists-thumbnail-yes',
798  $exists['thumbFile']->getTitle()->getPrefixedText(), $filename );
799  } elseif ( $exists['warning'] == 'thumb-name' ) {
800  // Image w/o '180px-' does not exists, but we do not like these filenames
801  $name = $file->getName();
802  $badPart = substr( $name, 0, strpos( $name, '-' ) + 1 );
803  $warnMsg = wfMessage( 'file-thumbnail-no', $badPart );
804  } elseif ( $exists['warning'] == 'bad-prefix' ) {
805  $warnMsg = wfMessage( 'filename-bad-prefix', $exists['prefix'] );
806  }
807 
808  return $warnMsg ? $warnMsg->title( $file->getTitle() )->parse() : '';
809  }
810 
816  public function getDupeWarning( $dupes ) {
817  if ( !$dupes ) {
818  return '';
819  }
820 
821  $gallery = ImageGalleryBase::factory( false, $this->getContext() );
822  $gallery->setShowBytes( false );
823  $gallery->setShowDimensions( false );
824  foreach ( $dupes as $file ) {
825  $gallery->add( $file->getTitle() );
826  }
827 
828  return '<li>' .
829  $this->msg( 'file-exists-duplicate' )->numParams( count( $dupes ) )->parse() .
830  $gallery->toHTML() . "</li>\n";
831  }
832 
833  protected function getGroupName() {
834  return 'media';
835  }
836 
845  public static function rotationEnabled() {
846  $bitmapHandler = new BitmapHandler();
847  return $bitmapHandler->autoRotateEnabled();
848  }
849 }
SpecialPage\getPageTitle
getPageTitle( $subpage=false)
Get a self-referential title object.
Definition: SpecialPage.php:628
SpecialUpload\getInitialPageText
static getInitialPageText( $comment='', $license='', $copyStatus='', $source='', Config $config=null)
Get the initial image page text based on a comment and optional file status information.
Definition: SpecialUpload.php:593
$user
please add to it if you re going to add events to the MediaWiki code where normally authentication against an external auth plugin would be creating a account $user
Definition: hooks.txt:244
FauxRequest
WebRequest clone which takes values from a provided array.
Definition: FauxRequest.php:33
SpecialUpload\userCanExecute
userCanExecute(User $user)
This page can be shown if uploading is enabled.
Definition: SpecialUpload.php:144
SpecialPage\msg
msg( $key)
Wrapper around wfMessage that sets the current context.
Definition: SpecialPage.php:746
UserBlockedError
Show an error when the user tries to do something whilst blocked.
Definition: UserBlockedError.php:27
$context
do that in ParserLimitReportFormat instead use this to modify the parameters of the image all existing parser cache entries will be invalid To avoid you ll need to handle that somehow(e.g. with the RejectParserCacheValue hook) because MediaWiki won 't do it for you. & $defaults also a ContextSource after deleting those rows but within the same transaction you ll probably need to make sure the header is varied on and they can depend only on the ResourceLoaderContext $context
Definition: hooks.txt:2581
hooks
Using a hook running we can avoid having all this option specific stuff in our mainline code Using hooks
Definition: hooks.txt:73
SpecialPage\getOutput
getOutput()
Get the OutputPage being used for this instance.
Definition: SpecialPage.php:675
SpecialUpload\$mSourceType
$mSourceType
Definition: SpecialUpload.php:50
SpecialPage\getTitle
getTitle( $subpage=false)
Get a self-referential title object.
Definition: SpecialPage.php:617
SpecialUpload\getGroupName
getGroupName()
Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-gro...
Definition: SpecialUpload.php:833
captcha-old.count
count
Definition: captcha-old.py:249
text
design txt This is a brief overview of the new design More thorough and up to date information is available on the documentation wiki at etc Handles the details of getting and saving to the user table of the and dealing with sessions and cookies OutputPage Encapsulates the entire HTML page that will be sent in response to any server request It is used by calling its functions to add text
Definition: design.txt:12
SpecialUpload\doesWrites
doesWrites()
Indicates whether this special page may perform database writes.
Definition: SpecialUpload.php:42
$status
Status::newGood()` to allow deletion, and then `return false` from the hook function. Ensure you consume the 'ChangeTagAfterDelete' hook to carry out custom deletion actions. $tag:name of the tag $user:user initiating the action & $status:Status object. See above. 'ChangeTagsListActive':Allows you to nominate which of the tags your extension uses are in active use. & $tags:list of all active tags. Append to this array. 'ChangeTagsAfterUpdateTags':Called after tags have been updated with the ChangeTags::updateTags function. Params:$addedTags:tags effectively added in the update $removedTags:tags effectively removed in the update $prevTags:tags that were present prior to the update $rc_id:recentchanges table id $rev_id:revision table id $log_id:logging table id $params:tag params $rc:RecentChange being tagged when the tagging accompanies the action or null $user:User who performed the tagging when the tagging is subsequent to the action or null 'ChangeTagsAllowedAdd':Called when checking if a user can add tags to a change. & $allowedTags:List of all the tags the user is allowed to add. Any tags the user wants to add( $addTags) that are not in this array will cause it to fail. You may add or remove tags to this array as required. $addTags:List of tags user intends to add. $user:User who is adding the tags. 'ChangeUserGroups':Called before user groups are changed. $performer:The User who will perform the change $user:The User whose groups will be changed & $add:The groups that will be added & $remove:The groups that will be removed 'Collation::factory':Called if $wgCategoryCollation is an unknown collation. $collationName:Name of the collation in question & $collationObject:Null. Replace with a subclass of the Collation class that implements the collation given in $collationName. 'ConfirmEmailComplete':Called after a user 's email has been confirmed successfully. $user:user(object) whose email is being confirmed 'ContentAlterParserOutput':Modify parser output for a given content object. Called by Content::getParserOutput after parsing has finished. Can be used for changes that depend on the result of the parsing but have to be done before LinksUpdate is called(such as adding tracking categories based on the rendered HTML). $content:The Content to render $title:Title of the page, as context $parserOutput:ParserOutput to manipulate 'ContentGetParserOutput':Customize parser output for a given content object, called by AbstractContent::getParserOutput. May be used to override the normal model-specific rendering of page content. $content:The Content to render $title:Title of the page, as context $revId:The revision ID, as context $options:ParserOptions for rendering. To avoid confusing the parser cache, the output can only depend on parameters provided to this hook function, not on global state. $generateHtml:boolean, indicating whether full HTML should be generated. If false, generation of HTML may be skipped, but other information should still be present in the ParserOutput object. & $output:ParserOutput, to manipulate or replace 'ContentHandlerDefaultModelFor':Called when the default content model is determined for a given title. May be used to assign a different model for that title. $title:the Title in question & $model:the model name. Use with CONTENT_MODEL_XXX constants. 'ContentHandlerForModelID':Called when a ContentHandler is requested for a given content model name, but no entry for that model exists in $wgContentHandlers. Note:if your extension implements additional models via this hook, please use GetContentModels hook to make them known to core. $modeName:the requested content model name & $handler:set this to a ContentHandler object, if desired. 'ContentModelCanBeUsedOn':Called to determine whether that content model can be used on a given page. This is especially useful to prevent some content models to be used in some special location. $contentModel:ID of the content model in question $title:the Title in question. & $ok:Output parameter, whether it is OK to use $contentModel on $title. Handler functions that modify $ok should generally return false to prevent further hooks from further modifying $ok. 'ContribsPager::getQueryInfo':Before the contributions query is about to run & $pager:Pager object for contributions & $queryInfo:The query for the contribs Pager 'ContribsPager::reallyDoQuery':Called before really executing the query for My Contributions & $data:an array of results of all contribs queries $pager:The ContribsPager object hooked into $offset:Index offset, inclusive $limit:Exact query limit $descending:Query direction, false for ascending, true for descending 'ContributionsLineEnding':Called before a contributions HTML line is finished $page:SpecialPage object for contributions & $ret:the HTML line $row:the DB row for this line & $classes:the classes to add to the surrounding< li > & $attribs:associative array of other HTML attributes for the< li > element. Currently only data attributes reserved to MediaWiki are allowed(see Sanitizer::isReservedDataAttribute). 'ContributionsToolLinks':Change tool links above Special:Contributions $id:User identifier $title:User page title & $tools:Array of tool links $specialPage:SpecialPage instance for context and services. Can be either SpecialContributions or DeletedContributionsPage. Extensions should type hint against a generic SpecialPage though. 'ConvertContent':Called by AbstractContent::convert when a conversion to another content model is requested. Handler functions that modify $result should generally return false to disable further attempts at conversion. $content:The Content object to be converted. $toModel:The ID of the content model to convert to. $lossy:boolean indicating whether lossy conversion is allowed. & $result:Output parameter, in case the handler function wants to provide a converted Content object. Note that $result->getContentModel() must return $toModel. 'CustomEditor':When invoking the page editor Return true to allow the normal editor to be used, or false if implementing a custom editor, e.g. for a special namespace, etc. $article:Article being edited $user:User performing the edit 'DatabaseOraclePostInit':Called after initialising an Oracle database $db:the DatabaseOracle object 'DeletedContribsPager::reallyDoQuery':Called before really executing the query for Special:DeletedContributions Similar to ContribsPager::reallyDoQuery & $data:an array of results of all contribs queries $pager:The DeletedContribsPager object hooked into $offset:Index offset, inclusive $limit:Exact query limit $descending:Query direction, false for ascending, true for descending 'DeletedContributionsLineEnding':Called before a DeletedContributions HTML line is finished. Similar to ContributionsLineEnding $page:SpecialPage object for DeletedContributions & $ret:the HTML line $row:the DB row for this line & $classes:the classes to add to the surrounding< li > & $attribs:associative array of other HTML attributes for the< li > element. Currently only data attributes reserved to MediaWiki are allowed(see Sanitizer::isReservedDataAttribute). 'DifferenceEngineAfterLoadNewText':called in DifferenceEngine::loadNewText() after the new revision 's content has been loaded into the class member variable $differenceEngine->mNewContent but before returning true from this function. $differenceEngine:DifferenceEngine object 'DifferenceEngineLoadTextAfterNewContentIsLoaded':called in DifferenceEngine::loadText() after the new revision 's content has been loaded into the class member variable $differenceEngine->mNewContent but before checking if the variable 's value is null. This hook can be used to inject content into said class member variable. $differenceEngine:DifferenceEngine object 'DifferenceEngineMarkPatrolledLink':Allows extensions to change the "mark as patrolled" link which is shown both on the diff header as well as on the bottom of a page, usually wrapped in a span element which has class="patrollink". $differenceEngine:DifferenceEngine object & $markAsPatrolledLink:The "mark as patrolled" link HTML(string) $rcid:Recent change ID(rc_id) for this change(int) 'DifferenceEngineMarkPatrolledRCID':Allows extensions to possibly change the rcid parameter. For example the rcid might be set to zero due to the user being the same as the performer of the change but an extension might still want to show it under certain conditions. & $rcid:rc_id(int) of the change or 0 $differenceEngine:DifferenceEngine object $change:RecentChange object $user:User object representing the current user 'DifferenceEngineNewHeader':Allows extensions to change the $newHeader variable, which contains information about the new revision, such as the revision 's author, whether the revision was marked as a minor edit or not, etc. $differenceEngine:DifferenceEngine object & $newHeader:The string containing the various #mw-diff-otitle[1-5] divs, which include things like revision author info, revision comment, RevisionDelete link and more $formattedRevisionTools:Array containing revision tools, some of which may have been injected with the DiffRevisionTools hook $nextlink:String containing the link to the next revision(if any) $status
Definition: hooks.txt:1245
use
as see the revision history and available at free of to any person obtaining a copy of this software and associated documentation to deal in the Software without including without limitation the rights to use
Definition: MIT-LICENSE.txt:10
SpecialUpload\$mUploadClicked
$mUploadClicked
Definition: SpecialUpload.php:57
UploadForm
Sub class of HTMLForm that provides the form section of SpecialUpload.
Definition: UploadForm.php:27
NS_FILE
const NS_FILE
Definition: Defines.php:71
SpecialUpload\processUpload
processUpload()
Do the upload.
Definition: SpecialUpload.php:482
SpecialUpload\$mCopyrightStatus
$mCopyrightStatus
Definition: SpecialUpload.php:70
SpecialUpload\unsaveUploadedFile
unsaveUploadedFile()
Remove a temporarily kept file stashed by saveTempUploadedFile().
Definition: SpecialUpload.php:754
SpecialPage\getTitleFor
static getTitleFor( $name, $subpage=false, $fragment='')
Get a localised Title object for a specified special page name If you don't need a full Title object,...
Definition: SpecialPage.php:82
UploadFromStash
Implements uploading from previously stored file.
Definition: UploadFromStash.php:30
SpecialUpload\$mLocalFile
LocalFile $mLocalFile
Definition: SpecialUpload.php:56
SpecialPage\useTransactionalTimeLimit
useTransactionalTimeLimit()
Call wfTransactionalTimeLimit() if this request was POSTed.
Definition: SpecialPage.php:850
$name
Allows to change the fields on the form that will be generated $name
Definition: hooks.txt:302
PermissionsError
Show an error when a user tries to do something they do not have the necessary permissions for.
Definition: PermissionsError.php:28
SpecialPage\getLanguage
getLanguage()
Shortcut to get user's language.
Definition: SpecialPage.php:705
$success
$success
Definition: NoLocalSettings.php:44
SpecialUpload\showViewDeletedLinks
showViewDeletedLinks()
Shows the "view X deleted revivions link"".
Definition: SpecialUpload.php:314
SpecialUpload\$mDestWarningAck
$mDestWarningAck
Hidden variables.
Definition: SpecialUpload.php:75
php
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
Definition: injection.txt:35
SpecialUpload\getExistsWarning
static getExistsWarning( $exists)
Formats a result of UploadBase::getExistsWarning as HTML This check is static and can be done pre-upl...
Definition: SpecialUpload.php:777
SpecialUpload\showUploadWarning
showUploadWarning( $warnings)
Stashes the upload, shows the main form, but adds a "continue anyway button".
Definition: SpecialUpload.php:368
SpecialUpload\getDupeWarning
getDupeWarning( $dupes)
Construct a warning and a gallery from an array of duplicate files.
Definition: SpecialUpload.php:816
SpecialUpload\showRecoverableUploadError
showRecoverableUploadError( $message)
Stashes the upload and shows the main upload form.
Definition: SpecialUpload.php:343
DerivativeContext
An IContextSource implementation which will inherit context from another source but allow individual ...
Definition: DerivativeContext.php:31
SpecialPage\addHelpLink
addHelpLink( $to, $overrideBaseUrl=false)
Adds help link with an icon via page indicators.
Definition: SpecialPage.php:785
MWException
MediaWiki exception.
Definition: MWException.php:26
SpecialPage\getConfig
getConfig()
Shortcut to get main config object.
Definition: SpecialPage.php:714
$title
namespace and then decline to actually register it file or subcat img or subcat $title
Definition: hooks.txt:932
SpecialUpload\$mRequest
WebRequest FauxRequest $mRequest
Misc variables.
Definition: SpecialUpload.php:49
BitmapHandler
Generic handler for bitmap images.
Definition: Bitmap.php:29
SpecialUpload\$mDesiredDestName
string $mDesiredDestName
User input variables from the "description" section.
Definition: SpecialUpload.php:62
SpecialUpload\$uploadFormTextAfterSummary
$uploadFormTextAfterSummary
Definition: SpecialUpload.php:89
SpecialUpload\$mCancelUpload
bool $mCancelUpload
The user clicked "Cancel and return to upload form" button.
Definition: SpecialUpload.php:81
wfGetDB
wfGetDB( $db, $groups=[], $wiki=false)
Get a Database object.
Definition: GlobalFunctions.php:2856
in
null for the wiki Added in
Definition: hooks.txt:1581
SpecialUpload\execute
execute( $par)
Special page entry point.
Definition: SpecialUpload.php:159
SpecialUpload\$mCopyrightSource
$mCopyrightSource
Definition: SpecialUpload.php:71
SpecialPage\setHeaders
setHeaders()
Sets headers - this should be called from the execute() method of all derived classes!
Definition: SpecialPage.php:484
SpecialPage\getUser
getUser()
Shortcut to get the User executing this instance.
Definition: SpecialPage.php:685
SpecialUpload\$mUpload
UploadBase $mUpload
Definition: SpecialUpload.php:53
Title\makeTitle
static makeTitle( $ns, $title, $fragment='', $interwiki='')
Create a new Title from a namespace index and a DB key.
Definition: Title.php:529
LogEventsList\showLogExtract
static showLogExtract(&$out, $types=[], $page='', $user='', $param=[])
Show log extract.
Definition: LogEventsList.php:594
DB_REPLICA
const DB_REPLICA
Definition: defines.php:25
SpecialUpload\$mComment
$mComment
Definition: SpecialUpload.php:63
SpecialUpload\loadRequest
loadRequest()
Initialize instance variables from request and create an Upload handler.
Definition: SpecialUpload.php:94
wfDebug
wfDebug( $text, $dest='all', array $context=[])
Sends a line to the debug log if enabled or, optionally, to a comment in output.
Definition: GlobalFunctions.php:1047
LocalFile
Class to represent a local file in the wiki's own database.
Definition: LocalFile.php:45
SpecialUpload
Form for handling uploads and special page.
Definition: SpecialUpload.php:33
SpecialPage\getContext
getContext()
Gets the context this SpecialPage is executed in.
Definition: SpecialPage.php:648
$request
do that in ParserLimitReportFormat instead use this to modify the parameters of the image all existing parser cache entries will be invalid To avoid you ll need to handle that somehow(e.g. with the RejectParserCacheValue hook) because MediaWiki won 't do it for you. & $defaults also a ContextSource after deleting those rows but within the same transaction you ll probably need to make sure the header is varied on $request
Definition: hooks.txt:2581
SpecialUpload\$mForReUpload
bool $mForReUpload
The user followed an "overwrite this file" link.
Definition: SpecialUpload.php:78
Title\makeTitleSafe
static makeTitleSafe( $ns, $title, $fragment='', $interwiki='')
Create a new Title from a namespace index and a DB key.
Definition: Title.php:557
SpecialUpload\$mLicense
$mLicense
Definition: SpecialUpload.php:64
SpecialPage
Parent class for all special pages.
Definition: SpecialPage.php:36
SpecialUpload\getUploadForm
getUploadForm( $message='', $sessionKey='', $hideIgnoreWarning=false)
Get an UploadForm instance with title and text properly set.
Definition: SpecialUpload.php:252
SpecialUpload\rotationEnabled
static rotationEnabled()
Should we rotate images in the preview on Special:Upload.
Definition: SpecialUpload.php:845
SpecialUpload\showUploadError
showUploadError( $message)
Show the upload form with error message, but do not stash the file.
Definition: SpecialUpload.php:472
SpecialPage\getRequest
getRequest()
Get the WebRequest being used for this instance.
Definition: SpecialPage.php:665
SpecialUpload\showUploadForm
showUploadForm( $form)
Show the main upload form.
Definition: SpecialUpload.php:231
WebRequest
The WebRequest class encapsulates getting at data passed in the URL or via a POSTed form stripping il...
Definition: WebRequest.php:38
SpecialPage\getLinkRenderer
getLinkRenderer()
Definition: SpecialPage.php:860
ChangeTags\canAddTagsAccompanyingChange
static canAddTagsAccompanyingChange(array $tags, User $user=null)
Is it OK to allow the user to apply all the specified tags at the same time as they edit/make the cha...
Definition: ChangeTags.php:421
$args
if( $line===false) $args
Definition: cdb.php:63
Title
Represents a title within MediaWiki.
Definition: Title.php:39
$dbr
if(! $regexes) $dbr
Definition: cleanup.php:94
$code
this hook is for auditing only or null if authentication failed before getting that far or null if we can t even determine that probably a stub it is not rendered in wiki pages or galleries in category pages allow injecting custom HTML after the section Any uses of the hook need to handle escaping see BaseTemplate::getToolbox and BaseTemplate::makeListItem for details on the format of individual items inside of this array or by returning and letting standard HTTP rendering take place modifiable or by returning false and taking over the output modifiable & $code
Definition: hooks.txt:781
SpecialUpload\$mWatchthis
$mWatchthis
Definition: SpecialUpload.php:69
as
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
Definition: distributors.txt:9
Title\exists
exists( $flags=0)
Check if page exists.
Definition: Title.php:4446
$link
usually copyright or history_copyright This message must be in HTML not wikitext & $link
Definition: hooks.txt:2981
$source
$source
Definition: mwdoc-filter.php:46
SpecialUpload\__construct
__construct( $request=null)
Get data POSTed through the form and assign them to the object.
Definition: SpecialUpload.php:38
wfMessage
either a unescaped string or a HtmlArmor object after in associative array form externallinks including delete and has completed for all link tables whether this was an auto creation default is conds Array Extra conditions for the No matching items in log is displayed if loglist is empty msgKey Array If you want a nice box with a set this to the key of the message First element is the message additional optional elements are parameters for the key that are processed with wfMessage() -> params() ->parseAsBlock() - offset Set to overwrite offset parameter in $wgRequest set to '' to unset offset - wrap String Wrap the message in html(usually something like "&lt
ImageGalleryBase\factory
static factory( $mode=false, IContextSource $context=null)
Get a new image gallery.
Definition: ImageGalleryBase.php:92
error
do that in ParserLimitReportFormat instead use this to modify the parameters of the image all existing parser cache entries will be invalid To avoid you ll need to handle that somehow(e.g. with the RejectParserCacheValue hook) because MediaWiki won 't do it for you. & $defaults error
Definition: hooks.txt:2581
SpecialPage\checkReadOnly
checkReadOnly()
If the wiki is currently in readonly mode, throws a ReadOnlyError.
Definition: SpecialPage.php:319
SpecialUpload\processVerificationError
processVerificationError( $details)
Provides output to the user for a result of UploadBase::verifyUpload.
Definition: SpecialUpload.php:679
SpecialPage\$linkRenderer
MediaWiki Linker LinkRenderer null $linkRenderer
Definition: SpecialPage.php:66
MediaWikiServices
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency MediaWikiServices
Definition: injection.txt:23
ErrorPageError
An error page which can definitely be safely rendered using the OutputPage.
Definition: ErrorPageError.php:27
User
The User object encapsulates all of the user-specific settings (user_id, name, rights,...
Definition: User.php:51
wfLocalFile
wfLocalFile( $title)
Get an object referring to a locally registered file.
Definition: GlobalFunctions.php:2908
Hooks\run
static run( $event, array $args=[], $deprecatedVersion=null)
Call hook functions defined in Hooks::register and $wgHooks.
Definition: Hooks.php:203
SpecialUpload\$uploadFormTextTop
$uploadFormTextTop
Text injection points for hooks not using HTMLForm.
Definition: SpecialUpload.php:88
SpecialUpload\$mUploadSuccessful
bool $mUploadSuccessful
Subclasses can use this to determine whether a file was uploaded.
Definition: SpecialUpload.php:85
SpecialPage\outputHeader
outputHeader( $summaryMessageKey='')
Outputs a summary message on top of special pages Per default the message key is the canonical name o...
Definition: SpecialPage.php:583
SpecialUpload\$mTokenOk
$mTokenOk
Definition: SpecialUpload.php:82
SpecialUpload\$mIgnoreWarning
$mIgnoreWarning
User input variables from the root section.
Definition: SpecialUpload.php:68
SpecialUpload\getWatchCheck
getWatchCheck()
See if we should check the 'watch this page' checkbox on the form based on the user's preferences and...
Definition: SpecialUpload.php:649
array
the array() calling protocol came about after MediaWiki 1.4rc1.
HTMLForm
Object handling generic submission, CSRF protection, layout and other logic for UI forms.
Definition: HTMLForm.php:128