* 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
*/
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>' );
}