Skip to content

Commit

Permalink
Merge pull request #2075 from splitbrain/allowEmptyStringNumericOpt
Browse files Browse the repository at this point in the history
bugfix: empty string is valid for numericopt
  • Loading branch information
splitbrain committed Aug 27, 2017
2 parents 594b162 + 55a4f13 commit fb8e820
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions lib/plugins/config/settings/config.class.php
Expand Up @@ -982,6 +982,22 @@ function out($var, $fmt='php') {
class setting_numericopt extends setting_numeric {
// just allow an empty config
var $_pattern = '/^(|[-]?[0-9]+(?:[-+*][0-9]+)*)$/';


/**
* Empty string is valid for numericopt
*
* @param mixed $input
*
* @return bool
*/
function update($input) {
if ($input === '') {
return true;
}

return parent::update($input);
}
}
}

Expand Down

0 comments on commit fb8e820

Please sign in to comment.