]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-19418 Correcting expression by escaping ~ so that it is interpreted as a charracter
authorpichetp <pichetp>
Sun, 6 Sep 2009 20:34:09 +0000 (20:34 +0000)
committerpichetp <pichetp>
Sun, 6 Sep 2009 20:34:09 +0000 (20:34 +0000)
question/type/calculated/questiontype.php

index 35fa83b64cd55891c47af0e76fed21e780e33217..8327bc8c1496b44935f7ce093a99e35c5914d214 100644 (file)
@@ -1979,7 +1979,7 @@ function qtype_calculated_find_formula_errors($formula) {
     // Strip away empty space and lowercase it
     $formula = strtolower(str_replace(' ', '', $formula));
 
-    $safeoperatorchar = '-+/*%>:^~<?=&|!'; /* */
+    $safeoperatorchar = '-+/*%>:^\~<?=&|!'; /* */
     $operatorornumber = "[$safeoperatorchar.0-9eE]";
 
     while ( preg_match("~(^|[$safeoperatorchar,(])([a-z0-9_]*)\\(($operatorornumber+(,$operatorornumber+((,$operatorornumber+)+)?)?)?\\)~",