Skip to content

Commit

Permalink
query decoding bug fix (thanks @fongandrew) closes #12
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbutler committed Feb 12, 2017
1 parent b781759 commit 61f4395
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 31 deletions.
72 changes: 48 additions & 24 deletions .versions
Original file line number Diff line number Diff line change
@@ -1,24 +1,48 @@
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
iron:[email protected]
iron:[email protected]
[email protected]_2
[email protected]
local-test:iron:[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]_1
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
iron:[email protected]
iron:[email protected]
[email protected]
local-test:iron:[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]_1
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
4 changes: 4 additions & 0 deletions History.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
v1.1.1 / 2017-02-12
==================
* Query param bugfix (urlencoded '%' character)

v1.0.11 / 2015-10-09
==================
* Support Meteor 1.2
10 changes: 5 additions & 5 deletions lib/url.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,12 @@ Url.fromQueryString = function (query) {

_.each(keyValuePairs, function (pair) {
var parts = pair.split('=');
var key = parts[0];
var key = safeDecodeURIComponent(parts[0]);
var value = safeDecodeURIComponent(parts[1]);

if (key.slice(-2) === '[]') {
if (typeof key !== 'undefined' &&
typeof value !== 'undefined' &&
key.slice(-2) === '[]') {
key = key.slice(0, -2);
result[key] = result[key] || [];
result[key].push(value);
Expand Down Expand Up @@ -283,9 +285,7 @@ Url.prototype.params = function (path) {
params.push(value);
}

path = safeDecodeURI(path);

if (typeof path !== 'undefined') {
if (typeof safeDecodeURI(path) !== 'undefined') {
queryString = path.split('?')[1];
if (queryString)
queryString = queryString.split('#')[0];
Expand Down
4 changes: 2 additions & 2 deletions package.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
Package.describe({
name: 'iron:url',
summary: 'Url utilities and support for compiling a url into a regular expression.',
version: '1.0.11',
version: '1.1.0',
git: 'https://github.com/iron-meteor/iron-url'
});

Package.on_use(function (api) {
api.versionsFrom('[email protected]');

api.use('underscore');

api.use('iron:[email protected]');
Expand Down

0 comments on commit 61f4395

Please sign in to comment.