r89794 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r89793‎ | r89794 | r89795 >
Date:20:00, 9 June 2011
Author:ialex
Status:ok
Tags:
Comment:
Recommit SpecialPage.php and SpecialPageFactory.php parts of r89406 (removal of magic __get() accessor for RequestContext)
Modified paths:
  • /trunk/phase3/includes/SpecialPage.php (modified) (history)
  • /trunk/phase3/includes/SpecialPageFactory.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/SpecialPageFactory.php
@@ -417,10 +417,10 @@
418418 $page = self::getPage( $name );
419419 // Nonexistent?
420420 if ( !$page ) {
421 - $context->output->setArticleRelated( false );
422 - $context->output->setRobotPolicy( 'noindex,nofollow' );
423 - $context->output->setStatusCode( 404 );
424 - $context->output->showErrorPage( 'nosuchspecialpage', 'nospecialpagetext' );
 421+ $context->getOutput()->setArticleRelated( false );
 422+ $context->getOutput()->setRobotPolicy( 'noindex,nofollow' );
 423+ $context->getOutput()->setStatusCode( 404 );
 424+ $context->getOutput()->showErrorPage( 'nosuchspecialpage', 'nospecialpagetext' );
425425 wfProfileOut( __METHOD__ );
426426 return false;
427427 }
@@ -434,17 +434,17 @@
435435 // the request. Such POST requests are possible for old extensions that
436436 // generate self-links without being aware that their default name has
437437 // changed.
438 - if ( $name != $page->getLocalName() && !$context->request->wasPosted() ) {
439 - $query = $context->request->getQueryValues();
 438+ if ( $name != $page->getLocalName() && !$context->getRequest()->wasPosted() ) {
 439+ $query = $context->getRequest()->getQueryValues();
440440 unset( $query['title'] );
441441 $query = wfArrayToCGI( $query );
442442 $title = $page->getTitle( $par );
443443 $url = $title->getFullUrl( $query );
444 - $context->output->redirect( $url );
 444+ $context->getOutput()->redirect( $url );
445445 wfProfileOut( __METHOD__ );
446446 return $title;
447447 } else {
448 - $context->title = $page->getTitle();
 448+ $context->setTitle( $page->getTitle() );
449449 }
450450
451451 } elseif ( !$page->isIncludable() ) {
Index: trunk/phase3/includes/SpecialPage.php
@@ -856,14 +856,14 @@
857857 // Redirect to a page title with possible query parameters
858858 if ( $redirect instanceof Title ) {
859859 $url = $redirect->getFullUrl( $query );
860 - $this->getContext()->output->redirect( $url );
 860+ $this->getOutput()->redirect( $url );
861861 wfProfileOut( __METHOD__ );
862862 return $redirect;
863863 // Redirect to index.php with query parameters
864864 } elseif ( $redirect === true ) {
865865 global $wgScript;
866866 $url = $wgScript . '?' . wfArrayToCGI( $query );
867 - $this->getContext()->output->redirect( $url );
 867+ $this->getOutput()->redirect( $url );
868868 wfProfileOut( __METHOD__ );
869869 return $redirect;
870870 } else {

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r89406Start unpicking r85288 (magic __get() accessor for RequestContext). Instead,...happy-melon10:54, 3 June 2011
r89430Provisional revert of r89406, r89414: reference-related warnings need cleanup...brion18:48, 3 June 2011

Status & tagging log