Code Duplication    Length = 11-11 lines in 2 locations

filesystem/Upload.php 1 location

@@ 538-548 (lines=11) @@
535
536
		$pathInfo = pathinfo($this->tmpFile['name']);
537
		// filesize validation
538
		if(!$this->isValidSize()) {
539
			$ext = (isset($pathInfo['extension'])) ? $pathInfo['extension'] : '';
540
			$arg = File::format_size($this->getAllowedMaxFileSize($ext));
541
			$this->errors[] = _t(
542
				'File.TOOLARGE',
543
				'File size is too large, maximum {size} allowed',
544
				'Argument 1: File size (e.g. 1MB)',
545
				array('size' => $arg)
546
			);
547
			return false;
548
		}
549
550
		// extension validation
551
		if(!$this->isValidExtension()) {

tests/filesystem/UploadTest.php 1 location

@@ 768-778 (lines=11) @@
765
		$pathInfo = pathinfo($this->tmpFile['name']);
766
		// filesize validation
767
768
		if(!$this->isValidSize()) {
769
			$ext = (isset($pathInfo['extension'])) ? $pathInfo['extension'] : '';
770
			$arg = File::format_size($this->getAllowedMaxFileSize($ext));
771
			$this->errors[] = _t(
772
				'File.TOOLARGE',
773
				'File size is too large, maximum {size} allowed',
774
				'Argument 1: File size (e.g. 1MB)',
775
				array('size' => $arg)
776
			);
777
			return false;
778
		}
779
780
		// extension validation
781
		if(!$this->isValidExtension()) {