From 063c8fc308eda9bbf749622675334e44fd7a0a17 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Thu, 4 Sep 2008 03:23:42 +0000 Subject: [PATCH] Work around database corruption reported on WP:VPT -- unlinked title instead of PHP error. Break long lines. --- includes/LogPage.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/includes/LogPage.php b/includes/LogPage.php index 0bc9dd0ee0..4afe3bc116 100644 --- a/includes/LogPage.php +++ b/includes/LogPage.php @@ -155,7 +155,9 @@ class LogPage { * @static * @return HTML string */ - static function actionText( $type, $action, $title = NULL, $skin = NULL, $params = array(), $filterWikilinks=false ) { + static function actionText( $type, $action, $title = NULL, $skin = NULL, + $params = array(), $filterWikilinks=false ) + { global $wgLang, $wgContLang, $wgLogActions, $wgMessageCache; $wgMessageCache->loadAllMessages(); @@ -172,8 +174,15 @@ class LogPage { switch( $type ) { case 'move': - $titleLink = $skin->makeLinkObj( $title, htmlspecialchars( $title->getPrefixedText() ), 'redirect=no' ); - $params[0] = $skin->makeLinkObj( Title::newFromText( $params[0] ), htmlspecialchars( $params[0] ) ); + $titleLink = $skin->makeLinkObj( $title, + htmlspecialchars( $title->getPrefixedText() ), 'redirect=no' ); + $targetTitle = Title::newFromText( $params[0] ); + if ( !$targetTitle ) { + # Workaround for broken database + $params[0] = htmlspecialchars( $params[0] ); + } else { + $params[0] = $skin->makeLinkObj( $targetTitle, htmlspecialchars( $params[0] ) ); + } break; case 'block': if( substr( $title->getText(), 0, 1 ) == '#' ) { -- 2.20.1