]> git.mjollnir.org Git - moodle.git/commitdiff
PARAM_BOOL now accepts "yes/no" too
authorskodak <skodak>
Wed, 12 Apr 2006 16:55:47 +0000 (16:55 +0000)
committerskodak <skodak>
Wed, 12 Apr 2006 16:55:47 +0000 (16:55 +0000)
lib/moodlelib.php

index 6eb7f8160db26f7758f39b92bd6150a244632ba3..4ab4b5e1ef29953135c807564a1e5b0c9b94af4b 100644 (file)
@@ -347,9 +347,9 @@ function clean_param($param, $type) {
 
         case PARAM_BOOL:         // Convert to 1 or 0
             $tempstr = strtolower($param);
-            if ($tempstr == 'on') {
+            if ($tempstr == 'on' or $tempstr == 'yes' ) {
                 $param = 1;
-            } else if ($tempstr == 'off') {
+            } else if ($tempstr == 'off' or $tempstr == 'no') {
                 $param = 0;
             } else {
                 $param = empty($param) ? 0 : 1;