r40416 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r40415‎ | r40416 | r40417 >
Date:03:23, 4 September 2008
Author:tstarling
Status:old
Tags:
Comment:
Work around database corruption reported on WP:VPT -- unlinked title instead of PHP error. Break long lines.
Modified paths:
  • /trunk/phase3/includes/LogPage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/LogPage.php
@@ -155,7 +155,9 @@
156156 * @static
157157 * @return HTML string
158158 */
159 - static function actionText( $type, $action, $title = NULL, $skin = NULL, $params = array(), $filterWikilinks=false ) {
 159+ static function actionText( $type, $action, $title = NULL, $skin = NULL,
 160+ $params = array(), $filterWikilinks=false )
 161+ {
160162 global $wgLang, $wgContLang, $wgLogActions, $wgMessageCache;
161163
162164 $wgMessageCache->loadAllMessages();
@@ -172,8 +174,15 @@
173175
174176 switch( $type ) {
175177 case 'move':
176 - $titleLink = $skin->makeLinkObj( $title, htmlspecialchars( $title->getPrefixedText() ), 'redirect=no' );
177 - $params[0] = $skin->makeLinkObj( Title::newFromText( $params[0] ), htmlspecialchars( $params[0] ) );
 178+ $titleLink = $skin->makeLinkObj( $title,
 179+ htmlspecialchars( $title->getPrefixedText() ), 'redirect=no' );
 180+ $targetTitle = Title::newFromText( $params[0] );
 181+ if ( !$targetTitle ) {
 182+ # Workaround for broken database
 183+ $params[0] = htmlspecialchars( $params[0] );
 184+ } else {
 185+ $params[0] = $skin->makeLinkObj( $targetTitle, htmlspecialchars( $params[0] ) );
 186+ }
178187 break;
179188 case 'block':
180189 if( substr( $title->getText(), 0, 1 ) == '#' ) {

Follow-up revisions

RevisionCommit summaryAuthorDate
r40900Revert revert r40717 of my formatting change r40416.tstarling05:21, 16 September 2008