Index: trunk/phase3/includes/parser/Parser.php |
— | — | @@ -258,11 +258,12 @@ |
259 | 259 | * Set the context title |
260 | 260 | */ |
261 | 261 | 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" |
262 | 266 | 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) ) { |
267 | 268 | $t = Title::newFromText( "$t" ); |
268 | 269 | } |
269 | 270 | |