r98487 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r98486‎ | r98487 | r98488 >
Date:23:11, 29 September 2011
Author:sean_colombo
Status:ok
Tags:
Comment:
Revision::newFromTitle() returns null sometimes. Protect against the errors.
Modified paths:
  • /trunk/phase3/includes/Title.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Title.php
@@ -3575,6 +3575,9 @@
35763576 }
35773577 # Get the article text
35783578 $rev = Revision::newFromTitle( $nt );
 3579+ if( !is_object( $rev ) ){
 3580+ return false;
 3581+ }
35793582 $text = $rev->getText();
35803583 # Does the redirect point to the source?
35813584 # Or is it a broken self-redirect, usually caused by namespace collisions?

Status & tagging log