summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSavetheinternet <savetheinternet@n0v4.com>2011-01-02 21:34:04 +1100
committerSavetheinternet <savetheinternet@n0v4.com>2011-01-02 21:34:04 +1100
commitf1f68b0e7eedc26ea507e039bafffb20a083f918 (patch)
treeee2e63331098f89015f98a9afc26b71488305e88
parenta3143b5b3da3a9781b3e63826041e3b6a7f8b70e (diff)
Fixed ban lengths
-rw-r--r--mod.php6
1 files 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