Code Duplication    Length = 12-12 lines in 2 locations

php/plugins/Normalizer/plugin.php 1 location

@@ 86-97 (lines=12) @@
83
		return true;
84
	}
85
	
86
	public function onUpLoadPreSave(&$path, &$name, $src, $elfinder, $volume) {
87
		$opts = $this->getOpts($volume);
88
		if (! $opts['enable']) {
89
			return false;
90
		}
91
		
92
		if ($path) {
93
			$path = $this->normalize($path, $opts);
94
		}
95
		$name = $this->normalize($name, $opts);
96
		return true;
97
	}
98
	
99
	private function getOpts($volume) {
100
		$opts = $this->opts;

php/plugins/Sanitizer/plugin.php 1 location

@@ 78-89 (lines=12) @@
75
		return true;
76
	}
77
78
	public function onUpLoadPreSave(&$path, &$name, $src, $elfinder, $volume) {
79
		$opts = $this->getOpts($volume);
80
		if (! $opts['enable']) {
81
			return false;
82
		}
83
	
84
		if ($path) {
85
			$path = $this->sanitizeFileName($path, $opts, array('/'));
86
		}
87
		$name = $this->sanitizeFileName($name, $opts);
88
		return true;
89
	}
90
	
91
	private function getOpts($volume) {
92
		$opts = $this->opts;