Commit 485778a4a932eb3ca5ef9a53e70dd3890391af97
1 parent
6954dd0a
Removed office templates and .htm from the list of supported mimetypes.
PT: 1417648 Committed by: Megan Watson
Showing
2 changed files
with
40 additions
and
24 deletions
plugins/pdfConverter/pdfConverter.php
| @@ -93,6 +93,14 @@ class pdfConverter extends BaseProcessor | @@ -93,6 +93,14 @@ class pdfConverter extends BaseProcessor | ||
| 93 | // 'odp', 'otp', 'sxi', 'sti', 'ppt', 'pot', 'sxd', 'odg', | 93 | // 'odp', 'otp', 'sxi', 'sti', 'ppt', 'pot', 'sxd', 'odg', |
| 94 | // 'otg', 'std', 'asc'); | 94 | // 'otg', 'std', 'asc'); |
| 95 | 95 | ||
| 96 | + // work around for ms office xp and 2003 templates - the mime type is identical but the templates aren't supported | ||
| 97 | + if(!empty($fileType)){ | ||
| 98 | + $types = array('dot', 'xlt', 'pot', 'htm'); | ||
| 99 | + if(in_array($fileType, $types)){ | ||
| 100 | + return false; | ||
| 101 | + } | ||
| 102 | + } | ||
| 103 | + | ||
| 96 | // taken from the original list of accepted types in the pdf generator action | 104 | // taken from the original list of accepted types in the pdf generator action |
| 97 | $mime_types = array(); | 105 | $mime_types = array(); |
| 98 | $mime_types[] = 'text/plain'; | 106 | $mime_types[] = 'text/plain'; |
| @@ -107,33 +115,33 @@ class pdfConverter extends BaseProcessor | @@ -107,33 +115,33 @@ class pdfConverter extends BaseProcessor | ||
| 107 | 115 | ||
| 108 | // Star Office | 116 | // Star Office |
| 109 | $mime_types[] = 'application/vnd.sun.xml.writer'; | 117 | $mime_types[] = 'application/vnd.sun.xml.writer'; |
| 110 | - $mime_types[] = 'application/vnd.sun.xml.writer.template'; | 118 | + //$mime_types[] = 'application/vnd.sun.xml.writer.template'; |
| 111 | $mime_types[] = 'application/vnd.sun.xml.calc'; | 119 | $mime_types[] = 'application/vnd.sun.xml.calc'; |
| 112 | - $mime_types[] = 'application/vnd.sun.xml.calc.template'; | 120 | + //$mime_types[] = 'application/vnd.sun.xml.calc.template'; |
| 113 | $mime_types[] = 'application/vnd.sun.xml.draw'; | 121 | $mime_types[] = 'application/vnd.sun.xml.draw'; |
| 114 | - $mime_types[] = 'application/vnd.sun.xml.draw.template'; | 122 | + //$mime_types[] = 'application/vnd.sun.xml.draw.template'; |
| 115 | $mime_types[] = 'application/vnd.sun.xml.impress'; | 123 | $mime_types[] = 'application/vnd.sun.xml.impress'; |
| 116 | - $mime_types[] = 'application/vnd.sun.xml.impress.template'; | 124 | + //$mime_types[] = 'application/vnd.sun.xml.impress.template'; |
| 117 | 125 | ||
| 118 | // Open Office | 126 | // Open Office |
| 119 | $mime_types[] = 'application/vnd.oasis.opendocument.text'; | 127 | $mime_types[] = 'application/vnd.oasis.opendocument.text'; |
| 120 | - $mime_types[] = 'application/vnd.oasis.opendocument.text-template'; | 128 | + //$mime_types[] = 'application/vnd.oasis.opendocument.text-template'; |
| 121 | $mime_types[] = 'application/vnd.oasis.opendocument.graphics'; | 129 | $mime_types[] = 'application/vnd.oasis.opendocument.graphics'; |
| 122 | - $mime_types[] = 'application/vnd.oasis.opendocument.graphics-template'; | 130 | + //$mime_types[] = 'application/vnd.oasis.opendocument.graphics-template'; |
| 123 | $mime_types[] = 'application/vnd.oasis.opendocument.presentation'; | 131 | $mime_types[] = 'application/vnd.oasis.opendocument.presentation'; |
| 124 | - $mime_types[] = 'application/vnd.oasis.opendocument.presentation-template'; | 132 | + //$mime_types[] = 'application/vnd.oasis.opendocument.presentation-template'; |
| 125 | $mime_types[] = 'application/vnd.oasis.opendocument.spreadsheet'; | 133 | $mime_types[] = 'application/vnd.oasis.opendocument.spreadsheet'; |
| 126 | - $mime_types[] = 'application/vnd.oasis.opendocument.spreadsheet-template'; | 134 | + //$mime_types[] = 'application/vnd.oasis.opendocument.spreadsheet-template'; |
| 127 | 135 | ||
| 128 | /* OO3 */ | 136 | /* OO3 */ |
| 129 | // Office 2007 | 137 | // Office 2007 |
| 130 | $mime_types[] = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'; | 138 | $mime_types[] = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'; |
| 131 | - $mime_types[] = 'application/vnd.openxmlformats-officedocument.wordprocessingml.template'; | ||
| 132 | - $mime_types[] = 'application/vnd.openxmlformats-officedocument.presentationml.template'; | ||
| 133 | - $mime_types[] = 'application/vnd.openxmlformats-officedocument.presentationml.slideshow'; | 139 | + //$mime_types[] = 'application/vnd.openxmlformats-officedocument.wordprocessingml.template'; |
| 140 | + //$mime_types[] = 'application/vnd.openxmlformats-officedocument.presentationml.template'; | ||
| 141 | + //$mime_types[] = 'application/vnd.openxmlformats-officedocument.presentationml.slideshow'; | ||
| 134 | $mime_types[] = 'application/vnd.openxmlformats-officedocument.presentationml.presentation'; | 142 | $mime_types[] = 'application/vnd.openxmlformats-officedocument.presentationml.presentation'; |
| 135 | $mime_types[] = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'; | 143 | $mime_types[] = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'; |
| 136 | - $mime_types[] = 'application/vnd.openxmlformats-officedocument.spreadsheetml.template'; | 144 | + //$mime_types[] = 'application/vnd.openxmlformats-officedocument.spreadsheetml.template'; |
| 137 | /* */ | 145 | /* */ |
| 138 | 146 | ||
| 139 | return $mime_types; | 147 | return $mime_types; |
plugins/thumbnails/thumbnails.php
| @@ -68,6 +68,14 @@ class thumbnailGenerator extends BaseProcessor | @@ -68,6 +68,14 @@ class thumbnailGenerator extends BaseProcessor | ||
| 68 | // 'odp', 'otp', 'sxi', 'sti', 'ppt', 'pot', 'sxd', 'odg', | 68 | // 'odp', 'otp', 'sxi', 'sti', 'ppt', 'pot', 'sxd', 'odg', |
| 69 | // 'otg', 'std', 'asc'); | 69 | // 'otg', 'std', 'asc'); |
| 70 | 70 | ||
| 71 | + // work around for ms office xp and 2003 templates - the mime type is identical but the templates aren't supported | ||
| 72 | + if(!empty($fileType)){ | ||
| 73 | + $types = array('dot', 'xlt', 'pot'); | ||
| 74 | + if(in_array($fileType, $types)){ | ||
| 75 | + return false; | ||
| 76 | + } | ||
| 77 | + } | ||
| 78 | + | ||
| 71 | // taken from the original list of accepted types in the pdf generator action | 79 | // taken from the original list of accepted types in the pdf generator action |
| 72 | $mime_types = array(); | 80 | $mime_types = array(); |
| 73 | $mime_types[] = 'text/plain'; | 81 | $mime_types[] = 'text/plain'; |
| @@ -82,33 +90,33 @@ class thumbnailGenerator extends BaseProcessor | @@ -82,33 +90,33 @@ class thumbnailGenerator extends BaseProcessor | ||
| 82 | 90 | ||
| 83 | // Star Office | 91 | // Star Office |
| 84 | $mime_types[] = 'application/vnd.sun.xml.writer'; | 92 | $mime_types[] = 'application/vnd.sun.xml.writer'; |
| 85 | - $mime_types[] = 'application/vnd.sun.xml.writer.template'; | 93 | + //$mime_types[] = 'application/vnd.sun.xml.writer.template'; |
| 86 | $mime_types[] = 'application/vnd.sun.xml.calc'; | 94 | $mime_types[] = 'application/vnd.sun.xml.calc'; |
| 87 | - $mime_types[] = 'application/vnd.sun.xml.calc.template'; | 95 | + //$mime_types[] = 'application/vnd.sun.xml.calc.template'; |
| 88 | $mime_types[] = 'application/vnd.sun.xml.draw'; | 96 | $mime_types[] = 'application/vnd.sun.xml.draw'; |
| 89 | - $mime_types[] = 'application/vnd.sun.xml.draw.template'; | 97 | + //$mime_types[] = 'application/vnd.sun.xml.draw.template'; |
| 90 | $mime_types[] = 'application/vnd.sun.xml.impress'; | 98 | $mime_types[] = 'application/vnd.sun.xml.impress'; |
| 91 | - $mime_types[] = 'application/vnd.sun.xml.impress.template'; | 99 | + //$mime_types[] = 'application/vnd.sun.xml.impress.template'; |
| 92 | 100 | ||
| 93 | // Open Office | 101 | // Open Office |
| 94 | $mime_types[] = 'application/vnd.oasis.opendocument.text'; | 102 | $mime_types[] = 'application/vnd.oasis.opendocument.text'; |
| 95 | - $mime_types[] = 'application/vnd.oasis.opendocument.text-template'; | 103 | + //$mime_types[] = 'application/vnd.oasis.opendocument.text-template'; |
| 96 | $mime_types[] = 'application/vnd.oasis.opendocument.graphics'; | 104 | $mime_types[] = 'application/vnd.oasis.opendocument.graphics'; |
| 97 | - $mime_types[] = 'application/vnd.oasis.opendocument.graphics-template'; | 105 | + //$mime_types[] = 'application/vnd.oasis.opendocument.graphics-template'; |
| 98 | $mime_types[] = 'application/vnd.oasis.opendocument.presentation'; | 106 | $mime_types[] = 'application/vnd.oasis.opendocument.presentation'; |
| 99 | - $mime_types[] = 'application/vnd.oasis.opendocument.presentation-template'; | 107 | + //$mime_types[] = 'application/vnd.oasis.opendocument.presentation-template'; |
| 100 | $mime_types[] = 'application/vnd.oasis.opendocument.spreadsheet'; | 108 | $mime_types[] = 'application/vnd.oasis.opendocument.spreadsheet'; |
| 101 | - $mime_types[] = 'application/vnd.oasis.opendocument.spreadsheet-template'; | 109 | + //$mime_types[] = 'application/vnd.oasis.opendocument.spreadsheet-template'; |
| 102 | 110 | ||
| 103 | // OO3 | 111 | // OO3 |
| 104 | // Office 2007 | 112 | // Office 2007 |
| 105 | $mime_types[] = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'; | 113 | $mime_types[] = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'; |
| 106 | - $mime_types[] = 'application/vnd.openxmlformats-officedocument.wordprocessingml.template'; | ||
| 107 | - $mime_types[] = 'application/vnd.openxmlformats-officedocument.presentationml.template'; | ||
| 108 | - $mime_types[] = 'application/vnd.openxmlformats-officedocument.presentationml.slideshow'; | 114 | + //$mime_types[] = 'application/vnd.openxmlformats-officedocument.wordprocessingml.template'; |
| 115 | + //$mime_types[] = 'application/vnd.openxmlformats-officedocument.presentationml.template'; | ||
| 116 | + //$mime_types[] = 'application/vnd.openxmlformats-officedocument.presentationml.slideshow'; | ||
| 109 | $mime_types[] = 'application/vnd.openxmlformats-officedocument.presentationml.presentation'; | 117 | $mime_types[] = 'application/vnd.openxmlformats-officedocument.presentationml.presentation'; |
| 110 | $mime_types[] = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'; | 118 | $mime_types[] = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'; |
| 111 | - $mime_types[] = 'application/vnd.openxmlformats-officedocument.spreadsheetml.template'; | 119 | + //$mime_types[] = 'application/vnd.openxmlformats-officedocument.spreadsheetml.template'; |
| 112 | 120 | ||
| 113 | // In addition PDF files are also supported | 121 | // In addition PDF files are also supported |
| 114 | $mime_types[] = 'application/pdf'; | 122 | $mime_types[] = 'application/pdf'; |