Merge "Http::getProxy() method to get proxy configuration"
[lhc/web/wiklou.git] / includes / Title.php
index c0ec97f..8bafe26 100644 (file)
@@ -145,7 +145,7 @@ class Title implements LinkTarget {
        /** @var bool The (string) language code of the page's language and content code. */
        private $mPageLanguage = false;
 
-       /** @var string|boolean|null The page language code from the database, null if not saved in
+       /** @var string|bool|null The page language code from the database, null if not saved in
         * the database or false if not loaded, yet. */
        private $mDbPageLanguage = false;
 
@@ -174,7 +174,7 @@ class Title implements LinkTarget {
                // make sure we are using the right one. To detect changes over the course
                // of a request, we remember a fingerprint of the config used to create the
                // codec singleton, and re-create it if the fingerprint doesn't match.
-               $fingerprint = spl_object_hash( $wgContLang ) . '|' . join( '+', $wgLocalInterwikis );
+               $fingerprint = spl_object_hash( $wgContLang ) . '|' . implode( '+', $wgLocalInterwikis );
 
                if ( $fingerprint !== $titleCodecFingerprint ) {
                        $titleCodec = null;
@@ -2452,8 +2452,8 @@ class Title implements LinkTarget {
 
        /**
         * Can $user perform $action on this page? This is an internal function,
-        * which checks ONLY that previously checked by userCan (i.e. it leaves out
-        * checks on wfReadOnly() and blocks)
+        * with multiple levels of checks depending on performance needs; see $rigor below.
+        * It does not check wfReadOnly().
         *
         * @param string $action Action that permission needs to be checked for
         * @param User $user User to check
@@ -3570,9 +3570,9 @@ class Title implements LinkTarget {
 
                // If we are looking at a css/js user subpage, purge the action=raw.
                if ( $this->isJsSubpage() ) {
-                       $urls[] = $this->getInternalUrl( 'action=raw&ctype=text/javascript' );
+                       $urls[] = $this->getInternalURL( 'action=raw&ctype=text/javascript' );
                } elseif ( $this->isCssSubpage() ) {
-                       $urls[] = $this->getInternalUrl( 'action=raw&ctype=text/css' );
+                       $urls[] = $this->getInternalURL( 'action=raw&ctype=text/css' );
                }
 
                Hooks::run( 'TitleSquidURLs', [ $this, &$urls ] );
@@ -4466,8 +4466,12 @@ class Title implements LinkTarget {
                        $this->mNotificationTimestamp = [];
                }
 
-               $watchedItem = WatchedItem::fromUserTitle( $user, $this );
-               $this->mNotificationTimestamp[$uid] = $watchedItem->getNotificationTimestamp();
+               $watchedItem = WatchedItemStore::getDefaultInstance()->getWatchedItem( $user, $this );
+               if ( $watchedItem ) {
+                       $this->mNotificationTimestamp[$uid] = $watchedItem->getNotificationTimestamp();
+               } else {
+                       $this->mNotificationTimestamp[$uid] = false;
+               }
 
                return $this->mNotificationTimestamp[$uid];
        }
@@ -4623,7 +4627,7 @@ class Title implements LinkTarget {
         * to true in LocalSettings.php, otherwise returns false. If there is no language saved in
         * the db, it will return NULL.
         *
-        * @return string|null|boolean
+        * @return string|null|bool
         */
        private function getDbPageLanguageCode() {
                global $wgPageLanguageUseDB;