Code Duplication    Length = 17-17 lines in 2 locations

php/plugins/Sanitizer/plugin.php 1 location

@@ 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);

php/plugins/Normalizer/plugin.php 1 location

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