diff options
Diffstat (limited to 'extensions/FunnyDot.php')
-rw-r--r-- | extensions/FunnyDot.php | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/extensions/FunnyDot.php b/extensions/FunnyDot.php index 418575e2..d9d932ae 100644 --- a/extensions/FunnyDot.php +++ b/extensions/FunnyDot.php @@ -1,9 +1,6 @@ <?php -if ( defined( 'MEDIAWIKI' ) ) { - -global $wgHooks; -$wgHooks['ArticleSave'][] = 'checkAntiSpamHash'; +$wgHooks['ArticleSave'][] = 'FunnyDot::checkAntiSpamHash'; $wgExtensionCredits['other'][] = array( 'name' => 'FunnyDot', @@ -12,13 +9,15 @@ $wgExtensionCredits['other'][] = array( 'url' => 'http://www.laber-land.de', ); -function hexVal($in) +class FunnyDot { + +private static function hexVal($in) { $result = preg_replace('/[^0-9a-fA-F]/', '', $in); return (empty($result) ? 0 : $result); } -function checkAntiSpamHash() +public static function checkAntiSpamHash() { global $wgAntiSpamHash, $wgAntiSpamTimeout, $wgAntiSpamWait; @@ -27,7 +26,7 @@ function checkAntiSpamHash() if (!empty($_COOKIE['AntiSpamTime']) && !empty($_COOKIE['AntiSpamHash'])) { $time = intval($_COOKIE['AntiSpamTime']); - $hash = hexVal($_COOKIE['AntiSpamHash']); + $hash = self::hexVal($_COOKIE['AntiSpamHash']); if ($hash != sha1($time.$wgAntiSpamHash)) { @@ -51,5 +50,6 @@ function checkAntiSpamHash() return true; } -} # End invocation guard +} + ?>
\ No newline at end of file |