xref: /dokuwiki/lib/plugins/config/core/Setting/SettingImConvert.php (revision 8c7c53b0321a3cd3116b8d3b2ad27863a38dece7)
1<?php
2
3namespace dokuwiki\plugin\config\core\Setting;
4
5/**
6 * Class setting_im_convert
7 */
8class SettingImConvert extends SettingString
9{
10
11    /** @inheritdoc */
12    public function update($input) {
13        if($this->isProtected()) return false;
14
15        $input = trim($input);
16
17        $value = is_null($this->local) ? $this->default : $this->local;
18        if($value == $input) return false;
19
20        if($input && !file_exists($input)) {
21            $this->error = true;
22            $this->input = $input;
23            return false;
24        }
25
26        $this->local = $input;
27        return true;
28    }
29}
30