diff options
| author | Savetheinternet <savetheinternet@n0v4.com> | 2011-01-02 21:34:04 +1100 |
|---|---|---|
| committer | Savetheinternet <savetheinternet@n0v4.com> | 2011-01-02 21:34:04 +1100 |
| commit | f1f68b0e7eedc26ea507e039bafffb20a083f918 (patch) | |
| tree | ee2e63331098f89015f98a9afc26b71488305e88 /mod.php | |
| parent | a3143b5b3da3a9781b3e63826041e3b6a7f8b70e (diff) | |
Fixed ban lengths
Diffstat (limited to 'mod.php')
| -rw-r--r-- | mod.php | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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 |
