Code Duplication    Length = 11-12 lines in 2 locations

Assets/Upload_Validator.php 1 location

@@ 264-275 (lines=12) @@
261
		}
262
263
		// filesize validation
264
		if (!$this->isValidSize()) {
265
			$pathInfo = pathinfo($this->tmpFile['name']);
266
			$ext = (isset($pathInfo['extension'])) ? $pathInfo['extension'] : '';
267
			$arg = File::format_size($this->getAllowedMaxFileSize($ext));
268
			$this->errors[] = _t(
269
				'File.TOOLARGE',
270
				'Filesize is too large, maximum {size} allowed',
271
				'Argument 1: Filesize (e.g. 1MB)',
272
				array('size' => $arg)
273
			);
274
			return false;
275
		}
276
277
		// extension validation
278
		if (!$this->isValidExtension()) {

tests/filesystem/UploadTest.php 1 location

@@ 819-829 (lines=11) @@
816
		$pathInfo = pathinfo($this->tmpFile['name']);
817
		// filesize validation
818
819
		if(!$this->isValidSize()) {
820
			$ext = (isset($pathInfo['extension'])) ? $pathInfo['extension'] : '';
821
			$arg = File::format_size($this->getAllowedMaxFileSize($ext));
822
			$this->errors[] = _t(
823
				'File.TOOLARGE',
824
				'File size is too large, maximum {size} allowed',
825
				'Argument 1: File size (e.g. 1MB)',
826
				array('size' => $arg)
827
			);
828
			return false;
829
		}
830
831
		// extension validation
832
		if(!$this->isValidExtension()) {