From: Tim Starling Date: Thu, 4 Sep 2008 03:23:42 +0000 (+0000) Subject: Work around database corruption reported on WP:VPT -- unlinked title instead of PHP... X-Git-Tag: 1.31.0-rc.0~45496 X-Git-Url: http://git.cyclocoop.org/%22.%24image2.%22?a=commitdiff_plain;h=063c8fc308eda9bbf749622675334e44fd7a0a17;p=lhc%2Fweb%2Fwiklou.git Work around database corruption reported on WP:VPT -- unlinked title instead of PHP error. Break long lines. --- 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 ) == '#' ) {