Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions jsts/jst_prefix.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -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
Expand All @@ -283,10 +283,10 @@ $_GET= (function ()
var ar = qs.split('&');
for(var i=0; i<ar.length; ++i)
{
var ar2 = ar[i].split('=');
if(ar2.length != 2)
var eqIdx = ar[i].indexOf('=');
if(eqIdx == -1)
throw Error("$_GET: Invalid QUERY_STRING");
out[ar2[0]] = ar2[1];
out[ar[i].substring(0, eqIdx)] = ar[i].substring(eqIdx + 1);
}
}
return out;
Expand Down
24 changes: 12 additions & 12 deletions tests/parser/jst_parser_backslash.jst.parsed
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -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
Expand All @@ -281,12 +281,12 @@ $_GET= (function ()
if(qs)
{
var ar = qs.split('&');
for(var i=0; i<ar.length; ++i)
for(var i=0;i<ar.length;++i)
{
var ar2 = ar[i].split('=');
if(ar2.length != 2)
var eqIdx = ar[i].indexOf('=');
if(eqIdx == -1)
throw Error("$_GET: Invalid QUERY_STRING");
out[ar2[0]] = ar2[1];
out[ar[i].substring(0, eqIdx)] = ar[i].substring(eqIdx + 1);
}
}
return out;
Expand Down
24 changes: 12 additions & 12 deletions tests/parser/jst_parser_comment_tag.jst.parsed
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -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
Expand All @@ -281,12 +281,12 @@ $_GET= (function ()
if(qs)
{
var ar = qs.split('&');
for(var i=0; i<ar.length; ++i)
for(var i=0;i<ar.length;++i)
{
var ar2 = ar[i].split('=');
if(ar2.length != 2)
var eqIdx = ar[i].indexOf('=');
if(eqIdx == -1)
throw Error("$_GET: Invalid QUERY_STRING");
out[ar2[0]] = ar2[1];
out[ar[i].substring(0, eqIdx)] = ar[i].substring(eqIdx + 1);
}
}
return out;
Expand Down
24 changes: 12 additions & 12 deletions tests/parser/jst_parser_include_code_after.jst.parsed
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -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
Expand All @@ -281,12 +281,12 @@ $_GET= (function ()
if(qs)
{
var ar = qs.split('&');
for(var i=0; i<ar.length; ++i)
for(var i=0;i<ar.length;++i)
{
var ar2 = ar[i].split('=');
if(ar2.length != 2)
var eqIdx = ar[i].indexOf('=');
if(eqIdx == -1)
throw Error("$_GET: Invalid QUERY_STRING");
out[ar2[0]] = ar2[1];
out[ar[i].substring(0, eqIdx)] = ar[i].substring(eqIdx + 1);
}
}
return out;
Expand Down
24 changes: 12 additions & 12 deletions tests/parser/jst_parser_include_code_before.jst.parsed
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -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
Expand All @@ -281,12 +281,12 @@ $_GET= (function ()
if(qs)
{
var ar = qs.split('&');
for(var i=0; i<ar.length; ++i)
for(var i=0;i<ar.length;++i)
{
var ar2 = ar[i].split('=');
if(ar2.length != 2)
var eqIdx = ar[i].indexOf('=');
if(eqIdx == -1)
throw Error("$_GET: Invalid QUERY_STRING");
out[ar2[0]] = ar2[1];
out[ar[i].substring(0, eqIdx)] = ar[i].substring(eqIdx + 1);
}
}
return out;
Expand Down
24 changes: 12 additions & 12 deletions tests/parser/jst_parser_include_malformed_1.jst.parsed
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -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
Expand All @@ -281,12 +281,12 @@ $_GET= (function ()
if(qs)
{
var ar = qs.split('&');
for(var i=0; i<ar.length; ++i)
for(var i=0;i<ar.length;++i)
{
var ar2 = ar[i].split('=');
if(ar2.length != 2)
var eqIdx = ar[i].indexOf('=');
if(eqIdx == -1)
throw Error("$_GET: Invalid QUERY_STRING");
out[ar2[0]] = ar2[1];
out[ar[i].substring(0, eqIdx)] = ar[i].substring(eqIdx + 1);
}
}
return out;
Expand Down
24 changes: 12 additions & 12 deletions tests/parser/jst_parser_include_nested.jst.parsed
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -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
Expand All @@ -281,12 +281,12 @@ $_GET= (function ()
if(qs)
{
var ar = qs.split('&');
for(var i=0; i<ar.length; ++i)
for(var i=0;i<ar.length;++i)
{
var ar2 = ar[i].split('=');
if(ar2.length != 2)
var eqIdx = ar[i].indexOf('=');
if(eqIdx == -1)
throw Error("$_GET: Invalid QUERY_STRING");
out[ar2[0]] = ar2[1];
out[ar[i].substring(0, eqIdx)] = ar[i].substring(eqIdx + 1);
}
}
return out;
Expand Down
Loading
Loading