Added namepsace-support to cli and specialpage

This commit is contained in:
c0nnex
2015-09-30 02:48:10 +02:00
parent c75fe391ce
commit 5e58bc0dfc
3 changed files with 19 additions and 11 deletions

View File

@@ -239,13 +239,12 @@
/// If in doubt, call MediaWiki's `RequestContext::getMain()`
/// to obtain such an object.
/// @returns undefined
public static function processPage($title, RequestContext $context) {
// TODO: make this namespace-aware
$titleObj = Title::makeTitle(0, $title);
$page = WikiPage::factory($titleObj);
public static function processPage(Title $title, RequestContext $context) {
// TODO: make this namespace-aware
$page = WikiPage::factory($title);
$content = $page->getContent();
$text = $content->getContentHandler()->serializeContent($content);
$newText = LinkTitles::parseContent($titleObj, $text);
$newText = LinkTitles::parseContent($title, $text);
if ( $text != $newText ) {
$content = $content->getContentHandler()->unserializeContent( $newText );
$page->doQuickEditContent($content,