]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-12775 PARAM_INT value '' automatically converted to 0 in configtext settings...
authorskodak <skodak>
Sun, 30 Dec 2007 22:30:46 +0000 (22:30 +0000)
committerskodak <skodak>
Sun, 30 Dec 2007 22:30:46 +0000 (22:30 +0000)
lib/adminlib.php

index f7e0453a99094e932ca4db06a91566e607b6e99e..bcd2189888430dfa7d6ade630f3364a864f26660 100644 (file)
@@ -1662,6 +1662,10 @@ class admin_setting_configtext extends admin_setting {
     }
 
     function write_setting($data) {
+        if ($this->paramtype === PARAM_INT and $data === '') {
+            // do not complain if '' used instead of 0
+            $data = 0;
+        }
         // $data is a string
         $validated = $this->validate($data); 
         if ($validated !== true) {