Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F7139
kmlsupport.patch
Public
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Authored By
•
bzimport
Nov 21 2014, 11:16 PM
2014-11-21 23:16:33 (UTC+0)
Size
3 KB
Referenced Files
None
Subscribers
None
kmlsupport.patch
View Options
Index: includes/mime.info
===================================================================
--- includes/mime.info (revision 82013)
+++ includes/mime.info (working copy)
@@ -103,3 +103,6 @@
application/vnd.ms-excel.addin.macroEnabled.12 [OFFICE]
application/vnd.ms-excel.sheet.binary.macroEnabled.12 [OFFICE]
+application/vnd.google-earth.kml+xml [DATA]
+application/vnd.google-earth.kmz [DATA]
+
Index: includes/mime.types
===================================================================
--- includes/mime.types (revision 82013)
+++ includes/mime.types (working copy)
@@ -160,3 +160,5 @@
model/vnd.dwfx+xps dwfx
application/vnd.ms-xpsdocument xps
application/x-opc+zip docx dotx docm dotm potx ppsx pptx ppam pptm potm ppsm xlsx xltx xlsm xltm xlam xlsb dwfx xps
+application/vnd.google-earth.kml+xml kml
+application/vnd.google-earth.kmz kmz
Index: includes/DefaultSettings.php
===================================================================
--- includes/DefaultSettings.php (revision 82013)
+++ includes/DefaultSettings.php (working copy)
@@ -881,6 +881,9 @@
'http://www.lysator.liu.se/~alla/dia/:diagram' => 'application/x-dia-diagram',
'http://www.w3.org/1999/xhtml:html' => 'text/html', // application/xhtml+xml?
'html' => 'text/html', // application/xhtml+xml?
+ 'http://www.opengis.net/kml/2.1:kml' => 'application/vnd.google-earth.kml+xml',
+ 'http://www.opengis.net/kml/2.2:kml' => 'application/vnd.google-earth.kml+xml',
+ 'kml' => 'application/vnd.google-earth.kml+xml',
);
/**
Index: includes/Defines.php
===================================================================
--- includes/Defines.php (revision 82013)
+++ includes/Defines.php (working copy)
@@ -126,6 +126,7 @@
define( 'MEDIATYPE_TEXT', 'TEXT' ); // Plain text (possibly containing program code or scripts)
define( 'MEDIATYPE_EXECUTABLE', 'EXECUTABLE' ); // binary executable
define( 'MEDIATYPE_ARCHIVE', 'ARCHIVE' ); // archive file (zip, tar, etc)
+define( 'MEDIATYPE_DATA', 'DATA' ); // A generic data file (like kml and kmz)
/**@}*/
/**@{
Index: includes/upload/UploadBase.php
===================================================================
--- includes/upload/UploadBase.php (revision 82013)
+++ includes/upload/UploadBase.php (working copy)
@@ -858,6 +858,7 @@
foreach( $tags as $tag ) {
if( false !== strpos( $chunk, $tag ) ) {
+wfDebug( __METHOD__ . ": found something that may make it be mistaken for html: $tag\n" );
return true;
}
}
@@ -871,16 +872,19 @@
# look for script-types
if( preg_match( '!type\s*=\s*[\'"]?\s*(?:\w*/)?(?:ecma|java)!sim', $chunk ) ) {
+wfDebug( __METHOD__ . ": found script types\n" );
return true;
}
# look for html-style script-urls
if( preg_match( '!(?:href|src|data)\s*=\s*[\'"]?\s*(?:ecma|java)script:!sim', $chunk ) ) {
+wfDebug( __METHOD__ . ": found html-style script urls\n" );
return true;
}
# look for css-style script-urls
if( preg_match( '!url\s*\(\s*[\'"]?\s*(?:ecma|java)script:!sim', $chunk ) ) {
+wfDebug( __METHOD__ . ": found css-style script urls\n" );
return true;
}
File Metadata
Details
Attached
Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
6675
Default Alt Text
kmlsupport.patch (3 KB)
Attached To
Mode
T28059: Add support for KML/KMZ filetype
Attached
Detach File
Event Timeline
Log In to Comment