summaryrefslogtreecommitdiff
path: root/extensions
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2007-03-02 15:42:57 +0000
committerPierre Schmitz <pierre@archlinux.de>2007-03-02 15:42:57 +0000
commitc9d56a12538ecb4d6e3d5ebd2f9971cab6410539 (patch)
tree4c29887a2ffb8a990dcad2a35da36a2165c2fe9f /extensions
parent9ea05545197378466dc3ceee0f55bcd5819264cb (diff)
kleine Fehler in der FunnyDot-Extension behoben
Diffstat (limited to 'extensions')
-rw-r--r--extensions/FunnyDot.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/extensions/FunnyDot.php b/extensions/FunnyDot.php
index 81636bb4..93a66f08 100644
--- a/extensions/FunnyDot.php
+++ b/extensions/FunnyDot.php
@@ -6,6 +6,12 @@ global $wgHooks;
$wgHooks['ArticleSave'][] = 'checkAntiSpamHash';
+function hexVal($in)
+ {
+ $result = preg_replace('/[^0-9a-fA-F]/', '', $in);
+ return (empty($result) ? 0 : $result);
+ }
+
function checkAntiSpamHash()
{
global $wgAntiSpamHash, $wgAntiSpamTimeout, $wgAntiSpamWait;
@@ -15,7 +21,7 @@ function checkAntiSpamHash()
if (!empty($_COOKIE['AntiSpamTime']) && !empty($_COOKIE['AntiSpamHash']))
{
$time = intval($_COOKIE['AntiSpamTime']);
- $hash = $_COOKIE['AntiSpamHash'];
+ $hash = hexVal($_COOKIE['AntiSpamHash']);
if ($hash != sha1($time.$wgAntiSpamHash))
{