(bug 29569) Avoid fatal errors in OutputPage when nonexistent module names are passed in
[lhc/web/wiklou.git] / includes / CategoryPage.php
index 92646af..eab7a35 100644 (file)
@@ -17,11 +17,6 @@ class CategoryPage extends Article {
        # Subclasses can change this to override the viewer class.
        protected $mCategoryViewerClass = 'CategoryViewer';
 
-       /**
-        * @var Title
-        */
-       protected $mTitle;
-
        /**
         * @param $title Title
         * @return WikiCategoryPage
@@ -49,20 +44,22 @@ class CategoryPage extends Article {
                        $this->getContext()->getUser()->getOption( 'diffonly' ) );
 
                if ( isset( $diff ) && $diffOnly ) {
-                       return parent::view();
+                       parent::view();
+                       return;
                }
 
                if ( !wfRunHooks( 'CategoryPageView', array( &$this ) ) ) {
                        return;
                }
 
-               if ( NS_CATEGORY == $this->mTitle->getNamespace() ) {
+               $title = $this->getTitle();
+               if ( NS_CATEGORY == $title->getNamespace() ) {
                        $this->openShowCategory();
                }
 
                parent::view();
 
-               if ( NS_CATEGORY == $this->mTitle->getNamespace() ) {
+               if ( NS_CATEGORY == $title->getNamespace() ) {
                        $this->closeShowCategory();
                }
        }
@@ -96,7 +93,7 @@ class CategoryPage extends Article {
                unset( $reqArray["from"] );
                unset( $reqArray["to"] );
 
-               $viewer = new $this->mCategoryViewerClass( $this->mTitle, $this->getContext(), $from, $until, $reqArray );
+               $viewer = new $this->mCategoryViewerClass( $this->getContext()->getTitle(), $this->getContext(), $from, $until, $reqArray );
                $this->getContext()->getOutput()->addHTML( $viewer->getHTML() );
        }
 }