From 55a4f137738ef5718cc047e5fb802e1c6d0a409f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Gro=C3=9Fe?= Date: Tue, 15 Aug 2017 18:55:06 +0200 Subject: [PATCH] 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. --- lib/plugins/config/settings/config.class.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/lib/plugins/config/settings/config.class.php b/lib/plugins/config/settings/config.class.php index 965c2a38c6..3196d75271 100644 --- a/lib/plugins/config/settings/config.class.php +++ b/lib/plugins/config/settings/config.class.php @@ -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); + } } }