Lets the user set promo interval in both ways. Closes 1002
authorPascal Corpet <pascal.corpet@m4x.org>
Sat, 5 Jun 2010 13:10:55 +0000 (15:10 +0200)
committerPascal Corpet <pascal.corpet@m4x.org>
Sat, 5 Jun 2010 13:11:06 +0000 (15:11 +0200)
ChangeLog
modules/survey/survey.inc.php

index 7226b97..485b94e 100644 (file)
--- 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
 
index fe559fc..b416b28 100644 (file)
@@ -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;
             }
         }