Index: trunk/extensions/Watchers/Watchers.php |
— | — | @@ -44,20 +44,26 @@ |
45 | 45 | * Display link in toolbox |
46 | 46 | */ |
47 | 47 | function wfWatchersExtensionAfterToolbox( &$tpl ) { # Checked for HTML and MySQL insertion attacks |
48 | | - global $wgTitle; |
49 | | - if( $wgTitle->isTalkPage() ) { |
| 48 | + if ( method_exists( $tpl, 'getSkin' ) ) { |
| 49 | + $title = $tpl->getSkin()->getTitle(); |
| 50 | + } else { |
| 51 | + global $wgTitle; |
| 52 | + $title = $wgTitle; |
| 53 | + } |
| 54 | + |
| 55 | + if( $title->isTalkPage() ) { |
50 | 56 | # No talk pages please |
51 | 57 | return true; |
52 | 58 | } |
53 | 59 | |
54 | | - if( $wgTitle->getNamespace() < 0 ) { |
| 60 | + if( $title->getNamespace() < 0 ) { |
55 | 61 | # No special pages please |
56 | 62 | return true; |
57 | 63 | } |
58 | 64 | |
59 | 65 | echo '<li id="t-watchers"><a href="' ; |
60 | 66 | $nt = SpecialPage::getTitleFor( 'Watchers' ); |
61 | | - echo $nt->escapeLocalURL( 'page=' . $wgTitle->getPrefixedDBkey() ); |
| 67 | + echo $nt->escapeLocalURL( 'page=' . $title->getPrefixedDBkey() ); |
62 | 68 | echo '">'; |
63 | 69 | echo wfMsgHtml( 'watchers_link_title' ); |
64 | 70 | echo "</a></li>\n"; |