SettingNumericopt.php 552 B

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