Code Duplication    Length = 13-13 lines in 2 locations

engine/lib/filestore.php 1 location

@@ 510-522 (lines=13) @@
507
508
	// hack for Microsoft zipped formats
509
	$office_formats = array('docx', 'xlsx', 'pptx');
510
	if ($mime_type == "application/zip" && in_array($info['extension'], $office_formats)) {
511
		switch ($info['extension']) {
512
			case 'docx':
513
				$mime_type = "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
514
				break;
515
			case 'xlsx':
516
				$mime_type = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
517
				break;
518
			case 'pptx':
519
				$mime_type = "application/vnd.openxmlformats-officedocument.presentationml.presentation";
520
				break;
521
		}
522
	}
523
524
	// check for bad ppt detection
525
	if ($mime_type == "application/vnd.ms-office" && $info['extension'] == "ppt") {

mod/file_tools/lib/functions.php 1 location

@@ 956-968 (lines=13) @@
953
							// hack for Microsoft zipped formats
954
							$info = pathinfo($folder);
955
							$office_formats = array("docx", "xlsx", "pptx");
956
							if ($mime_type == "application/zip" && in_array($info["extension"], $office_formats)) {
957
								switch ($info["extension"]) {
958
									case "docx":
959
										$mime_type = "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
960
										break;
961
									case "xlsx":
962
										$mime_type = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
963
										break;
964
									case "pptx":
965
										$mime_type = "application/vnd.openxmlformats-officedocument.presentationml.presentation";
966
										break;
967
								}
968
							}
969
							
970
							// check for bad ppt detection
971
							if ($mime_type == "application/vnd.ms-office" && $info["extension"] == "ppt") {