r37925 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r37924‎ | r37925 | r37926 >
Date:21:40, 22 July 2008
Author:yaron
Status:old
Tags:
Comment:
Added check for existence of $title in initStorage()
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/includes/SMW_Factbox.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/includes/SMW_Factbox.php
@@ -39,8 +39,9 @@
4040 * Initialisation method. Must be called before anything else happens.
4141 */
4242 static function initStorage($title) {
43 - // reset only if title is new and not the notorious NO TITLE thing the MW parser creates
44 - if ( $title->getText() == 'NO TITLE' ) return;
 43+ // reset only if title exists, is new and is not the notorious
 44+ // NO TITLE thing the MW parser creates
 45+ if ( $title === NULL || $title->getText() == 'NO TITLE' ) return;
4546 if ( (SMWFactbox::$semdata === NULL) ||
4647 (SMWFactbox::$semdata->getSubject()->getDBkey() != $title->getDBkey()) ||
4748 (SMWFactbox::$semdata->getSubject()->getNamespace() != $title->getNamespace()) ) {

Status & tagging log