@@ 295-299 (lines=5) @@ | ||
292 | ||
293 | # Initial colon indicates main namespace rather than specified default |
|
294 | # but should not create invalid {ns,title} pairs such as {0,Project:Foo} |
|
295 | if ( $dbkey !== '' && ':' == $dbkey[0] ) { |
|
296 | $parts['namespace'] = NS_MAIN; |
|
297 | $dbkey = substr( $dbkey, 1 ); # remove the colon but continue processing |
|
298 | $dbkey = trim( $dbkey, '_' ); # remove any subsequent whitespace |
|
299 | } |
|
300 | ||
301 | if ( $dbkey == '' ) { |
|
302 | throw new MalformedTitleException( 'title-invalid-empty', $text ); |
|
@@ 359-362 (lines=4) @@ | ||
356 | ||
357 | # If there's an initial colon after the interwiki, that also |
|
358 | # resets the default namespace |
|
359 | if ( $dbkey !== '' && $dbkey[0] == ':' ) { |
|
360 | $parts['namespace'] = NS_MAIN; |
|
361 | $dbkey = substr( $dbkey, 1 ); |
|
362 | } |
|
363 | } |
|
364 | # If there's no recognized interwiki or namespace, |
|
365 | # then let the colon expression be part of the title. |