http://www.mediawiki.org/wiki/Special:Code/MediaWiki/60998
Revision: 60998 Author: mah Date: 2010-01-13 02:41:58 +0000 (Wed, 13 Jan 2010) Log Message: ----------- follow-up r60832: make sure $t always ends up a Title. Modified Paths: -------------- trunk/phase3/includes/parser/Parser.php Modified: trunk/phase3/includes/parser/Parser.php =================================================================== --- trunk/phase3/includes/parser/Parser.php 2010-01-13 01:45:00 UTC (rev 60997) +++ trunk/phase3/includes/parser/Parser.php 2010-01-13 02:41:58 UTC (rev 60998) @@ -258,15 +258,18 @@ * Set the context title */ function setTitle( $t ) { - if ( !$t || $t instanceof FakeTitle ) { - $t = Title::newFromText( 'NO TITLE' ); - } - // If we still don't have a Title object, make sure we can - // convert whatever we've been passed to a string. - if ( !$t instanceOf Title && is_string( "$t" ) ) { + if ( $t && !($t instanceOf FakeTitle) + && !($t instanceOf Title) + && is_string( "$t" ) ) { + // If don't have a Title object, make sure we can convert + // whatever we've been passed to a string. $t = Title::newFromText( "$t" ); } + if ( !($t instanceOf Title) ) { + $t = Title::newFromText( 'NO TITLE' ); + } + if ( strval( $t->getFragment() ) !== '' ) { # Strip the fragment to avoid various odd effects $this->mTitle = clone $t; _______________________________________________ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs