From 9fe97ee84dbcfd0ec02160bb1ce836bb33e80015 Mon Sep 17 00:00:00 2001 From: Rob Church Date: Tue, 5 Jun 2007 03:28:40 +0000 Subject: [PATCH] Don't generate a diff link in the patrol log if the page doesn't exist, it'll be useless --- RELEASE-NOTES | 1 + includes/PatrolLog.php | 15 ++++++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 26a32fadd7..6eb63f4f00 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -123,6 +123,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN warns of possible bad values * (bug 9978) Fixed session.save_path validation when using extended configuration format, e.g. "5;/tmp" +* Don't generate a diff link in the patrol log if the page doesn't exist == MediaWiki API changes since 1.10 == diff --git a/includes/PatrolLog.php b/includes/PatrolLog.php index 157dcbddde..cb6de3e423 100644 --- a/includes/PatrolLog.php +++ b/includes/PatrolLog.php @@ -49,11 +49,16 @@ class PatrolLog { list( $cur, /* $prev */, $auto ) = $params; # Standard link to the page in question $link = $skin->makeLinkObj( $title ); - # Generate a diff link - $bits[] = 'oldid=' . urlencode( $cur ); - $bits[] = 'diff=prev'; - $bits = implode( '&', $bits ); - $diff = $skin->makeLinkObj( $title, htmlspecialchars( wfMsg( 'patrol-log-diff', $cur ) ), $bits ); + if( $title->exists() ) { + # Generate a diff link + $bits[] = 'oldid=' . urlencode( $cur ); + $bits[] = 'diff=prev'; + $bits = implode( '&', $bits ); + $diff = $skin->makeKnownLinkObj( $title, htmlspecialchars( wfMsg( 'patrol-log-diff', $cur ) ), $bits ); + } else { + # Don't bother with a diff link, it's useless + $diff = htmlspecialchars( wfMsg( 'patrol-log-diff', $cur ) ); + } # Indicate whether or not the patrolling was automatic $auto = $auto ? wfMsgHtml( 'patrol-log-auto' ) : ''; # Put it all together -- 2.20.1