From 63f8ca8d3fe1e3b52e079e41b29c85d14376f261 Mon Sep 17 00:00:00 2001 From: Matthew Somerville Date: Thu, 21 Jun 2018 10:29:02 +0100 Subject: Use CSV escaping for categories in URLs. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Categories could contain commas, so splitting on comma is not good enough. Let’s escape the fields as if it’s a line in CSV. Fixes #2166. --- web/js/map-OpenLayers.js | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'web/js/map-OpenLayers.js') diff --git a/web/js/map-OpenLayers.js b/web/js/map-OpenLayers.js index 8f84e5c94..645e5114e 100644 --- a/web/js/map-OpenLayers.js +++ b/web/js/map-OpenLayers.js @@ -15,6 +15,18 @@ var fixmystreet = fixmystreet || {}; fixmystreet.utils = fixmystreet.utils || {}; $.extend(fixmystreet.utils, { + array_to_csv_line: function(arr) { + var out = [], s; + for (var i=0; i