Index: trunk/phase3/includes/SpecialPage.php |
— | — | @@ -523,8 +523,7 @@ |
524 | 524 | * @param $context RequestContext |
525 | 525 | * @param $including Bool output is being captured for use in {{special:whatever}} |
526 | 526 | */ |
527 | | - static function executePath( &$title, RequestContext $context, $including = false ) { |
528 | | - global $wgOut, $wgTitle, $wgRequest; |
| 527 | + public static function executePath( &$title, RequestContext &$context, $including = false ) { |
529 | 528 | wfProfileIn( __METHOD__ ); |
530 | 529 | |
531 | 530 | # FIXME: redirects broken due to this call |
— | — | @@ -538,10 +537,10 @@ |
539 | 538 | $page = SpecialPage::getPageByAlias( $name ); |
540 | 539 | # Nonexistent? |
541 | 540 | if ( !$page ) { |
542 | | - $wgOut->setArticleRelated( false ); |
543 | | - $wgOut->setRobotPolicy( 'noindex,nofollow' ); |
544 | | - $wgOut->setStatusCode( 404 ); |
545 | | - $wgOut->showErrorPage( 'nosuchspecialpage', 'nospecialpagetext' ); |
| 541 | + $context->output->setArticleRelated( false ); |
| 542 | + $context->output->setRobotPolicy( 'noindex,nofollow' ); |
| 543 | + $context->output->setStatusCode( 404 ); |
| 544 | + $context->output->showErrorPage( 'nosuchspecialpage', 'nospecialpagetext' ); |
546 | 545 | wfProfileOut( __METHOD__ ); |
547 | 546 | return false; |
548 | 547 | } |
— | — | @@ -555,13 +554,13 @@ |
556 | 555 | $query = $page->getRedirectQuery(); |
557 | 556 | if ( $redirect instanceof Title ) { |
558 | 557 | $url = $redirect->getFullUrl( $query ); |
559 | | - $wgOut->redirect( $url ); |
| 558 | + $context->output->redirect( $url ); |
560 | 559 | wfProfileOut( __METHOD__ ); |
561 | 560 | return $redirect; |
562 | 561 | } elseif( $redirect === true ) { |
563 | 562 | global $wgScript; |
564 | 563 | $url = $wgScript . '?' . wfArrayToCGI( $query ); |
565 | | - $wgOut->redirect( $url ); |
| 564 | + $context->output->redirect( $url ); |
566 | 565 | wfProfileOut( __METHOD__ ); |
567 | 566 | return $redirect; |
568 | 567 | } |
— | — | @@ -572,13 +571,13 @@ |
573 | 572 | # the request. Such POST requests are possible for old extensions that |
574 | 573 | # generate self-links without being aware that their default name has |
575 | 574 | # changed. |
576 | | - if ( !$including && $name != $page->getLocalName() && !$wgRequest->wasPosted() ) { |
| 575 | + if ( !$including && $name != $page->getLocalName() && !$context->request->wasPosted() ) { |
577 | 576 | $query = $_GET; |
578 | 577 | unset( $query['title'] ); |
579 | 578 | $query = wfArrayToCGI( $query ); |
580 | 579 | $title = $page->getTitle( $par ); |
581 | 580 | $url = $title->getFullUrl( $query ); |
582 | | - $wgOut->redirect( $url ); |
| 581 | + $context->output->redirect( $url ); |
583 | 582 | wfProfileOut( __METHOD__ ); |
584 | 583 | return $redirect; |
585 | 584 | } |
— | — | @@ -587,7 +586,7 @@ |
588 | 587 | wfProfileOut( __METHOD__ ); |
589 | 588 | return false; |
590 | 589 | } elseif ( !$including ) { |
591 | | - $wgTitle = $page->getTitle(); |
| 590 | + $context->title = $page->getTitle(); |
592 | 591 | } |
593 | 592 | $page->including( $including ); |
594 | 593 | |
— | — | @@ -608,7 +607,7 @@ |
609 | 608 | * @return String: HTML fragment |
610 | 609 | */ |
611 | 610 | static function capturePath( &$title ) { |
612 | | - global $wgOut, $wgTitle, $wgUser; |
| 611 | + global $wgOut, $wgTitle; |
613 | 612 | |
614 | 613 | // preload the skin - Sometimes the SpecialPage loads it at a bad point in time making a includable special page override the skin title |
615 | 614 | // This hack is ok for now. The plan is for |
— | — | @@ -962,12 +961,11 @@ |
963 | 962 | * @return String |
964 | 963 | */ |
965 | 964 | function getRedirectQuery() { |
966 | | - global $wgRequest; |
967 | 965 | $params = array(); |
968 | 966 | |
969 | 967 | foreach( $this->mAllowedRedirectParams as $arg ) { |
970 | | - if( $wgRequest->getVal( $arg, null ) !== null ){ |
971 | | - $params[$arg] = $wgRequest->getVal( $arg ); |
| 968 | + if( $this->getContext()->request->getVal( $arg, null ) !== null ){ |
| 969 | + $params[$arg] = $this->getContext()->request->getVal( $arg ); |
972 | 970 | } |
973 | 971 | } |
974 | 972 | |