Skip to content
Snippets Groups Projects
Commit 20d784f6 authored by Chris Hallberg's avatar Chris Hallberg
Browse files

deparam js fix: return empty array when no parameters exist in URL.

parent c06beb7b
Branches
Tags
No related merge requests found
...@@ -50,6 +50,9 @@ function html_entity_decode(string, quote_style) ...@@ -50,6 +50,9 @@ function html_entity_decode(string, quote_style)
// Turn GET string into array // Turn GET string into array
function deparam(url) { function deparam(url) {
if(!url.match(/\?/)) {
return [];
}
var request = {}; var request = {};
var pairs = url.substring(url.indexOf('?') + 1).split('&'); var pairs = url.substring(url.indexOf('?') + 1).split('&');
for (var i = 0; i < pairs.length; i++) { for (var i = 0; i < pairs.length; i++) {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment