[Mapbender-commits] r10384 - in trunk/mapbender/http: javascripts plugins

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Mon Jan 13 05:38:46 PST 2020


Author: hollsandre
Date: 2020-01-13 05:38:44 -0800 (Mon, 13 Jan 2020)
New Revision: 10384

Modified:
   trunk/mapbender/http/javascripts/mod_savewmc.js
   trunk/mapbender/http/plugins/kmlTree.php
Log:
allowed some more character in regex


Modified: trunk/mapbender/http/javascripts/mod_savewmc.js
===================================================================
--- trunk/mapbender/http/javascripts/mod_savewmc.js	2020-01-02 08:02:38 UTC (rev 10383)
+++ trunk/mapbender/http/javascripts/mod_savewmc.js	2020-01-13 13:38:44 UTC (rev 10384)
@@ -112,7 +112,7 @@
 String.prototype.hashCode = function() {
 
     if (Array.prototype.reduce) {
-        return this.split("").reduce(function(a,b){a=((a<<5)-a)+b.charCodeAt(0);return a&a},0);   
+        return this.split("").reduce(function(a,b){a=((a<<5)-a)+b.charCodeAt(0);return a&a},0);
     } else {
 
         var hash = 0, i, chr, len;
@@ -194,13 +194,13 @@
                     mb_mapObj[0].kmlOrder = null;
                 }
             }
-		//***** 
+		//*****
 		var mapObjWithoutHistory = mb_mapObj;
-		//set history and hash itself to null to identify same object and store the hash in a special field 
+		//set history and hash itself to null to identify same object and store the hash in a special field
 		mapObjWithoutHistory[0].mb_MapHistoryObj = null;
 		that.mapObjHashWithoutHistory = $.toJSON(mapObjWithoutHistory).hashCode();
 		//*****
-		//send mapObj without 
+		//send mapObj without
 	    	var mapObjectToSend = $.toJSON(mb_mapObj);
 		//if compression is demanded see http://rosettacode.org/wiki/LZW_compression#JavaScript
 		if (beLzwCompressed == 'true') { //
@@ -362,8 +362,8 @@
 			attributes.isoTopicCat = isoTopicCat;
 
 			if(attributes.title != ""){
-				if(!attributes.title.match(/^[a-zA-Z0-9\säöüÄÖÜß_\-]+$/)){
-                               		alert("Allowed characters for title are: A-Z, a-z, 0-9, -, _");
+				if(!attributes.title.match(/^[a-zA-Z0-9äöüÄÖÜß_\- \"§&()?:,=/\s\\r\\n\\t]+$/)){
+                               		alert("Allowed characters for title are: A-Z, a-z, 0-9, -, _, äA, öO, üU, ß, \", , , =, /, &, §, (), : ");
                                		return;
                         	}
 			}else{
@@ -372,16 +372,16 @@
 			}
 
 			if(attributes.abstract != ""){
-				if(!attributes.abstract.match(/^[a-zA-Z0-9\säöüÄÖÜß_\-]+$/)){
-                               		alert("Allowed characters for abstract are: A-Z, a-z, 0-9, -, _");
+				if(!attributes.abstract.match(/^[a-zA-Z0-9äöüÄÖÜß_\- \"§&()?:,=/\s\\r\\n\\t]+$/)){
+                               		alert("Allowed characters for abstract are: A-Z, a-z, 0-9, -, _, äA, öO, üU, ß, \", , , =, /, &, §, (), : ");
                                		return;
 				}
-			}	
+			}
 
 
 			if(attributes.keywords != ""){
-				if(!attributes.keywords.match(/^[a-zA-Z0-9\säöüÄÖÜß_\-]+$/)){
-                               		alert("Allowed characters for keywords are: A-Z, a-z, 0-9, -, _");
+				if(!attributes.keywords.match(/^[a-zA-Z0-9äöüÄÖÜß_\- \"§&()?:,=/\s\\r\\n\\t]+$/)){
+                               		alert("Allowed characters for keywords are: A-Z, a-z, 0-9, -, _, äA, öO, üU, ß, \", , , =, /, &, §, (), : ");
                                		return;
 				}
 			}

Modified: trunk/mapbender/http/plugins/kmlTree.php
===================================================================
--- trunk/mapbender/http/plugins/kmlTree.php	2020-01-02 08:02:38 UTC (rev 10383)
+++ trunk/mapbender/http/plugins/kmlTree.php	2020-01-13 13:38:44 UTC (rev 10384)
@@ -569,8 +569,8 @@
                 var version = 'v1'
                 if (title == '') {
                     return;
-                } else if (!title.match(/^[a-zA-Z0-9-_]+$/)){
-			alert("Allowed characters are: A-Z, a-z, 0-9, -, _");
+                } else if (!title.match(/^[a-zA-Z0-9äöüÄÖÜß_\- \"§&()?:,=/\s\\r\\n\\t]+$/)){
+			alert("Allowed characters for title are: A-Z, a-z, 0-9, -, _, äA, öO, üU, ß, \", , , =, /, &, §, (), : ");
 			return;
 		}
                 kml.addLayer(title, {
@@ -875,7 +875,7 @@
     var featureInfoFilter = ['title', 'marker-size', 'marker-symbol', 'marker-color',
         'marker-offset-x', 'marker-offset-y', 'stroke', 'stroke-opacity',
         'stroke-width', 'fill', 'fill-opacity'];
-    
+
     function escapeHTML(text) {
         return text
                 .toString()
@@ -886,7 +886,7 @@
                 .replace(/'/g, '&#x27;')
                 .replace(/\//g, '&#x2F;');
     }
-    
+
     function createFeatureInfoContent(props) {
         var $table = $("<table>")
                 .attr("border", 1);
@@ -900,7 +900,7 @@
         }
         return $table.attr('outerHTML');
     }
-    
+
     this.getFeatureInfos = function (click) {
         var map = Mapbender.modules.mapframe1;
         var kml = $('#mapframe1').data('kml');
@@ -912,7 +912,7 @@
                     content: createFeatureInfoContent(kmlLayer.data.features[locator.id].properties)
                 }
             });
-    };  
+    };
 };
 
 Mapbender.events.init.register(function() {



More information about the Mapbender_commits mailing list