diff options
Diffstat (limited to 'extensions/SpamBlacklist/SpamBlacklistHooks.php')
-rw-r--r-- | extensions/SpamBlacklist/SpamBlacklistHooks.php | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/extensions/SpamBlacklist/SpamBlacklistHooks.php b/extensions/SpamBlacklist/SpamBlacklistHooks.php index 223c1065..c8a322b6 100644 --- a/extensions/SpamBlacklist/SpamBlacklistHooks.php +++ b/extensions/SpamBlacklist/SpamBlacklistHooks.php @@ -4,6 +4,30 @@ * Hooks for the spam blacklist extension */ class SpamBlacklistHooks { + + /** + * T99257: Extension registration does not properly support 2d arrays so set it as a global for now + */ + public static function registerExtension() { + global $wgSpamBlacklistFiles, $wgBlacklistSettings, $wgSpamBlacklistSettings; + + $wgBlacklistSettings = array( + 'spam' => array( + 'files' => array( "https://meta.wikimedia.org/w/index.php?title=Spam_blacklist&action=raw&sb_ver=1" ) + ) + ); + + /** + * @deprecated + */ + $wgSpamBlacklistFiles =& $wgBlacklistSettings['spam']['files']; + + /** + * @deprecated + */ + $wgSpamBlacklistSettings =& $wgBlacklistSettings['spam']; + } + /** * Hook function for EditFilterMergedContent * @@ -25,8 +49,8 @@ class SpamBlacklistHooks { } // get the link from the not-yet-saved page content. - // no need to generate html to get external links - $pout = $content->getParserOutput( $title, null, null, false ); + $editInfo = $context->getWikiPage()->prepareContentForEdit( $content ); + $pout = $editInfo->output; $links = array_keys( $pout->getExternalLinks() ); // HACK: treat the edit summary as a link |