Index: trunk/extensions/LiquidThreads/classes/Threads.php |
— | — | @@ -285,8 +285,11 @@ |
286 | 286 | public static function incrementedTitle( $basename, $namespace ) { |
287 | 287 | $i = 2; |
288 | 288 | |
| 289 | + $replacements = array_fill_keys( array( '[', ']', '{', '}', '|' ), '_' ); |
| 290 | + $basename = strtr( $basename, $replacements ); |
| 291 | + |
289 | 292 | $t = Title::makeTitleSafe( $namespace, $basename ); |
290 | | - while ( $t->exists() || |
| 293 | + while ( !$t || $t->exists() || |
291 | 294 | in_array( $t->getPrefixedDBkey(), self::$occupied_titles ) ) { |
292 | 295 | $t = Title::makeTitleSafe( $namespace, $basename . ' (' . $i . ')' ); |
293 | 296 | $i++; |