r97040 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r97039‎ | r97040 | r97041 >
Date:07:49, 14 September 2011
Author:nikerabbit
Status:resolved (Comments)
Tags:
Comment:
Instead of throwing fatals, accept null titles in old log entries.
New log entries will still die with fatal few lines below, but that's good since that should never happen.
Modified paths:
  • /trunk/phase3/includes/logging/LogFormatter.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/logging/LogFormatter.php
@@ -203,7 +203,7 @@
204204 * @param $parameters array query parameters
205205 * @return String
206206 */
207 - protected function makePageLink( Title $title, $parameters = array() ) {
 207+ protected function makePageLink( Title $title = null, $parameters = array() ) {
208208 if ( !$this->plaintext ) {
209209 $link = Linker::link( $title, null, array(), $parameters );
210210 } else {

Follow-up revisions

RevisionCommit summaryAuthorDate
r97045Added a bit defensive programming, as suggested by Aaron in r97040nikerabbit10:39, 14 September 2011

Comments

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

Can it throw an exception in that case for sanity?

#Comment by Nikerabbit (talk | contribs)   08:03, 14 September 2011

I guess it could, if we want to do some defensive programming for cases that should not ever happen.

Status & tagging log