|
@@ 289-293 (lines=5) @@
|
| 286 |
|
|
| 287 |
|
# Initial colon indicates main namespace rather than specified default |
| 288 |
|
# but should not create invalid {ns,title} pairs such as {0,Project:Foo} |
| 289 |
|
if ( $dbkey !== '' && ':' == $dbkey[0] ) { |
| 290 |
|
$parts['namespace'] = NS_MAIN; |
| 291 |
|
$dbkey = substr( $dbkey, 1 ); # remove the colon but continue processing |
| 292 |
|
$dbkey = trim( $dbkey, '_' ); # remove any subsequent whitespace |
| 293 |
|
} |
| 294 |
|
|
| 295 |
|
if ( $dbkey == '' ) { |
| 296 |
|
throw new MalformedTitleException( 'title-invalid-empty', $text ); |
|
@@ 353-356 (lines=4) @@
|
| 350 |
|
|
| 351 |
|
# If there's an initial colon after the interwiki, that also |
| 352 |
|
# resets the default namespace |
| 353 |
|
if ( $dbkey !== '' && $dbkey[0] == ':' ) { |
| 354 |
|
$parts['namespace'] = NS_MAIN; |
| 355 |
|
$dbkey = substr( $dbkey, 1 ); |
| 356 |
|
} |
| 357 |
|
} |
| 358 |
|
# If there's no recognized interwiki or namespace, |
| 359 |
|
# then let the colon expression be part of the title. |