diff --git a/jsts/jst_prefix.js b/jsts/jst_prefix.js index 7934fe6..412fc0d 100644 --- a/jsts/jst_prefix.js +++ b/jsts/jst_prefix.js @@ -228,11 +228,11 @@ if(postData) var postValues = postData.split('&'); for(var i = 0; i < postValues.length; ++i) { - var postValue = postValues[i].split('='); - if(postValue.length == 2) + var eqIdx = postValues[i].indexOf('='); + if(eqIdx != -1) { - var value = postValue[1].replace(/[+]/g," "); - $_POST[postValue[0]] = decodeURIComponent(value); + var value = postValues[i].substring(eqIdx + 1).replace(/[+]/g," "); + $_POST[postValues[i].substring(0, eqIdx)] = decodeURIComponent(value); } else { @@ -254,17 +254,17 @@ if(filesData) var fileId = null; for(var j = 0; j < fileData.length; ++j) { - var fileValue = fileData[j].split('='); - if(fileValue.length == 2) + var eqIdx = fileData[j].indexOf('='); + if(eqIdx != -1) { if(!fileId) { - fileId = decodeURIComponent(fileValue[1]); + fileId = decodeURIComponent(fileData[j].substring(eqIdx + 1)); $_FILES[fileId]={}; } else { - $_FILES[fileId][decodeURIComponent(fileValue[0])]=decodeURIComponent(fileValue[1]); + $_FILES[fileId][decodeURIComponent(fileData[j].substring(0, eqIdx))]=decodeURIComponent(fileData[j].substring(eqIdx + 1)); } } else @@ -283,10 +283,10 @@ $_GET= (function () var ar = qs.split('&'); for(var i=0; i