Skip to content

Commit

Permalink
fixed another XSS issue
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelschwarz committed Dec 22, 2021
1 parent aa9b7a3 commit c89e39b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion AjaxPro/Utilities/Constant.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,6 @@ public sealed class Constant
/// <summary>
/// The assembly version.
/// </summary>
public const string AssemblyVersion = "21.12.21.2";
public const string AssemblyVersion = "21.12.22.1";
}
}
12 changes: 4 additions & 8 deletions AjaxPro/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ Object.extend(AjaxPro, {
var d = date.match(/Date\((.*?)\)/)[1];
return "new Date(" + parseInt(d) + ")";
}
else { // ISO Date 2007-12-31T23:59:59Z
/*else { // ISO Date 2007-12-31T23:59:59Z
var matches = date.split(/[-,:,T,Z]/);
if (matches.length == 7) {
matches[1] = (parseInt(matches[1], 0) - 1).toString();
Expand All @@ -194,21 +194,17 @@ Object.extend(AjaxPro, {
s += ",";
}
s += parseInt(matches[i], 10);
console.log(s);
}
if (isDate) {
return "new Date(Date.UTC(" + s + "))";
}
}
}
}*/
return str;
},
parse: function (text) {
// not yet possible as we still return new type() JSON
// if (!(!(/[^,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]/.test(
// text.replace(/"(\\.|[^"\\])*"/g, ''))) ))
// throw new Error("Invalid characters in JSON parse string.");
var regEx = /(\"\d{4}-\d{2}-\d{2}T\d{2}:\d{2}.*?\")|(\"\\\/Date\(.*?\)\\\/")/g;
text = text.replace(regEx, this.regExDate);
text = text.replace(/(\"\\\/Date\(\d+\)\\\/")/g, this.regExDate);
return eval('(' + text + ')');
},
m: {
Expand Down

0 comments on commit c89e39b

Please sign in to comment.