Conditions | 2 |
Paths | 2 |
Total Lines | 15 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 2 |
Changes | 2 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
44 | 2 | public function newWikiPage( Title $title ) { |
|
45 | |||
46 | // #55 |
||
47 | // Fight a possible DB corruption and avoid "NS_MEDIA is a virtual namespace; use NS_FILE" |
||
48 | 2 | if ( $title->getNamespace() === NS_MEDIA ) { |
|
49 | 1 | $title = Title::makeTitleSafe( |
|
50 | 1 | NS_FILE, |
|
51 | 1 | $title->getDBkey(), |
|
52 | 1 | $title->getInterwiki(), |
|
53 | 1 | $title->getFragment() |
|
54 | 1 | ); |
|
55 | 1 | } |
|
56 | |||
57 | 2 | return \WikiPage::factory( $title ); |
|
58 | } |
||
59 | |||
99 |