Try our conversational search powered by Generative AI!

FriendlyUrlRewriteProvider seem to modify javascript

Vote:
 

Hi,

I'm having some trouble with what seems to be FriendlyUrlRewriteProvider and an embeded javascript resource in a third party component.

The problem is that url rewriting seem to be replacing parts of the javascript. The original script looks like this:

resultLink.innerHTML = this._linkText.value.replace(/&/gi, "&").replace(/</gi, "<").replace(/>/gi, ">");

 

But when using the FriendlyUrlRewriteProvider, the same javascript is replaced with:

resultLink.innerHTML = this._linkText.value.replace(/&/gi, "&").replace(/</gi,>gi, ">");

    

I even tried putting the javascript in a vanilla CMS 6 R2 site using the Alloy Tech templates like this:

'foobar'.replace(/&/gi, "&").replace(/</gi, "<").replace(/>/gi, ">");

And the same thing is happening.

Using the NullUrlRewriteProvider, the javascript is working.

Is there any way I can get the FriendlyUrlRewriteProvider to ignore the javascript?

Regards,
Christofer

#75201
Sep 20, 2013 10:48
Vote:
 

The problem is most likely not the rewriter in this case but the HTML parser used under the hood that parses the HTML, and that one is much harder to have ignore something. You can drop a support case to Developer Support to get a bug report in.

#75541
Sep 27, 2013 17:16
Vote:
 

Hi,

 

One way to get around this, is to serve the script from a handler and with a content type that the HTML parser module doesn't pick up.

#75547
Sep 27, 2013 22:27
Vote:
 

Per, I'll do that.

Johan. Good point, unfortunately in this case the script is an embeded resource from a third party vendor.

Thank you both!

#75620
Oct 01, 2013 14:02
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.