Index: trunk/extensions/ShortUrl/SpecialShortUrl.php |
— | — | @@ -33,14 +33,14 @@ |
34 | 34 | * @param $par Mixed: Parameters passed to the page |
35 | 35 | */ |
36 | 36 | public function execute( $par ) { |
37 | | - global $wgOut; |
| 37 | + $out = $this->getOutput(); |
38 | 38 | |
39 | 39 | $title = ShortUrlUtils::decodeURL( $par ); |
40 | 40 | if ( $title !== false ) { |
41 | | - $wgOut->redirect( $title->getFullURL(), '301' ); |
| 41 | + $out->redirect( $title->getFullURL(), '301' ); |
42 | 42 | } else { |
43 | 43 | $parEsc = wfEscapeWikiText( $par ); |
44 | | - $wgOut->showErrorPage( 'shorturl-not-found-title', 'shorturl-not-found-message', array( $parEsc ) ); |
| 44 | + $out->showErrorPage( 'shorturl-not-found-title', 'shorturl-not-found-message', array( $parEsc ) ); |
45 | 45 | } |
46 | 46 | } |
47 | 47 | } |
Index: trunk/extensions/ShortUrl/ShortUrl.hooks.php |
— | — | @@ -19,7 +19,7 @@ |
20 | 20 | * @return bool |
21 | 21 | */ |
22 | 22 | public static function addToolboxLink( &$tpl ) { |
23 | | - global $wgOut, $wgShortUrlPrefix; |
| 23 | + global $wgShortUrlPrefix; |
24 | 24 | |
25 | 25 | if ( !is_string( $wgShortUrlPrefix ) ) { |
26 | 26 | $urlPrefix = SpecialPage::getTitleFor( 'ShortUrl' )->getCanonicalUrl() . '/'; |
— | — | @@ -27,7 +27,7 @@ |
28 | 28 | $urlPrefix = $wgShortUrlPrefix; |
29 | 29 | } |
30 | 30 | |
31 | | - $title = $wgOut->getTitle(); |
| 31 | + $title = $tpl->getSkin()->getTitle(); |
32 | 32 | if ( ShortUrlUtils::needsShortUrl( $title ) ) { |
33 | 33 | $shortId = ShortUrlUtils::encodeTitle( $title ); |
34 | 34 | $shortURL = $urlPrefix . $shortId; |
— | — | @@ -50,10 +50,9 @@ |
51 | 51 | * @return bool |
52 | 52 | */ |
53 | 53 | public static function onOutputPageBeforeHTML( &$out, &$text ) { |
54 | | - global $wgOut; |
55 | | - $title = $wgOut->getTitle(); |
| 54 | + $title = $out->getTitle(); |
56 | 55 | if ( ShortUrlUtils::needsShortUrl( $title ) ) { |
57 | | - $wgOut->addModules( 'ext.shortUrl' ); |
| 56 | + $out->addModules( 'ext.shortUrl' ); |
58 | 57 | } |
59 | 58 | return true; |
60 | 59 | } |