MDL-37961 webservice: PARAM_BOOL with PARAM_DEFAULT accepts boolean default
authorFrederic Massart <fred@moodle.com>
Mon, 11 Feb 2013 06:37:19 +0000 (14:37 +0800)
committerFrederic Massart <fred@moodle.com>
Mon, 11 Feb 2013 06:37:19 +0000 (14:37 +0800)
webservice/lib.php

index 3d7b113..005787d 100644 (file)
@@ -1191,7 +1191,7 @@ class '.$classname.' {
                     } else {
                         switch($keydesc->type) {
                             case PARAM_BOOL:
-                                $paramanddefault .= '='.$keydesc->default; break;
+                                $paramanddefault .= '='. (int) $keydesc->default; break;
                             case PARAM_INT:
                                 $paramanddefault .= '='.$keydesc->default; break;
                             case PARAM_FLOAT;