From 80bb82f674b875b983db355eb0c8a9623e679d3c Mon Sep 17 00:00:00 2001 From: Pascal Corpet Date: Sat, 5 Jun 2010 15:10:55 +0200 Subject: [PATCH] Lets the user set promo interval in both ways. Closes 1002 --- ChangeLog | 3 +++ modules/survey/survey.inc.php | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 7226b97..485b94e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -31,6 +31,9 @@ Bug/Wish: - #891: Improves education display -JAC - #1081: Sorts language alphabetically in skill tab -Car + * Survey: + - #1002: Lets the user set promo interval in both ways -Car + * XnetLists: - #1010: Prevent empty list creation -Car diff --git a/modules/survey/survey.inc.php b/modules/survey/survey.inc.php index fe559fc..b416b28 100644 --- a/modules/survey/survey.inc.php +++ b/modules/survey/survey.inc.php @@ -104,7 +104,9 @@ class Survey if ((preg_match('#^\d{4}$#', $p) && $p == $promo) || (preg_match('#^\d{4}-$#', $p) && intval(substr($p, 0, 4)) <= $promo) || (preg_match('#^-\d{4}$#', $p) && intval(substr($p, 1)) >= $promo) || - (preg_match('#^\d{4}-\d{4}$#', $p) && intval(substr($p, 0, 4)) <= $promo && intval(substr($p, 5)) >= $promo)) { + (preg_match('#^\d{4}-\d{4}$#', $p) && + (intval(substr($p, 0, 4)) <= $promo && intval(substr($p, 5)) >= $promo || + intval(substr($p, 0, 4)) >= $promo && intval(substr($p, 5)) <= $promo ))) { return true; } } -- 2.1.4