Pastakhov has uploaded a new change for review. https://gerrit.wikimedia.org/r/76894
Change subject: fix minor bug with nowiki tag ...................................................................... fix minor bug with nowiki tag Thanks User:Protnet for report and User:Phorgo for help. http://www.mediawiki.org/wiki/Extension_talk:MagicNoCache#Minor_bug_with_nowiki_tag_31305 Change-Id: If8a71fa907a5d6fb8bd0d693a9cca10f7f2a59ea --- M MagicNoCache.php 1 file changed, 8 insertions(+), 20 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MagicNoCache refs/changes/94/76894/1 diff --git a/MagicNoCache.php b/MagicNoCache.php index 584de89..3cc746d 100644 --- a/MagicNoCache.php +++ b/MagicNoCache.php @@ -24,11 +24,11 @@ $wgExtensionCredits['parserhook'][] = array( 'path' => __FILE__, 'name' => 'MagicNoCache', - 'version' => '1.2.1', + 'version' => '1.2.2', 'url' => 'https://www.mediawiki.org/wiki/Extension:MagicNoCache', 'author' => array( 'Kimon Andreou', - 'Pavel Astakhov', + '[https://www.mediawiki.org/wiki/User:Pastakhov Pavel Astakhov]', '...' ), 'descriptionmsg' => 'magicnocache-desc' @@ -41,27 +41,15 @@ $wgExtensionMessagesFiles['MagicNoCache'] = $dir . '/MagicNoCache.i18n.php'; $wgExtensionMessagesFiles['MagicNoCacheMagic'] = $dir . '/MagicNoCache.i18n.magic.php'; -// Register hooks -$wgHooks['ParserBeforeTidy'][] = 'MagicNoCache::onParserBeforeTidy'; - -// Create extension class -class MagicNoCache -{ - /** - * Check to see if we have the magic word in the article - * @global OutputPage $wgOut - * @global array $wgAction - * @return boolean - */ - public static function onParserBeforeTidy(&$parser, &$text) { - global $wgOut, $wgAction; - $mw = MagicWord::get('MAG_NOCACHE'); +// Check to see if we have the magic word in the article +$wgHooks['InternalParseBeforeLinks'][] = function( &$parser, &$text ) { + global $wgOut, $wgAction; + $mw = MagicWord::get('MAG_NOCACHE'); // if it is there, remove it and disable caching if ( !in_array( $wgAction, array( 'submit', 'edit') ) && $mw->matchAndRemove($text) ) { $parser->disableCache(); $wgOut->enableClientCache(false); - } - return true; } -} + return true; +}; -- To view, visit https://gerrit.wikimedia.org/r/76894 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If8a71fa907a5d6fb8bd0d693a9cca10f7f2a59ea Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MagicNoCache Gerrit-Branch: master Gerrit-Owner: Pastakhov <pastak...@yandex.ru> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits