Code Duplication    Length = 7-7 lines in 2 locations

forms/AssetField.php 1 location

@@ 530-536 (lines=7) @@
527
		);
528
529
		// Validation: File extensions
530
		if ($allowedExtensions = $this->getAllowedExtensions()) {
531
			$config['acceptFileTypes'] = '(\.|\/)(' . implode('|', $allowedExtensions) . ')$';
532
			$config['errorMessages']['acceptFileTypes'] = _t(
533
				'File.INVALIDEXTENSIONSHORT',
534
				'Extension is not allowed'
535
			);
536
		}
537
538
		// Validation: File size
539
		if ($allowedMaxFileSize = $this->getValidator()->getAllowedMaxFileSize()) {

forms/UploadField.php 1 location

@@ 969-975 (lines=7) @@
966
		);
967
968
		// Validation: File extensions
969
		if ($allowedExtensions = $this->getAllowedExtensions()) {
970
			$config['acceptFileTypes'] = '(\.|\/)(' . implode('|', $allowedExtensions) . ')$';
971
			$config['errorMessages']['acceptFileTypes'] = _t(
972
				'File.INVALIDEXTENSIONSHORT',
973
				'Extension is not allowed'
974
			);
975
		}
976
977
		// Validation: File size
978
		if ($allowedMaxFileSize = $this->getValidator()->getAllowedMaxFileSize()) {