From f1f68b0e7eedc26ea507e039bafffb20a083f918 Mon Sep 17 00:00:00 2001 From: Savetheinternet Date: Sun, 2 Jan 2011 21:34:04 +1100 Subject: [PATCH] Fixed ban lengths --- mod.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mod.php b/mod.php index 69d8dafe..7d821f1d 100644 --- a/mod.php +++ b/mod.php @@ -347,8 +347,8 @@ // 1yr2hrs30mins // 1y2h30m - if(preg_match('/^((\d+)\s?ye?a?r?s?)?\s?+((\d+)\s?we?e?k?s?)?\s?+((\d+)\s?da?y?s?)?((\d+)\s?ho?u?r?s?)?\s?+((\d+)\s?m?i?n?u?t?e?s?)?\s?+((\d+)\s?s?e?c?o?n?d?s?)?$/', $_POST['length'], $m)) { - $expire = 0; + $expire = 0; + if(preg_match('/^((\d+)\s?ye?a?r?s?)?\s?+((\d+)\s?we?e?k?s?)?\s?+((\d+)\s?da?y?s?)?((\d+)\s?ho?u?r?s?)?\s?+((\d+)?mi?n?u?t?e?s?)?\s?+((\d+)\s?se?c?o?n?d?s?)?$/', $_POST['length'], $m)) { if(isset($m[2])) { // Years $expire += $m[2]*60*60*24*7*52; @@ -373,6 +373,8 @@ // Seconds $expire += $m[12]; } + } + if($expire) { $query->bindValue(':expires', time()+$expire, PDO::PARAM_INT); } else { // Never expire