]> source.dussan.org Git - nextcloud-server.git/commitdiff
small fix for server svg mimetype detection
authorRobin Appelman <icewind@owncloud.com>
Sat, 14 Jan 2012 22:37:50 +0000 (23:37 +0100)
committerRobin Appelman <icewind@owncloud.com>
Sat, 14 Jan 2012 22:41:48 +0000 (23:41 +0100)
core/js/js.js

index 5846d2898804909c476609ee7e2ce3aece565906..2bb6cff0cb0b073b29f0e21d33b72837cc264a07 100644 (file)
@@ -191,11 +191,13 @@ SVGSupport.checkMimeType=function(){
                        $.each(headerParts,function(i,text){
                                if(text){
                                        var parts=text.split(':',2);
-                                       var value=parts[1].trim();
-                                       if(value[0]=='"'){
-                                               value=value.substr(1,value.length-2);
+                                       if(parts.length==2){
+                                               var value=parts[1].trim();
+                                               if(value[0]=='"'){
+                                                       value=value.substr(1,value.length-2);
+                                               }
+                                               headers[parts[0]]=value;
                                        }
-                                       headers[parts[0]]=value;
                                }
                        });
                        if(headers["Content-Type"]!='image/svg+xml'){