Fix bug in r94995: getCanonicalUrl() doesn't append the fragment. This is correct...
authorRoan Kattouw <catrope@users.mediawiki.org>
Sun, 28 Aug 2011 15:15:42 +0000 (15:15 +0000)
committerRoan Kattouw <catrope@users.mediawiki.org>
Sun, 28 Aug 2011 15:15:42 +0000 (15:15 +0000)
includes/Title.php

index 725170c..192e9ba 100644 (file)
@@ -1037,13 +1037,15 @@ class Title {
         * 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 );
+               $url = $wgCanonicalServer . $this->getLocalURL( $query, $variant ) . $this->getFragmentForURL();
                wfRunHooks( 'GetCanonicalURL', array( &$this, &$url, $query ) );
                return $url;
        }