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