diff options
author | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-05-01 15:30:02 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-05-01 15:30:02 -0400 |
commit | 1de335ad3f395ca6861085393ba366a9e3fb4a0d (patch) | |
tree | f1fdd326034e05177596851be6a7127615d81498 /extensions/SpamBlacklist/SpamBlacklistHooks.php | |
parent | 9c75fa8ff6d4d38ef552c00fef5969fb154765e8 (diff) | |
parent | f6d65e533c62f6deb21342d4901ece24497b433e (diff) |
Merge commit 'f6d65'
# Conflicts:
# skins/ArchLinux/ArchLinux.php
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 |