Fixes a JS error that came in as part of #3760.

pull/3346/head
James Phillips 7 years ago
parent a9436bb0ec
commit b81b078463
No known key found for this signature in database
GPG Key ID: 77183E682AC5FC11

@ -132,13 +132,20 @@ App.Key = Ember.Object.extend(Ember.Validations.Mixin, {
// Boolean if the value is valid
valueValid: Ember.computed.empty('errors.Value'),
// Escape any user-entered parts that aren't URL-safe, but put slashes back since
// they are common in keys, and the UI lets users make "folders" by simply adding
// them to keys.
// Escape any user-entered parts that aren't URL-safe, but put slashes back since
// they are common in keys, and the UI lets users make "folders" by simply adding
// them to keys.
Key: function(key, value) {
// setter
if (arguments.length > 1) {
clean = encodeURIComponent(decodeURIComponent(value)).replace(/%2F/g, "/")
clean = value
try {
clean = decodeURIComponent(clean);
} catch (e) {
// If they've got something that's not valid URL syntax then keep going;
// this means that at worst we might end up double escaping some things.
}
clean = encodeURIComponent(clean).replace(/%2F/g, "/")
this.set('cleanKey', clean);
return clean;
}

Loading…
Cancel
Save