kmz_compressor 2.2.0 → 2.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: e0dec3407ff226655aa0aa6a608d3e1a0dc67436
4
- data.tar.gz: 502c8a5dbabe34988e8c8efa80302808d699f088
2
+ SHA256:
3
+ metadata.gz: '0285357fa92cfc382325fb2571dee9fb9d07014253c50b13fa4013f5f4895f2c'
4
+ data.tar.gz: b46dc5a57ec53f34e5a78f2c6d656832402707994128f73afec9396fc5870694
5
5
  SHA512:
6
- metadata.gz: 90ccc96b7c12f0b458f3438a1ccd17633f8d8cb77edc8055d3c7e4ea0efeb071d0e8843e502be7d5d7e961e496e34f8fc02b545e1e308672acd08938f55d4685
7
- data.tar.gz: 26bb0ba0e26bd3021d3726575507bc79a006109a9dde859366a8b328fb647a2a4aabf3869a68d53fcd9905dfb76a70e61029a7d2e8674860dfb724f8adbabba9
6
+ metadata.gz: 372278c020ec26c3b92b571be27df158c62eccccabc64971e8b34852e2dffbb3380a12efe35625dff970dcd91b1d1b3284f1a2ee419aa2ae0f3c9e54c8871a9e
7
+ data.tar.gz: 5e56612ba29b9527e38ae18012739bcff3ab35c22072750ac4698827215925e2625d41808ebd74d26b8a01a4fd2a004372e05714786099777724e1122e994af4
@@ -34,7 +34,6 @@ window.MapLayerManager = function(map){
34
34
  }
35
35
 
36
36
  function loadKMLLayer(kmlURL, layerName, options) {
37
- // Replace spaces with pluses so we don't have problems with some things turning them into %20s and some not
38
37
  kmlURL = sanitizeURI(kmlURL);
39
38
  options = jQuery.extend(true, {zIndex:getDrawOrder(layerName), map:map}, options);
40
39
 
@@ -269,28 +268,34 @@ window.MapLayerManager = function(map){
269
268
  })
270
269
  }
271
270
 
272
- // Replace spaces with pluses so we don't have problems with some things turning them into %20s and some not
273
- // Matches the middleware process
274
- function sanitizeURI(uri){
271
+ function sanitizeURI(uri) {
275
272
  var url = urlToObject(uri)
276
- var pathname = ('/' + decodeURI(url.pathname)).replace(/^\/+/, '/').trim() // Ensure there is a leading slash (IE doesn't provide one, Chrome does, FF does)
277
- var search = decodeURIComponent(url.search.replace(/\+/g, '%20')).trim().replace(/^\?/, '') // Ensure all "plus spaces" are hex encoded spaces
273
+ var pathname = ('/' + decodeURI(url.pathname)).replace(/^\/+/, '/').trim() // Ensure there is a leading slash (IE doesn't provide one, Chrome does, FF does)
278
274
 
279
- output = pathname
275
+ var search = url.search.replace(/%26/g, '%2526').replace(/%3D/g, '%253D') // Double encode & and = or else we will be unable to tell them apart from unencoded ones
276
+ search = search.replace(/\+/g, '%20') // Ensure all "plus spaces" are hex encoded spaces
277
+ search = decodeURIComponent(search).trim().replace(/^\?/, '') // Remove any leading ?
280
278
 
281
- if (search !== ''){
282
- output += '?'
283
- }
279
+ output = pathname
280
+ if (search !== '') { output += '?' }
284
281
 
285
282
  // Encode the individual uri components
286
283
  output += $.map(search.split('&'), function(component){
287
284
  return $.map(component.split('='), function(kv){
285
+ // Unencode double encoded & and = from earlier
286
+ kv = kv.replace(/%26/g, '&').replace(/%3D/g, '=')
287
+
288
+ kv = encodeURIComponent(kv)
289
+
288
290
  // HACK: Firefox 'helps' us out by encoding apostrophes as %27 in AJAX requests, However its encodeURIcomponent method
289
291
  // does not. This difference causes a mismatch between the url we use to calculate the cache path in the browser
290
292
  // and on the server. This hack undoes the damage. See https://bugzilla.mozilla.org/show_bug.cgi?id=407172
291
- return encodeURIComponent(kv).replace(/'/g, '%27')
293
+ kv = kv.replace(/'/g, '%27')
294
+
295
+ return kv
292
296
  }).join('=')
293
297
  }).join('&')
298
+
294
299
  url.href = output
295
300
 
296
301
  return url.href
@@ -1,3 +1,3 @@
1
1
  module KMZCompressor
2
- VERSION = "2.2.0"
2
+ VERSION = "2.2.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kmz_compressor
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Wallace
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-09-09 00:00:00.000000000 Z
12
+ date: 2018-09-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -78,7 +78,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
78
78
  version: '0'
79
79
  requirements: []
80
80
  rubyforge_project:
81
- rubygems_version: 2.6.12
81
+ rubygems_version: 2.7.5
82
82
  signing_key:
83
83
  specification_version: 4
84
84
  summary: Rack Middleware which retrieves KML from Rails and produces KMZ for the client.