Fix r95655 per Formfix's CR:
authorRaimond Spekking <raymond@users.mediawiki.org>
Wed, 7 Sep 2011 12:56:06 +0000 (12:56 +0000)
committerRaimond Spekking <raymond@users.mediawiki.org>
Wed, 7 Sep 2011 12:56:06 +0000 (12:56 +0000)
* use getCanonicalURL() - this part should be deployed to 1.17wmf1
* Do not show &oldid= in case of nonexisting pages, incl. file description pages from InstantCommons files

includes/Skin.php

index 10eba64..6b1365c 100644 (file)
@@ -624,7 +624,12 @@ abstract class Skin extends ContextSource {
         */
        function printSource() {
                $oldid = $this->getRevisionId();
-               $url = htmlspecialchars( $this->getTitle()->getFullURL( 'oldid=' . $oldid ) );
+               if ( $oldid ) {
+                       $url = htmlspecialchars( $this->getTitle()->getCanonicalURL( 'oldid=' . $oldid ) );
+               } else {
+                       // oldid not available for non existing pages
+                       $url = htmlspecialchars( $this->getTitle()->getCanonicalURL() );
+               }
                return wfMsg( 'retrievedfrom', '<a href="' . $url . '">' . $url . '</a>' );
        }