From: Pascal Corpet Date: Sat, 5 Jun 2010 13:10:55 +0000 (+0200) Subject: Lets the user set promo interval in both ways. Closes 1002 X-Git-Tag: xorg/1.0.0~179 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=80bb82f674b875b983db355eb0c8a9623e679d3c;p=platal.git Lets the user set promo interval in both ways. Closes 1002 --- 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; } }