Trim trailing whitespace
[lhc/web/wiklou.git] / includes / Title.php
index fb0e6d3..274bd25 100644 (file)
@@ -47,6 +47,7 @@ class Title {
         */
        const GAID_FOR_UPDATE = 1;
 
+
        /**
         * @name Private member variables
         * Please use the accessor functions instead.
@@ -758,7 +759,7 @@ class Title {
 
        /**
         * Return the prefixed title with spaces _without_ the interwiki prefix
-        *
+        * 
         * @return \type{\string} the title, prefixed by the namespace but not by the interwiki prefix, with spaces
         */
        public function getSemiPrefixedText() {
@@ -767,7 +768,7 @@ class Title {
                        $s = str_replace( '_', ' ', $s );
                        $this->mSemiPrefixedText = $s;
                }
-               return $this->mSemiPrefixedText;
+               return $this->mSemiPrefixedText; 
        }
 
        /**
@@ -998,7 +999,7 @@ class Title {
        public function escapeFullURL( $query = '' ) {
                return htmlspecialchars( $this->getFullURL( $query ) );
        }
-
+       
        /**
         * HTML-escaped version of getCanonicalURL()
         */
@@ -1010,7 +1011,7 @@ class Title {
         * Get the URL form for an internal link.
         * - Used in various Squid-related code, in case we have a different
         * internal hostname for the server from the exposed one.
-        *
+        * 
         * This uses $wgInternalServer to qualify the path, or $wgServer
         * if $wgInternalServer is not set. If the server variable used is
         * protocol-relative, the URL will be expanded to http://
@@ -1035,17 +1036,17 @@ class Title {
         * Get the URL for a canonical link, for use in things like IRC and
         * e-mail notifications. Uses $wgCanonicalServer and the
         * GetCanonicalURL hook.
-        *
+        * 
         * NOTE: Unlike getInternalURL(), the canonical URL includes the fragment
-        *
+        * 
         * @param $query string An optional query string
         * @param $variant string Language variant of URL (for sr, zh, ...)
         * @return string The URL
         */
        public function getCanonicalURL( $query = '', $variant = false ) {
                global $wgCanonicalServer;
-               $url = $wgCanonicalServer . $this->getLocalURL( $query, $variant ) . $this->getFragmentForURL();
-               wfRunHooks( 'GetCanonicalURL', array( &$this, &$url, $query ) );
+               $url = wfExpandUrl( $this->getLocalURL( $query, $variant ) . $this->getFragmentForURL(), PROTO_CANONICAL );
+               wfRunHooks( '', array( &$this, &$url, $query ) );
                return $url;
        }
 
@@ -2551,7 +2552,7 @@ class Title {
         */
        public function resetArticleID( $newid ) {
                $linkCache = LinkCache::singleton();
-               $linkCache->clearBadLink( $this->getPrefixedDBkey() );
+               $linkCache->clearLink( $this );
 
                if ( $newid === false ) {
                        $this->mArticleID = -1;
@@ -3379,14 +3380,14 @@ class Title {
                                array( 'rc_timestamp' => $rcts, 'rc_namespace' => $newns, 'rc_title' => $newdbk, 'rc_new' => 1 ),
                                __METHOD__
                        );
-
+                       
                         if ( $wgEnableInterwikiTemplatesTracking && $wgGlobalDatabase ) {
                                $dbw2 = wfGetDB( DB_MASTER, array(), $wgGlobalDatabase );
                                $dbw2->delete( 'globaltemplatelinks',
                                                        array(  'gtl_from_wiki' => wfGetID(),
                                                                        'gtl_from_page' => $newid ),
                                                        __METHOD__ );
-               }
+                       }
                }
 
                # Save a null revision in the page's history notifying of the move