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 | 93 | // 'odp', 'otp', 'sxi', 'sti', 'ppt', 'pot', 'sxd', 'odg', |
| 94 | 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 | 104 | // taken from the original list of accepted types in the pdf generator action |
| 97 | 105 | $mime_types = array(); |
| 98 | 106 | $mime_types[] = 'text/plain'; |
| ... | ... | @@ -107,33 +115,33 @@ class pdfConverter extends BaseProcessor |
| 107 | 115 | |
| 108 | 116 | // Star Office |
| 109 | 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 | 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 | 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 | 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 | 126 | // Open Office |
| 119 | 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 | 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 | 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 | 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 | 136 | /* OO3 */ |
| 129 | 137 | // Office 2007 |
| 130 | 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 | 142 | $mime_types[] = 'application/vnd.openxmlformats-officedocument.presentationml.presentation'; |
| 135 | 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 | 147 | return $mime_types; | ... | ... |
plugins/thumbnails/thumbnails.php
| ... | ... | @@ -68,6 +68,14 @@ class thumbnailGenerator extends BaseProcessor |
| 68 | 68 | // 'odp', 'otp', 'sxi', 'sti', 'ppt', 'pot', 'sxd', 'odg', |
| 69 | 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 | 79 | // taken from the original list of accepted types in the pdf generator action |
| 72 | 80 | $mime_types = array(); |
| 73 | 81 | $mime_types[] = 'text/plain'; |
| ... | ... | @@ -82,33 +90,33 @@ class thumbnailGenerator extends BaseProcessor |
| 82 | 90 | |
| 83 | 91 | // Star Office |
| 84 | 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 | 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 | 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 | 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 | 101 | // Open Office |
| 94 | 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 | 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 | 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 | 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 | 111 | // OO3 |
| 104 | 112 | // Office 2007 |
| 105 | 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 | 117 | $mime_types[] = 'application/vnd.openxmlformats-officedocument.presentationml.presentation'; |
| 110 | 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 | 121 | // In addition PDF files are also supported |
| 114 | 122 | $mime_types[] = 'application/pdf'; | ... | ... |