Use isArticleRelated() instead of checking if $wgArticle is set
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Tue, 4 Jan 2011 14:49:08 +0000 (14:49 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Tue, 4 Jan 2011 14:49:08 +0000 (14:49 +0000)
includes/OutputPage.php

index 83f6d45..581653d 100644 (file)
@@ -1614,7 +1614,6 @@ class OutputPage {
                global $wgLanguageCode, $wgDebugRedirects, $wgMimeType;
                global $wgUseAjax, $wgAjaxWatch;
                global $wgEnableMWSuggest, $wgUniversalEditButton;
-               global $wgArticle;
 
                if( $this->mDoNothing ) {
                        return;
@@ -1675,7 +1674,7 @@ class OutputPage {
                }
 
                if( $wgUniversalEditButton ) {
-                       if( isset( $wgArticle ) && $this->getTitle() && $this->getTitle()->quickUserCan( 'edit' )
+                       if( $this->isArticleRelated() && $this->getTitle() && $this->getTitle()->quickUserCan( 'edit' )
                                && ( $this->getTitle()->exists() || $this->getTitle()->quickUserCan( 'create' ) ) ) {
                                // Original UniversalEditButton
                                $msg = wfMsg( 'edit' );