I have a javascript tab library I've been using that's always been fine, but with our recent upgrade of Fortify, we're getting a critical error on the window.location section of the code (edit, should have mentioned that this is the original code, before being modified):
var b=window.location.href;
Our first modification was:
var b = (escape(window.location.href.toString()));
When that failed, we found and tried the following:
var b = (encodeID(window.location.href.toString()));
function encodeID(s) {
if (s==='') return '_';
return s.replace(/[^a-zA-Z0-9.-]/g, function(match) {
return '_'+match[0].charCodeAt(0).toString(16)+'_';
});
}
but another run of Fortify still throws the critical error. Also tried:
var b=encodeURIComponent(window.location.href);
Still critical.
Anyone have any thoughts on getting it to pass?