Index: trunk/phase3/includes/upload/UploadBase.php |
— | — | @@ -857,6 +857,7 @@ |
858 | 858 | |
859 | 859 | foreach( $tags as $tag ) { |
860 | 860 | if( false !== strpos( $chunk, $tag ) ) { |
| 861 | + wfDebug( __METHOD__ . ": found something that may make it be mistaken for html: $tag\n" ); |
861 | 862 | return true; |
862 | 863 | } |
863 | 864 | } |
— | — | @@ -870,16 +871,19 @@ |
871 | 872 | |
872 | 873 | # look for script-types |
873 | 874 | if( preg_match( '!type\s*=\s*[\'"]?\s*(?:\w*/)?(?:ecma|java)!sim', $chunk ) ) { |
| 875 | + wfDebug( __METHOD__ . ": found script types\n" ); |
874 | 876 | return true; |
875 | 877 | } |
876 | 878 | |
877 | 879 | # look for html-style script-urls |
878 | 880 | if( preg_match( '!(?:href|src|data)\s*=\s*[\'"]?\s*(?:ecma|java)script:!sim', $chunk ) ) { |
| 881 | + wfDebug( __METHOD__ . ": found html-style script urls\n" ); |
879 | 882 | return true; |
880 | 883 | } |
881 | 884 | |
882 | 885 | # look for css-style script-urls |
883 | 886 | if( preg_match( '!url\s*\(\s*[\'"]?\s*(?:ecma|java)script:!sim', $chunk ) ) { |
| 887 | + wfDebug( __METHOD__ . ": found css-style script urls\n" ); |
884 | 888 | return true; |
885 | 889 | } |
886 | 890 | |
Index: trunk/phase3/includes/Defines.php |
— | — | @@ -126,6 +126,7 @@ |
127 | 127 | define( 'MEDIATYPE_TEXT', 'TEXT' ); // Plain text (possibly containing program code or scripts) |
128 | 128 | define( 'MEDIATYPE_EXECUTABLE', 'EXECUTABLE' ); // binary executable |
129 | 129 | define( 'MEDIATYPE_ARCHIVE', 'ARCHIVE' ); // archive file (zip, tar, etc) |
| 130 | +define( 'MEDIATYPE_DATA', 'DATA' ); // A generic data file (like kml and kmz) |
130 | 131 | /**@}*/ |
131 | 132 | |
132 | 133 | /**@{ |
Index: trunk/phase3/includes/mime.types |
— | — | @@ -161,3 +161,5 @@ |
162 | 162 | model/vnd.dwfx+xps dwfx |
163 | 163 | application/vnd.ms-xpsdocument xps |
164 | 164 | application/x-opc+zip docx dotx docm dotm potx ppsx pptx ppam pptm potm ppsm xlsx xltx xlsm xltm xlam xlsb dwfx xps |
| 165 | +application/vnd.google-earth.kml+xml kml |
| 166 | +application/vnd.google-earth.kmz kmz |
Index: trunk/phase3/includes/DefaultSettings.php |
— | — | @@ -881,6 +881,9 @@ |
882 | 882 | 'http://www.lysator.liu.se/~alla/dia/:diagram' => 'application/x-dia-diagram', |
883 | 883 | 'http://www.w3.org/1999/xhtml:html' => 'text/html', // application/xhtml+xml? |
884 | 884 | 'html' => 'text/html', // application/xhtml+xml? |
| 885 | + 'http://www.opengis.net/kml/2.1:kml' => 'application/vnd.google-earth.kml+xml', |
| 886 | + 'http://www.opengis.net/kml/2.2:kml' => 'application/vnd.google-earth.kml+xml', |
| 887 | + 'kml' => 'application/vnd.google-earth.kml+xml', |
885 | 888 | ); |
886 | 889 | |
887 | 890 | /** |
Index: trunk/phase3/includes/mime.info |
— | — | @@ -102,6 +102,6 @@ |
103 | 103 | application/vnd.ms-excel.template.macroEnabled.12 [OFFICE] |
104 | 104 | application/vnd.ms-excel.addin.macroEnabled.12 [OFFICE] |
105 | 105 | application/vnd.ms-excel.sheet.binary.macroEnabled.12 [OFFICE] |
106 | | - |
107 | 106 | application/acad application/x-acad application/autocad_dwg image/x-dwg application/dwg application/x-dwg application/x-autocad image/vnd.dwg drawing/dwg [DRAWING] |
108 | | - |
| 107 | +application/vnd.google-earth.kml+xml [DATA] |
| 108 | +application/vnd.google-earth.kmz [DATA] |