| @@ 68-84 (lines=17) @@ | ||
| 65 | $this->opts = array_merge($defaults, $opts); |
|
| 66 | } |
|
| 67 | ||
| 68 | public function cmdPreprocess($cmd, &$args, $elfinder, $volume) { |
|
| 69 | $opts = $this->getOpts($volume); |
|
| 70 | if (! $opts['enable']) { |
|
| 71 | return false; |
|
| 72 | } |
|
| 73 | ||
| 74 | if (isset($args['name'])) { |
|
| 75 | if (is_array($args['name'])) { |
|
| 76 | foreach($args['name'] as $i => $name) { |
|
| 77 | $args['name'][$i] = $this->normalize($name, $opts); |
|
| 78 | } |
|
| 79 | } else { |
|
| 80 | $args['name'] = $this->normalize($args['name'], $opts); |
|
| 81 | } |
|
| 82 | } |
|
| 83 | return true; |
|
| 84 | } |
|
| 85 | ||
| 86 | public function onUpLoadPreSave(&$path, &$name, $src, $elfinder, $volume) { |
|
| 87 | $opts = $this->getOpts($volume); |
|
| @@ 60-76 (lines=17) @@ | ||
| 57 | $this->opts = array_merge($defaults, $opts); |
|
| 58 | } |
|
| 59 | ||
| 60 | public function cmdPreprocess($cmd, &$args, $elfinder, $volume) { |
|
| 61 | $opts = $this->getOpts($volume); |
|
| 62 | if (! $opts['enable']) { |
|
| 63 | return false; |
|
| 64 | } |
|
| 65 | ||
| 66 | if (isset($args['name'])) { |
|
| 67 | if (is_array($args['name'])) { |
|
| 68 | foreach($args['name'] as $i => $name) { |
|
| 69 | $args['name'][$i] = $this->sanitizeFileName($name, $opts); |
|
| 70 | } |
|
| 71 | } else { |
|
| 72 | $args['name'] = $this->sanitizeFileName($args['name'], $opts); |
|
| 73 | } |
|
| 74 | } |
|
| 75 | return true; |
|
| 76 | } |
|
| 77 | ||
| 78 | public function onUpLoadPreSave(&$path, &$name, $src, $elfinder, $volume) { |
|
| 79 | $opts = $this->getOpts($volume); |
|