xref: /dokuwiki/lib/plugins/config/core/Setting/SettingNumericopt.php (revision 8c7c53b0321a3cd3116b8d3b2ad27863a38dece7)
1<?php
2
3namespace dokuwiki\plugin\config\core\Setting;
4
5/**
6 * Class setting_numericopt
7 */
8class SettingNumericopt extends SettingNumeric
9{
10    // just allow an empty config
11    protected $pattern = '/^(|[-]?\d+(?:[-+*]\d+)*)$/';
12
13    /**
14     * @inheritdoc
15     * Empty string is valid for numericopt
16     */
17    public function update($input) {
18        if($input === '') {
19            if($input == $this->local) return false;
20            $this->local = $input;
21            return true;
22        }
23
24        return parent::update($input);
25    }
26}
27