Skip to content
Snippets Groups Projects
Unverified Commit 55a4f137 authored by Michael Große's avatar Michael Große
Browse files

fix(config): empty string is valid for numericopt

There was a bug that the empty string was considered to be invalid if
also a max or min value was defined for a config field of type
numericopt.
parent dd7064d9
No related branches found
No related tags found
No related merge requests found
......@@ -982,6 +982,22 @@ if (!class_exists('setting_numericopt')) {
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);
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment