xref: /dokuwiki/lib/plugins/config/core/Setting/SettingImConvert.php (revision 946266a367fa29aaa3d9b153b934b57820660179)
1<?php
2
3namespace dokuwiki\plugin\config\core\Setting;
4
5/**
6 * Class setting_im_convert
7 */
8class SettingImConvert extends SettingString
9{
10    /** @inheritdoc */
11    public function update($input)
12    {
13        if ($this->isProtected()) return false;
14
15        $input = trim($input);
16
17        $value = $this->local ?? $this->default;
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