Merge "Added FormatJson::parse( $value, $options = 0 ) returning Status"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Fri, 26 Sep 2014 19:05:58 +0000 (19:05 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Fri, 26 Sep 2014 19:05:58 +0000 (19:05 +0000)
includes/MediaWiki.php
includes/context/RequestContext.php

index 545a46f..87468bd 100644 (file)
@@ -121,7 +121,7 @@ class MediaWiki {
         * @return Title
         */
        public function getTitle() {
-               if ( $this->context->getTitle() === null ) {
+               if ( !$this->context->hasTitle() ) {
                        $this->context->setTitle( $this->parseTitle() );
                }
                return $this->context->getTitle();
index 952af8c..b1bebe7 100644 (file)
@@ -146,6 +146,16 @@ class RequestContext implements IContextSource {
                return $this->title;
        }
 
+       /**
+        * Check, if a Title object is set
+        *
+        * @since 1.25
+        * @return bool
+        */
+       public function hasTitle() {
+               return $this->title !== null;
+       }
+
        /**
         * Check whether a WikiPage object can be get with getWikiPage().
         * Callers should expect that an exception is thrown from getWikiPage()