summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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