Do not remove magic word when saving page.

This commit is contained in:
Daniel Kraus
2013-02-23 14:07:00 +01:00
parent 6d38db71af
commit ae1f72aefd
4 changed files with 13 additions and 2 deletions

View File

@ -42,6 +42,7 @@
if ( $wgLinkTitlesParseOnRender ) {
$wgHooks['ArticleAfterFetchContent'][] = 'LinkTitles::onArticleAfterFetchContent';
};
$wgHooks['ParserBeforeTidy'][] = 'LinkTitles::removeMagicWord';
}
/// This function is hooked to the ArticleSave event.
@ -76,7 +77,7 @@
// If the page contains the magic word '__NOAUTOLINKS__', do not parse
// the content.
$mw = MagicWord::get('MAG_LINKTITLES_NOAUTOLINKS');
if ( $mw -> matchAndRemove( $text ) ) {
if ( $mw -> match( $text ) ) {
return true;
}
@ -200,6 +201,12 @@
return '[[' . LinkTitles::$safeTitle . '|' . $matches[0] . ']]';
}
}
function removeMagicWord( &$parser, &$text ) {
$mw = MagicWord::get('MAG_LINKTITLES_NOAUTOLINKS');
$mw -> matchAndRemove( $text );
return true;
}
}
// vim: ts=2:sw=2:noet