Code Duplication    Length = 12-12 lines in 2 locations

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;

php/plugins/Normalizer/plugin.php 1 location

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