r97045 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r97044‎ | r97045 | r97046 >
Date:10:39, 14 September 2011
Author:nikerabbit
Status:ok (Comments)
Tags:
Comment:
Added a bit defensive programming, as suggested by Aaron in r97040
Modified paths:
  • /trunk/phase3/includes/logging/LogFormatter.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/logging/LogFormatter.php
@@ -211,6 +211,9 @@
212212 if ( !$this->plaintext ) {
213213 $link = Linker::link( $title, null, array(), $parameters );
214214 } else {
 215+ if ( !$title instanceof Title ) {
 216+ throw new MWException( "Expected title, got null" );
 217+ }
215218 $link = '[[' . $title->getPrefixedText() . ']]';
216219 }
217220 return $link;

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r97040Instead of throwing fatals, accept null titles in old log entries....nikerabbit07:49, 14 September 2011

Comments

#Comment by Aaron Schulz (talk | contribs)   17:07, 14 September 2011

This makes the code easier to look at down the road.

Status & tagging log