Avoid globals in EditPage::__construct()
authorKunal Mehta <legoktm@member.fsf.org>
Mon, 17 Jul 2017 21:07:45 +0000 (14:07 -0700)
committerKunal Mehta <legoktm@member.fsf.org>
Mon, 17 Jul 2017 21:07:45 +0000 (14:07 -0700)
Change-Id: Icb1d1042f4bb5e4397c49f20ce26ab9c73e9d0d1

includes/EditPage.php

index 814c248..973327b 100644 (file)
@@ -422,8 +422,6 @@ class EditPage {
         * @param Article $article
         */
        public function __construct( Article $article ) {
-               global $wgOOUIEditPage;
-
                $this->mArticle = $article;
                $this->page = $article->getPage(); // model object
                $this->mTitle = $article->getTitle();
@@ -434,7 +432,7 @@ class EditPage {
                $handler = ContentHandler::getForModelID( $this->contentModel );
                $this->contentFormat = $handler->getDefaultFormat();
 
-               $this->oouiEnabled = $wgOOUIEditPage;
+               $this->oouiEnabled = $this->context->getConfig()->get( 'OOUIEditPage' );
        }
 
        /**