r61043 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r61042‎ | r61043 | r61044 >
Date:05:02, 14 January 2010
Author:mah
Status:ok
Tags:
Comment:
follow up r60832: Remove un-necessary test for stringiness since "" converts it.
Modified paths:
  • /trunk/phase3/includes/parser/Parser.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/parser/Parser.php
@@ -258,11 +258,12 @@
259259 * Set the context title
260260 */
261261 function setTitle( $t ) {
 262+ // If don't have a Title object, then convert what we have to
 263+ // a string and then to Title. If you pass in an object, make
 264+ // sure it has a __toString() method or you'll get a
 265+ // "Catchable fatal error"
262266 if ( $t && !($t instanceOf FakeTitle)
263 - && !($t instanceOf Title)
264 - && is_string( "$t" ) ) {
265 - // If don't have a Title object, make sure we can convert
266 - // whatever we've been passed to a string.
 267+ && !($t instanceOf Title) ) {
267268 $t = Title::newFromText( "$t" );
268269 }
269270

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r60832follow up r60763...mah08:22, 8 January 2010

Status & tagging log