MediaWiki  1.33.0
SpecialMovepage.php
Go to the documentation of this file.
1 <?php
31  protected $oldTitle = null;
32 
34  protected $newTitle;
35 
37  protected $reason;
38 
39  // Checks
40 
42  protected $moveTalk;
43 
45  protected $deleteAndMove;
46 
48  protected $moveSubpages;
49 
51  protected $fixRedirects;
52 
54  protected $leaveRedirect;
55 
57  protected $moveOverShared;
58 
59  private $watch = false;
60 
61  public function __construct() {
62  parent::__construct( 'Movepage' );
63  }
64 
65  public function doesWrites() {
66  return true;
67  }
68 
69  public function execute( $par ) {
71 
72  $this->checkReadOnly();
73 
74  $this->setHeaders();
75  $this->outputHeader();
76 
77  $request = $this->getRequest();
78  $target = $par ?? $request->getVal( 'target' );
79 
80  // Yes, the use of getVal() and getText() is wanted, see T22365
81 
82  $oldTitleText = $request->getVal( 'wpOldTitle', $target );
83  $this->oldTitle = Title::newFromText( $oldTitleText );
84 
85  if ( !$this->oldTitle ) {
86  // Either oldTitle wasn't passed, or newFromText returned null
87  throw new ErrorPageError( 'notargettitle', 'notargettext' );
88  }
89  if ( !$this->oldTitle->exists() ) {
90  throw new ErrorPageError( 'nopagetitle', 'nopagetext' );
91  }
92 
93  $newTitleTextMain = $request->getText( 'wpNewTitleMain' );
94  $newTitleTextNs = $request->getInt( 'wpNewTitleNs', $this->oldTitle->getNamespace() );
95  // Backwards compatibility for forms submitting here from other sources
96  // which is more common than it should be..
97  $newTitleText_bc = $request->getText( 'wpNewTitle' );
98  $this->newTitle = strlen( $newTitleText_bc ) > 0
99  ? Title::newFromText( $newTitleText_bc )
100  : Title::makeTitleSafe( $newTitleTextNs, $newTitleTextMain );
101 
102  $user = $this->getUser();
103 
104  # Check rights
105  $permErrors = $this->oldTitle->getUserPermissionsErrors( 'move', $user );
106  if ( count( $permErrors ) ) {
107  // Auto-block user's IP if the account was "hard" blocked
108  DeferredUpdates::addCallableUpdate( function () use ( $user ) {
109  $user->spreadAnyEditBlock();
110  } );
111  throw new PermissionsError( 'move', $permErrors );
112  }
113 
114  $def = !$request->wasPosted();
115 
116  $this->reason = $request->getText( 'wpReason' );
117  $this->moveTalk = $request->getBool( 'wpMovetalk', $def );
118  $this->fixRedirects = $request->getBool( 'wpFixRedirects', $def );
119  $this->leaveRedirect = $request->getBool( 'wpLeaveRedirect', $def );
120  $this->moveSubpages = $request->getBool( 'wpMovesubpages' );
121  $this->deleteAndMove = $request->getBool( 'wpDeleteAndMove' );
122  $this->moveOverShared = $request->getBool( 'wpMoveOverSharedFile' );
123  $this->watch = $request->getCheck( 'wpWatch' ) && $user->isLoggedIn();
124 
125  if ( $request->getVal( 'action' ) == 'submit' && $request->wasPosted()
126  && $user->matchEditToken( $request->getVal( 'wpEditToken' ) )
127  ) {
128  $this->doSubmit();
129  } else {
130  $this->showForm( [] );
131  }
132  }
133 
142  function showForm( $err, $isPermError = false ) {
143  $this->getSkin()->setRelevantTitle( $this->oldTitle );
144 
145  $out = $this->getOutput();
146  $out->setPageTitle( $this->msg( 'move-page', $this->oldTitle->getPrefixedText() ) );
147  $out->addModuleStyles( 'mediawiki.special' );
148  $out->addModules( 'mediawiki.special.movePage' );
149  $this->addHelpLink( 'Help:Moving a page' );
150 
151  $out->addWikiMsg( $this->getConfig()->get( 'FixDoubleRedirects' ) ?
152  'movepagetext' :
153  'movepagetext-noredirectfixer'
154  );
155 
156  if ( $this->oldTitle->getNamespace() == NS_USER && !$this->oldTitle->isSubpage() ) {
157  $out->wrapWikiMsg(
158  "<div class=\"warningbox mw-moveuserpage-warning\">\n$1\n</div>",
159  'moveuserpage-warning'
160  );
161  } elseif ( $this->oldTitle->getNamespace() == NS_CATEGORY ) {
162  $out->wrapWikiMsg(
163  "<div class=\"warningbox mw-movecategorypage-warning\">\n$1\n</div>",
164  'movecategorypage-warning'
165  );
166  }
167 
168  $deleteAndMove = false;
169  $moveOverShared = false;
170 
172 
173  if ( !$newTitle ) {
174  # Show the current title as a default
175  # when the form is first opened.
177  } elseif ( !count( $err ) ) {
178  # If a title was supplied, probably from the move log revert
179  # link, check for validity. We can then show some diagnostic
180  # information and save a click.
181  $newerr = $this->oldTitle->isValidMoveOperation( $newTitle );
182  if ( is_array( $newerr ) ) {
183  $err = $newerr;
184  }
185  }
186 
187  $user = $this->getUser();
188 
189  if ( count( $err ) == 1 && isset( $err[0][0] ) && $err[0][0] == 'articleexists'
190  && $newTitle->quickUserCan( 'delete', $user )
191  ) {
192  $out->wrapWikiMsg(
193  "<div class='warningbox'>\n$1\n</div>\n",
194  [ 'delete_and_move_text', $newTitle->getPrefixedText() ]
195  );
196  $deleteAndMove = true;
197  $err = [];
198  }
199 
200  if ( count( $err ) == 1 && isset( $err[0][0] ) && $err[0][0] == 'file-exists-sharedrepo'
201  && $user->isAllowed( 'reupload-shared' )
202  ) {
203  $out->wrapWikiMsg(
204  "<div class='warningbox'>\n$1\n</div>\n",
205  [
206  'move-over-sharedrepo',
208  ]
209  );
210  $moveOverShared = true;
211  $err = [];
212  }
213 
214  $oldTalk = $this->oldTitle->getTalkPage();
215  $oldTitleSubpages = $this->oldTitle->hasSubpages();
216  $oldTitleTalkSubpages = $this->oldTitle->getTalkPage()->hasSubpages();
217 
218  $canMoveSubpage = ( $oldTitleSubpages || $oldTitleTalkSubpages ) &&
219  !count( $this->oldTitle->getUserPermissionsErrors( 'move-subpages', $user ) );
220 
221  # We also want to be able to move assoc. subpage talk-pages even if base page
222  # has no associated talk page, so || with $oldTitleTalkSubpages.
223  $considerTalk = !$this->oldTitle->isTalkPage() &&
224  ( $oldTalk->exists()
225  || ( $oldTitleTalkSubpages && $canMoveSubpage ) );
226 
227  $dbr = wfGetDB( DB_REPLICA );
228  if ( $this->getConfig()->get( 'FixDoubleRedirects' ) ) {
229  $hasRedirects = $dbr->selectField( 'redirect', '1',
230  [
231  'rd_namespace' => $this->oldTitle->getNamespace(),
232  'rd_title' => $this->oldTitle->getDBkey(),
233  ], __METHOD__ );
234  } else {
235  $hasRedirects = false;
236  }
237 
238  if ( count( $err ) ) {
239  if ( $isPermError ) {
240  $action_desc = $this->msg( 'action-move' )->plain();
241  $errMsgHtml = $this->msg( 'permissionserrorstext-withaction',
242  count( $err ), $action_desc )->parseAsBlock();
243  } else {
244  $errMsgHtml = $this->msg( 'cannotmove', count( $err ) )->parseAsBlock();
245  }
246 
247  if ( count( $err ) == 1 ) {
248  $errMsg = $err[0];
249  $errMsgName = array_shift( $errMsg );
250 
251  if ( $errMsgName == 'hookaborted' ) {
252  $errMsgHtml .= "<p>{$errMsg[0]}</p>\n";
253  } else {
254  $errMsgHtml .= $this->msg( $errMsgName, $errMsg )->parseAsBlock();
255  }
256  } else {
257  $errStr = [];
258 
259  foreach ( $err as $errMsg ) {
260  if ( $errMsg[0] == 'hookaborted' ) {
261  $errStr[] = $errMsg[1];
262  } else {
263  $errMsgName = array_shift( $errMsg );
264  $errStr[] = $this->msg( $errMsgName, $errMsg )->parse();
265  }
266  }
267 
268  $errMsgHtml .= '<ul><li>' . implode( "</li>\n<li>", $errStr ) . "</li></ul>\n";
269  }
270  $out->addHTML( Html::errorBox( $errMsgHtml ) );
271  }
272 
273  if ( $this->oldTitle->isProtected( 'move' ) ) {
274  # Is the title semi-protected?
275  if ( $this->oldTitle->isSemiProtected( 'move' ) ) {
276  $noticeMsg = 'semiprotectedpagemovewarning';
277  $classes[] = 'mw-textarea-sprotected';
278  } else {
279  # Then it must be protected based on static groups (regular)
280  $noticeMsg = 'protectedpagemovewarning';
281  $classes[] = 'mw-textarea-protected';
282  }
283  $out->addHTML( "<div class='mw-warning-with-logexcerpt'>\n" );
284  $out->addWikiMsg( $noticeMsg );
286  $out,
287  'protect',
288  $this->oldTitle,
289  '',
290  [ 'lim' => 1 ]
291  );
292  $out->addHTML( "</div>\n" );
293  }
294 
295  // Length limit for wpReason and wpNewTitleMain is enforced in the
296  // mediawiki.special.movePage module
297 
298  $immovableNamespaces = [];
299  foreach ( array_keys( $this->getLanguage()->getNamespaces() ) as $nsId ) {
300  if ( !MWNamespace::isMovable( $nsId ) ) {
301  $immovableNamespaces[] = $nsId;
302  }
303  }
304 
305  $handler = ContentHandler::getForTitle( $this->oldTitle );
306 
307  $out->enableOOUI();
308  $fields = [];
309 
310  $fields[] = new OOUI\FieldLayout(
311  new MediaWiki\Widget\ComplexTitleInputWidget( [
312  'id' => 'wpNewTitle',
313  'namespace' => [
314  'id' => 'wpNewTitleNs',
315  'name' => 'wpNewTitleNs',
316  'value' => $newTitle->getNamespace(),
317  'exclude' => $immovableNamespaces,
318  ],
319  'title' => [
320  'id' => 'wpNewTitleMain',
321  'name' => 'wpNewTitleMain',
322  'value' => $newTitle->getText(),
323  // Inappropriate, since we're expecting the user to input a non-existent page's title
324  'suggestions' => false,
325  ],
326  'infusable' => true,
327  ] ),
328  [
329  'label' => $this->msg( 'newtitle' )->text(),
330  'align' => 'top',
331  ]
332  );
333 
334  // HTML maxlength uses "UTF-16 code units", which means that characters outside BMP
335  // (e.g. emojis) count for two each. This limit is overridden in JS to instead count
336  // Unicode codepoints.
337  $fields[] = new OOUI\FieldLayout(
338  new OOUI\TextInputWidget( [
339  'name' => 'wpReason',
340  'id' => 'wpReason',
342  'infusable' => true,
343  'value' => $this->reason,
344  ] ),
345  [
346  'label' => $this->msg( 'movereason' )->text(),
347  'align' => 'top',
348  ]
349  );
350 
351  if ( $considerTalk ) {
352  $fields[] = new OOUI\FieldLayout(
353  new OOUI\CheckboxInputWidget( [
354  'name' => 'wpMovetalk',
355  'id' => 'wpMovetalk',
356  'value' => '1',
357  'selected' => $this->moveTalk,
358  ] ),
359  [
360  'label' => $this->msg( 'movetalk' )->text(),
361  'help' => new OOUI\HtmlSnippet( $this->msg( 'movepagetalktext' )->parseAsBlock() ),
362  'helpInline' => true,
363  'align' => 'inline',
364  'id' => 'wpMovetalk-field',
365  ]
366  );
367  }
368 
369  if ( $user->isAllowed( 'suppressredirect' ) ) {
370  if ( $handler->supportsRedirects() ) {
371  $isChecked = $this->leaveRedirect;
372  $isDisabled = false;
373  } else {
374  $isChecked = false;
375  $isDisabled = true;
376  }
377  $fields[] = new OOUI\FieldLayout(
378  new OOUI\CheckboxInputWidget( [
379  'name' => 'wpLeaveRedirect',
380  'id' => 'wpLeaveRedirect',
381  'value' => '1',
382  'selected' => $isChecked,
383  'disabled' => $isDisabled,
384  ] ),
385  [
386  'label' => $this->msg( 'move-leave-redirect' )->text(),
387  'align' => 'inline',
388  ]
389  );
390  }
391 
392  if ( $hasRedirects ) {
393  $fields[] = new OOUI\FieldLayout(
394  new OOUI\CheckboxInputWidget( [
395  'name' => 'wpFixRedirects',
396  'id' => 'wpFixRedirects',
397  'value' => '1',
398  'selected' => $this->fixRedirects,
399  ] ),
400  [
401  'label' => $this->msg( 'fix-double-redirects' )->text(),
402  'align' => 'inline',
403  ]
404  );
405  }
406 
407  if ( $canMoveSubpage ) {
408  $maximumMovedPages = $this->getConfig()->get( 'MaximumMovedPages' );
409  $fields[] = new OOUI\FieldLayout(
410  new OOUI\CheckboxInputWidget( [
411  'name' => 'wpMovesubpages',
412  'id' => 'wpMovesubpages',
413  'value' => '1',
414  # Don't check the box if we only have talk subpages to
415  # move and we aren't moving the talk page.
416  'selected' => $this->moveSubpages && ( $this->oldTitle->hasSubpages() || $this->moveTalk ),
417  ] ),
418  [
419  'label' => new OOUI\HtmlSnippet(
420  $this->msg(
421  ( $this->oldTitle->hasSubpages()
422  ? 'move-subpages'
423  : 'move-talk-subpages' )
424  )->numParams( $maximumMovedPages )->params( $maximumMovedPages )->parse()
425  ),
426  'align' => 'inline',
427  ]
428  );
429  }
430 
431  # Don't allow watching if user is not logged in
432  if ( $user->isLoggedIn() ) {
433  $watchChecked = $user->isLoggedIn() && ( $this->watch || $user->getBoolOption( 'watchmoves' )
434  || $user->isWatched( $this->oldTitle ) );
435  $fields[] = new OOUI\FieldLayout(
436  new OOUI\CheckboxInputWidget( [
437  'name' => 'wpWatch',
438  'id' => 'watch', # ew
439  'value' => '1',
440  'selected' => $watchChecked,
441  ] ),
442  [
443  'label' => $this->msg( 'move-watch' )->text(),
444  'align' => 'inline',
445  ]
446  );
447  }
448 
449  $hiddenFields = '';
450  if ( $moveOverShared ) {
451  $hiddenFields .= Html::hidden( 'wpMoveOverSharedFile', '1' );
452  }
453 
454  if ( $deleteAndMove ) {
455  $fields[] = new OOUI\FieldLayout(
456  new OOUI\CheckboxInputWidget( [
457  'name' => 'wpDeleteAndMove',
458  'id' => 'wpDeleteAndMove',
459  'value' => '1',
460  ] ),
461  [
462  'label' => $this->msg( 'delete_and_move_confirm' )->text(),
463  'align' => 'inline',
464  ]
465  );
466  }
467 
468  $fields[] = new OOUI\FieldLayout(
469  new OOUI\ButtonInputWidget( [
470  'name' => 'wpMove',
471  'value' => $this->msg( 'movepagebtn' )->text(),
472  'label' => $this->msg( 'movepagebtn' )->text(),
473  'flags' => [ 'primary', 'progressive' ],
474  'type' => 'submit',
475  ] ),
476  [
477  'align' => 'top',
478  ]
479  );
480 
481  $fieldset = new OOUI\FieldsetLayout( [
482  'label' => $this->msg( 'move-page-legend' )->text(),
483  'id' => 'mw-movepage-table',
484  'items' => $fields,
485  ] );
486 
487  $form = new OOUI\FormLayout( [
488  'method' => 'post',
489  'action' => $this->getPageTitle()->getLocalURL( 'action=submit' ),
490  'id' => 'movepage',
491  ] );
492  $form->appendContent(
493  $fieldset,
494  new OOUI\HtmlSnippet(
495  $hiddenFields .
496  Html::hidden( 'wpOldTitle', $this->oldTitle->getPrefixedText() ) .
497  Html::hidden( 'wpEditToken', $user->getEditToken() )
498  )
499  );
500 
501  $out->addHTML(
502  new OOUI\PanelLayout( [
503  'classes' => [ 'movepage-wrapper' ],
504  'expanded' => false,
505  'padded' => true,
506  'framed' => true,
507  'content' => $form,
508  ] )
509  );
510 
511  $this->showLogFragment( $this->oldTitle );
512  $this->showSubpages( $this->oldTitle );
513  }
514 
515  function doSubmit() {
516  $user = $this->getUser();
517 
518  if ( $user->pingLimiter( 'move' ) ) {
519  throw new ThrottledError;
520  }
521 
522  $ot = $this->oldTitle;
523  $nt = $this->newTitle;
524 
525  # don't allow moving to pages with # in
526  if ( !$nt || $nt->hasFragment() ) {
527  $this->showForm( [ [ 'badtitletext' ] ] );
528 
529  return;
530  }
531 
532  # Show a warning if the target file exists on a shared repo
533  if ( $nt->getNamespace() == NS_FILE
534  && !( $this->moveOverShared && $user->isAllowed( 'reupload-shared' ) )
535  && !RepoGroup::singleton()->getLocalRepo()->findFile( $nt )
536  && wfFindFile( $nt )
537  ) {
538  $this->showForm( [ [ 'file-exists-sharedrepo' ] ] );
539 
540  return;
541  }
542 
543  # Delete to make way if requested
544  if ( $this->deleteAndMove ) {
545  $permErrors = $nt->getUserPermissionsErrors( 'delete', $user );
546  if ( count( $permErrors ) ) {
547  # Only show the first error
548  $this->showForm( $permErrors, true );
549 
550  return;
551  }
552 
553  $page = WikiPage::factory( $nt );
554 
555  // Small safety margin to guard against concurrent edits
556  if ( $page->isBatchedDelete( 5 ) ) {
557  $this->showForm( [ [ 'movepage-delete-first' ] ] );
558 
559  return;
560  }
561 
562  $reason = $this->msg( 'delete_and_move_reason', $ot )->inContentLanguage()->text();
563 
564  // Delete an associated image if there is
565  if ( $nt->getNamespace() == NS_FILE ) {
566  $file = wfLocalFile( $nt );
567  $file->load( File::READ_LATEST );
568  if ( $file->exists() ) {
569  $file->delete( $reason, false, $user );
570  }
571  }
572 
573  $error = ''; // passed by ref
574  $deleteStatus = $page->doDeleteArticleReal( $reason, false, 0, true, $error, $user );
575  if ( !$deleteStatus->isGood() ) {
576  $this->showForm( $deleteStatus->getErrorsArray() );
577 
578  return;
579  }
580  }
581 
583 
584  if ( !$handler->supportsRedirects() ) {
585  $createRedirect = false;
586  } elseif ( $user->isAllowed( 'suppressredirect' ) ) {
587  $createRedirect = $this->leaveRedirect;
588  } else {
589  $createRedirect = true;
590  }
591 
592  # Do the actual move.
593  $mp = new MovePage( $ot, $nt );
594  $valid = $mp->isValidMove();
595  if ( !$valid->isOK() ) {
596  $this->showForm( $valid->getErrorsArray() );
597  return;
598  }
599 
600  $permStatus = $mp->checkPermissions( $user, $this->reason );
601  if ( !$permStatus->isOK() ) {
602  $this->showForm( $permStatus->getErrorsArray(), true );
603  return;
604  }
605 
606  $status = $mp->move( $user, $this->reason, $createRedirect );
607  if ( !$status->isOK() ) {
608  $this->showForm( $status->getErrorsArray() );
609  return;
610  }
611 
612  if ( $this->getConfig()->get( 'FixDoubleRedirects' ) && $this->fixRedirects ) {
613  DoubleRedirectJob::fixRedirects( 'move', $ot, $nt );
614  }
615 
616  $out = $this->getOutput();
617  $out->setPageTitle( $this->msg( 'pagemovedsub' ) );
618 
619  $linkRenderer = $this->getLinkRenderer();
620  $oldLink = $linkRenderer->makeLink(
621  $ot,
622  null,
623  [ 'id' => 'movepage-oldlink' ],
624  [ 'redirect' => 'no' ]
625  );
626  $newLink = $linkRenderer->makeKnownLink(
627  $nt,
628  null,
629  [ 'id' => 'movepage-newlink' ]
630  );
631  $oldText = $ot->getPrefixedText();
632  $newText = $nt->getPrefixedText();
633 
634  if ( $ot->exists() ) {
635  // NOTE: we assume that if the old title exists, it's because it was re-created as
636  // a redirect to the new title. This is not safe, but what we did before was
637  // even worse: we just determined whether a redirect should have been created,
638  // and reported that it was created if it should have, without any checks.
639  // Also note that isRedirect() is unreliable because of T39209.
640  $msgName = 'movepage-moved-redirect';
641  } else {
642  $msgName = 'movepage-moved-noredirect';
643  }
644 
645  $out->addHTML( $this->msg( 'movepage-moved' )->rawParams( $oldLink,
646  $newLink )->params( $oldText, $newText )->parseAsBlock() );
647  $out->addWikiMsg( $msgName );
648 
649  // Avoid PHP 7.1 warning from passing $this by reference
650  $movePage = $this;
651  Hooks::run( 'SpecialMovepageAfterMove', [ &$movePage, &$ot, &$nt ] );
652 
653  # Now we move extra pages we've been asked to move: subpages and talk
654  # pages. First, if the old page or the new page is a talk page, we
655  # can't move any talk pages: cancel that.
656  if ( $ot->isTalkPage() || $nt->isTalkPage() ) {
657  $this->moveTalk = false;
658  }
659 
660  if ( count( $ot->getUserPermissionsErrors( 'move-subpages', $user ) ) ) {
661  $this->moveSubpages = false;
662  }
663 
675  // @todo FIXME: Use Title::moveSubpages() here
676  $dbr = wfGetDB( DB_MASTER );
677  if ( $this->moveSubpages && (
678  MWNamespace::hasSubpages( $nt->getNamespace() ) || (
679  $this->moveTalk
680  && MWNamespace::hasSubpages( $nt->getTalkPage()->getNamespace() )
681  )
682  ) ) {
683  $conds = [
684  'page_title' . $dbr->buildLike( $ot->getDBkey() . '/', $dbr->anyString() )
685  . ' OR page_title = ' . $dbr->addQuotes( $ot->getDBkey() )
686  ];
687  $conds['page_namespace'] = [];
688  if ( MWNamespace::hasSubpages( $nt->getNamespace() ) ) {
689  $conds['page_namespace'][] = $ot->getNamespace();
690  }
691  if ( $this->moveTalk &&
692  MWNamespace::hasSubpages( $nt->getTalkPage()->getNamespace() )
693  ) {
694  $conds['page_namespace'][] = $ot->getTalkPage()->getNamespace();
695  }
696  } elseif ( $this->moveTalk ) {
697  $conds = [
698  'page_namespace' => $ot->getTalkPage()->getNamespace(),
699  'page_title' => $ot->getDBkey()
700  ];
701  } else {
702  # Skip the query
703  $conds = null;
704  }
705 
706  $extraPages = [];
707  if ( !is_null( $conds ) ) {
708  $extraPages = TitleArray::newFromResult(
709  $dbr->select( 'page',
710  [ 'page_id', 'page_namespace', 'page_title' ],
711  $conds,
712  __METHOD__
713  )
714  );
715  }
716 
717  $extraOutput = [];
718  $count = 1;
719  foreach ( $extraPages as $oldSubpage ) {
720  if ( $ot->equals( $oldSubpage ) || $nt->equals( $oldSubpage ) ) {
721  # Already did this one.
722  continue;
723  }
724 
725  $newPageName = preg_replace(
726  '#^' . preg_quote( $ot->getDBkey(), '#' ) . '#',
727  StringUtils::escapeRegexReplacement( $nt->getDBkey() ), # T23234
728  $oldSubpage->getDBkey()
729  );
730 
731  if ( $oldSubpage->isSubpage() && ( $ot->isTalkPage() xor $nt->isTalkPage() ) ) {
732  // Moving a subpage from a subject namespace to a talk namespace or vice-versa
733  $newNs = $nt->getNamespace();
734  } elseif ( $oldSubpage->isTalkPage() ) {
735  $newNs = $nt->getTalkPage()->getNamespace();
736  } else {
737  $newNs = $nt->getSubjectPage()->getNamespace();
738  }
739 
740  # T16385: we need makeTitleSafe because the new page names may
741  # be longer than 255 characters.
742  $newSubpage = Title::makeTitleSafe( $newNs, $newPageName );
743  if ( !$newSubpage ) {
744  $oldLink = $linkRenderer->makeKnownLink( $oldSubpage );
745  $extraOutput[] = $this->msg( 'movepage-page-unmoved' )->rawParams( $oldLink )
746  ->params( Title::makeName( $newNs, $newPageName ) )->escaped();
747  continue;
748  }
749 
750  # This was copy-pasted from Renameuser, bleh.
751  if ( $newSubpage->exists() && !$oldSubpage->isValidMoveTarget( $newSubpage ) ) {
752  $link = $linkRenderer->makeKnownLink( $newSubpage );
753  $extraOutput[] = $this->msg( 'movepage-page-exists' )->rawParams( $link )->escaped();
754  } else {
755  $success = $oldSubpage->moveTo( $newSubpage, true, $this->reason, $createRedirect );
756 
757  if ( $success === true ) {
758  if ( $this->fixRedirects ) {
759  DoubleRedirectJob::fixRedirects( 'move', $oldSubpage, $newSubpage );
760  }
761  $oldLink = $linkRenderer->makeLink(
762  $oldSubpage,
763  null,
764  [],
765  [ 'redirect' => 'no' ]
766  );
767 
768  $newLink = $linkRenderer->makeKnownLink( $newSubpage );
769  $extraOutput[] = $this->msg( 'movepage-page-moved' )
770  ->rawParams( $oldLink, $newLink )->escaped();
771  ++$count;
772 
773  $maximumMovedPages = $this->getConfig()->get( 'MaximumMovedPages' );
774  if ( $count >= $maximumMovedPages ) {
775  $extraOutput[] = $this->msg( 'movepage-max-pages' )
776  ->numParams( $maximumMovedPages )->escaped();
777  break;
778  }
779  } else {
780  $oldLink = $linkRenderer->makeKnownLink( $oldSubpage );
781  $newLink = $linkRenderer->makeLink( $newSubpage );
782  $extraOutput[] = $this->msg( 'movepage-page-unmoved' )
783  ->rawParams( $oldLink, $newLink )->escaped();
784  }
785  }
786  }
787 
788  if ( $extraOutput !== [] ) {
789  $out->addHTML( "<ul>\n<li>" . implode( "</li>\n<li>", $extraOutput ) . "</li>\n</ul>" );
790  }
791 
792  # Deal with watches (we don't watch subpages)
793  WatchAction::doWatchOrUnwatch( $this->watch, $ot, $user );
794  WatchAction::doWatchOrUnwatch( $this->watch, $nt, $user );
795  }
796 
797  function showLogFragment( $title ) {
798  $moveLogPage = new LogPage( 'move' );
799  $out = $this->getOutput();
800  $out->addHTML( Xml::element( 'h2', null, $moveLogPage->getName()->text() ) );
802  }
803 
810  function showSubpages( $title ) {
811  $nsHasSubpages = MWNamespace::hasSubpages( $title->getNamespace() );
812  $subpages = $title->getSubpages();
813  $count = $subpages instanceof TitleArray ? $subpages->count() : 0;
814 
815  $titleIsTalk = $title->isTalkPage();
816  $subpagesTalk = $title->getTalkPage()->getSubpages();
817  $countTalk = $subpagesTalk instanceof TitleArray ? $subpagesTalk->count() : 0;
818  $totalCount = $count + $countTalk;
819 
820  if ( !$nsHasSubpages && $countTalk == 0 ) {
821  return;
822  }
823 
824  $this->getOutput()->wrapWikiMsg(
825  '== $1 ==',
826  [ 'movesubpage', ( $titleIsTalk ? $count : $totalCount ) ]
827  );
828 
829  if ( $nsHasSubpages ) {
830  $this->showSubpagesList( $subpages, $count, 'movesubpagetext', true );
831  }
832 
833  if ( !$titleIsTalk && $countTalk > 0 ) {
834  $this->showSubpagesList( $subpagesTalk, $countTalk, 'movesubpagetalktext' );
835  }
836  }
837 
838  function showSubpagesList( $subpages, $pagecount, $wikiMsg, $noSubpageMsg = false ) {
839  $out = $this->getOutput();
840 
841  # No subpages.
842  if ( $pagecount == 0 && $noSubpageMsg ) {
843  $out->addWikiMsg( 'movenosubpage' );
844  return;
845  }
846 
847  $out->addWikiMsg( $wikiMsg, $this->getLanguage()->formatNum( $pagecount ) );
848  $out->addHTML( "<ul>\n" );
849 
850  $linkBatch = new LinkBatch( $subpages );
851  $linkBatch->setCaller( __METHOD__ );
852  $linkBatch->execute();
853  $linkRenderer = $this->getLinkRenderer();
854 
855  foreach ( $subpages as $subpage ) {
856  $link = $linkRenderer->makeLink( $subpage );
857  $out->addHTML( "<li>$link</li>\n" );
858  }
859  $out->addHTML( "</ul>\n" );
860  }
861 
870  public function prefixSearchSubpages( $search, $limit, $offset ) {
871  return $this->prefixSearchString( $search, $limit, $offset );
872  }
873 
874  protected function getGroupName() {
875  return 'pagetools';
876  }
877 }
$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. 'ContentSecurityPolicyDefaultSource':Modify the allowed CSP load sources. This affects all directives except for the script directive. If you want to add a script source, see ContentSecurityPolicyScriptSource hook. & $defaultSrc:Array of Content-Security-Policy allowed sources $policyConfig:Current configuration for the Content-Security-Policy header $mode:ContentSecurityPolicy::REPORT_ONLY_MODE or ContentSecurityPolicy::FULL_MODE depending on type of header 'ContentSecurityPolicyDirectives':Modify the content security policy directives. Use this only if ContentSecurityPolicyDefaultSource and ContentSecurityPolicyScriptSource do not meet your needs. & $directives:Array of CSP directives $policyConfig:Current configuration for the CSP header $mode:ContentSecurityPolicy::REPORT_ONLY_MODE or ContentSecurityPolicy::FULL_MODE depending on type of header 'ContentSecurityPolicyScriptSource':Modify the allowed CSP script sources. Note that you also have to use ContentSecurityPolicyDefaultSource if you want non-script sources to be loaded from whatever you add. & $scriptSrc:Array of CSP directives $policyConfig:Current configuration for the CSP header $mode:ContentSecurityPolicy::REPORT_ONLY_MODE or ContentSecurityPolicy::FULL_MODE depending on type of header '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). 'DeleteUnknownPreferences':Called by the cleanupPreferences.php maintenance script to build a WHERE clause with which to delete preferences that are not known about. This hook is used by extensions that have dynamically-named preferences that should not be deleted in the usual cleanup process. For example, the Gadgets extension creates preferences prefixed with 'gadget-', and so anything with that prefix is excluded from the deletion. &where:An array that will be passed as the $cond parameter to IDatabase::select() to determine what will be deleted from the user_properties table. $db:The IDatabase object, useful for accessing $db->buildLike() etc. '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:1266
SpecialPage\getPageTitle
getPageTitle( $subpage=false)
Get a self-referential title object.
Definition: SpecialPage.php:678
$user
return true to allow those checks to and false if checking is done & $user
Definition: hooks.txt:1476
MovePageForm\$newTitle
Title $newTitle
Definition: SpecialMovepage.php:34
Title\newFromText
static newFromText( $text, $defaultNamespace=NS_MAIN)
Create a new Title from text, such as what one would find in a link.
Definition: Title.php:306
RepoGroup\singleton
static singleton()
Get a RepoGroup instance.
Definition: RepoGroup.php:61
$file
if(PHP_SAPI !='cli-server') if(!isset( $_SERVER['SCRIPT_FILENAME'])) $file
Definition: router.php:42
SpecialPage\msg
msg( $key)
Wrapper around wfMessage that sets the current context.
Definition: SpecialPage.php:796
Title\makeName
static makeName( $ns, $title, $fragment='', $interwiki='', $canonicalNamespace=false)
Make a prefixed DB key from a DB key and a namespace index.
Definition: Title.php:788
MovePageForm\showSubpages
showSubpages( $title)
Show subpages of the page being moved.
Definition: SpecialMovepage.php:810
LinkBatch
Class representing a list of titles The execute() method checks them all for existence and adds them ...
Definition: LinkBatch.php:34
SpecialPage\getOutput
getOutput()
Get the OutputPage being used for this instance.
Definition: SpecialPage.php:725
TitleArray\newFromResult
static newFromResult( $res)
Definition: TitleArray.php:40
UnlistedSpecialPage
Shortcut to construct a special page which is unlisted by default.
Definition: UnlistedSpecialPage.php:29
captcha-old.count
count
Definition: captcha-old.py:249
MovePageForm\$oldTitle
Title $oldTitle
Definition: SpecialMovepage.php:31
MovePageForm\$moveOverShared
bool $moveOverShared
Definition: SpecialMovepage.php:57
$out
this hook is for auditing only or null if authentication failed before getting that far or null if we can t even determine that When $user is not it can be in the form of< username >< more info > e g for bot passwords intended to be added to log contexts Fields it might only if the login was with a bot password 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 $out
Definition: hooks.txt:780
MovePageForm\getGroupName
getGroupName()
Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-gro...
Definition: SpecialMovepage.php:874
Title\getPrefixedText
getPrefixedText()
Get the prefixed title with spaces.
Definition: Title.php:1660
MovePageForm\prefixSearchSubpages
prefixSearchSubpages( $search, $limit, $offset)
Return an array of subpages beginning with $search that this special page will accept.
Definition: SpecialMovepage.php:870
StringUtils\escapeRegexReplacement
static escapeRegexReplacement( $string)
Escape a string to make it suitable for inclusion in a preg_replace() replacement parameter.
Definition: StringUtils.php:323
Title\quickUserCan
quickUserCan( $action, $user=null)
Can $user perform $action on this page? This skips potentially expensive cascading permission checks ...
Definition: Title.php:2139
NS_FILE
const NS_FILE
Definition: Defines.php:70
page
target page
Definition: All_system_messages.txt:1267
ContentHandler\getForTitle
static getForTitle(Title $title)
Returns the appropriate ContentHandler singleton for the given title.
Definition: ContentHandler.php:199
SpecialPage\getSkin
getSkin()
Shortcut to get the skin being used for this instance.
Definition: SpecialPage.php:745
SpecialPage\useTransactionalTimeLimit
useTransactionalTimeLimit()
Call wfTransactionalTimeLimit() if this request was POSTed.
Definition: SpecialPage.php:898
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:755
$success
$success
Definition: NoLocalSettings.php:42
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
MovePageForm\$moveSubpages
bool $moveSubpages
Definition: SpecialMovepage.php:48
$dbr
$dbr
Definition: testCompression.php:50
MovePageForm\showForm
showForm( $err, $isPermError=false)
Show the form.
Definition: SpecialMovepage.php:142
MovePageForm\$leaveRedirect
bool $leaveRedirect
Definition: SpecialMovepage.php:54
SpecialPage\addHelpLink
addHelpLink( $to, $overrideBaseUrl=false)
Adds help link with an icon via page indicators.
Definition: SpecialPage.php:832
SpecialPage\prefixSearchString
prefixSearchString( $search, $limit, $offset)
Perform a regular substring search for prefixSearchSubpages.
Definition: SpecialPage.php:495
MovePageForm\doSubmit
doSubmit()
Definition: SpecialMovepage.php:515
SpecialPage\getConfig
getConfig()
Shortcut to get main config object.
Definition: SpecialPage.php:764
$title
namespace and then decline to actually register it file or subcat img or subcat $title
Definition: hooks.txt:925
WikiPage\factory
static factory(Title $title)
Create a WikiPage object of the appropriate class for the given title.
Definition: WikiPage.php:138
Title\getNamespace
getNamespace()
Get the namespace index, i.e.
Definition: Title.php:994
MovePageForm\$fixRedirects
bool $fixRedirects
Definition: SpecialMovepage.php:51
MovePage
Handles the backend logic of moving a page from one title to another.
Definition: MovePage.php:32
$handler
this hook is for auditing only or null if authentication failed before getting that far or null if we can t even determine that When $user is not it can be in the form of< username >< more info > e g for bot passwords intended to be added to log contexts Fields it might only if the login was with a bot password 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 modifiable after all normalizations have been except for the $wgMaxImageArea check set to true or false to override the $wgMaxImageArea check result gives extension the possibility to transform it themselves $handler
Definition: hooks.txt:780
wfGetDB
wfGetDB( $db, $groups=[], $wiki=false)
Get a Database object.
Definition: GlobalFunctions.php:2636
LogPage
Class to simplify the use of log pages.
Definition: LogPage.php:33
MediaWiki
A helper class for throttling authentication attempts.
MovePageForm\$deleteAndMove
bool $deleteAndMove
Definition: SpecialMovepage.php:45
Xml\element
static element( $element, $attribs=null, $contents='', $allowShortTag=true)
Format an XML element with given attributes and, optionally, text content.
Definition: Xml.php:41
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
MWNamespace\hasSubpages
static hasSubpages( $index)
Does the namespace allow subpages?
Definition: MWNamespace.php:366
ThrottledError
Show an error when the user hits a rate limit.
Definition: ThrottledError.php:27
WatchAction\doWatchOrUnwatch
static doWatchOrUnwatch( $watch, Title $title, User $user)
Watch or unwatch a page.
Definition: WatchAction.php:89
SpecialPage\setHeaders
setHeaders()
Sets headers - this should be called from the execute() method of all derived classes!
Definition: SpecialPage.php:531
SpecialPage\getUser
getUser()
Shortcut to get the User executing this instance.
Definition: SpecialPage.php:735
MovePageForm
A special page that allows users to change page titles.
Definition: SpecialMovepage.php:29
MWNamespace\isMovable
static isMovable( $index)
Can pages in the given namespace be moved?
Definition: MWNamespace.php:89
LogEventsList\showLogExtract
static showLogExtract(&$out, $types=[], $page='', $user='', $param=[])
Show log extract.
Definition: LogEventsList.php:627
MovePageForm\__construct
__construct()
Definition: SpecialMovepage.php:61
DB_REPLICA
const DB_REPLICA
Definition: defines.php:25
NS_CATEGORY
const NS_CATEGORY
Definition: Defines.php:78
DB_MASTER
const DB_MASTER
Definition: defines.php:26
MovePageForm\$reason
string $reason
Text input.
Definition: SpecialMovepage.php:37
DoubleRedirectJob\fixRedirects
static fixRedirects( $reason, $redirTitle, $destTitle=false)
Insert jobs into the job queue to fix redirects to the given title.
Definition: DoubleRedirectJob.php:63
$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:2636
Title\makeTitleSafe
static makeTitleSafe( $ns, $title, $fragment='', $interwiki='')
Create a new Title from a namespace index and a DB key.
Definition: Title.php:604
SpecialPage\getRequest
getRequest()
Get the WebRequest being used for this instance.
Definition: SpecialPage.php:715
Title\isValidMoveOperation
isValidMoveOperation(&$nt, $auth=true, $reason='')
Check whether a given move operation would be valid.
Definition: Title.php:3379
MovePageForm\doesWrites
doesWrites()
Indicates whether this special page may perform database writes.
Definition: SpecialMovepage.php:65
MovePageForm\showSubpagesList
showSubpagesList( $subpages, $pagecount, $wikiMsg, $noSubpageMsg=false)
Definition: SpecialMovepage.php:838
wfFindFile
wfFindFile( $title, $options=[])
Find a file.
Definition: GlobalFunctions.php:2677
CommentStore\COMMENT_CHARACTER_LIMIT
const COMMENT_CHARACTER_LIMIT
Maximum length of a comment in UTF-8 characters.
Definition: CommentStore.php:37
SpecialPage\getLinkRenderer
getLinkRenderer()
Definition: SpecialPage.php:908
text
This list may contain false positives That usually means there is additional text with links below the first Each row contains links to the first and second as well as the first line of the second redirect text
Definition: All_system_messages.txt:1267
Title
Represents a title within MediaWiki.
Definition: Title.php:40
reason
c Accompany it with the information you received as to the offer to distribute corresponding source complete source code means all the source code for all modules it plus any associated interface definition plus the scripts used to control compilation and installation of the executable as a special the source code distributed need not include anything that is normally and so on of the operating system on which the executable unless that component itself accompanies the executable If distribution of executable or object code is made by offering access to copy from a designated then offering equivalent access to copy the source code from the same place counts as distribution of the source even though third parties are not compelled to copy the source along with the object code You may not or distribute the Program except as expressly provided under this License Any attempt otherwise to sublicense or distribute the Program is and will automatically terminate your rights under this License parties who have received or from you under this License will not have their licenses terminated so long as such parties remain in full compliance You are not required to accept this since you have not signed it nothing else grants you permission to modify or distribute the Program or its derivative works These actions are prohibited by law if you do not accept this License by modifying or distributing the you indicate your acceptance of this License to do and all its terms and conditions for distributing or modifying the Program or works based on it Each time you redistribute the the recipient automatically receives a license from the original licensor to distribute or modify the Program subject to these terms and conditions You may not impose any further restrictions on the recipients exercise of the rights granted herein You are not responsible for enforcing compliance by third parties to this License as a consequence of a court judgment or allegation of patent infringement or for any other reason(not limited to patent issues)
TitleArray
The TitleArray class only exists to provide the newFromResult method at pre- sent.
Definition: TitleArray.php:33
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
NS_USER
const NS_USER
Definition: Defines.php:66
$link
usually copyright or history_copyright This message must be in HTML not wikitext & $link
Definition: hooks.txt:3053
true
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return true
Definition: hooks.txt:1985
MovePageForm\$watch
$watch
Definition: SpecialMovepage.php:59
SpecialPage\checkReadOnly
checkReadOnly()
If the wiki is currently in readonly mode, throws a ReadOnlyError.
Definition: SpecialPage.php:322
SpecialPage\$linkRenderer
MediaWiki Linker LinkRenderer null $linkRenderer
Definition: SpecialPage.php:66
ErrorPageError
An error page which can definitely be safely rendered using the OutputPage.
Definition: ErrorPageError.php:27
MovePageForm\showLogFragment
showLogFragment( $title)
Definition: SpecialMovepage.php:797
wfLocalFile
wfLocalFile( $title)
Get an object referring to a locally registered file.
Definition: GlobalFunctions.php:2688
DeferredUpdates\addCallableUpdate
static addCallableUpdate( $callable, $stage=self::POSTSEND, $dbw=null)
Add a callable update.
Definition: DeferredUpdates.php:118
Hooks\run
static run( $event, array $args=[], $deprecatedVersion=null)
Call hook functions defined in Hooks::register and $wgHooks.
Definition: Hooks.php:200
MovePageForm\$moveTalk
bool $moveTalk
Definition: SpecialMovepage.php:42
Title\getText
getText()
Get the text form (spaces not underscores) of the main part.
Definition: Title.php:952
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:633
MovePageForm\execute
execute( $par)
Default execute method Checks user permissions.
Definition: SpecialMovepage.php:69