Handle bogus entries in MediaWiki:Scribunto-doc-page-name

If someone puts something broken in MediaWiki:Scribunto-doc-page-name,
it may not be possible to determine which module the page is a doc page
for. In that case, just pretend it's not a doc page.

Bug: 49322
Change-Id: Ia4421576b372e188cf7e3dfe2c0b8ce213d026d4
This commit is contained in:
Brad Jorsch 2013-06-07 18:21:31 -04:00
parent 6081c4fd30
commit e12d743986

View file

@ -87,7 +87,7 @@ class Scribunto {
$docPage = str_replace( '\\$1', '(.+)', preg_quote( $docPage, '/' ) );
if ( preg_match( "/^$docPage$/", $title->getPrefixedText(), $m ) ) {
$forModule = Title::makeTitleSafe( NS_MODULE, $m[1] );
return true;
return $forModule !== null;
} else {
return false;
}