Ticket #1126 (closed defect: fixed)

Opened 11 months ago

Last modified 11 months ago

Percent (%) in URL prevent stripSelfNamedAnchors from working

Reported by: guest Owned by: gogo
Priority: normal Milestone:
Component: Xinha Core Version:
Severity: normal Keywords:
Cc:

Description

If a percent (%) is contained within the QueryString?, the method fixRelativeLinks doesn't work anymore regarding to stripSelfNamedAnchors.

In fixRelativeLinks, using unescape() on the document.location before extracting the anchor name using a regular expression fixed it.

I attached two files : ticket.html that fails, and ticketfixed.html that works.

To reproduce the problem, you need to :

1) Put both html files under the examples directory of your Xinha distribution 2) Access ticket.html from your web server (NOT using file:///) with a percent in your query string, for example : http://localhost/xinha/examples/ticket.html?A%7DB

Switch to html view, then to wysiwyg, then to html view again. Your relative link will be converted to an absolute link. It should not.

Try again with ticketfixed.html and it works.

Attachments

ticket.html (2.0 kB) - added by guest 11 months ago.
Test case that fails
ticketfixed.html (3.4 kB) - added by guest 11 months ago.
Test case that is successful

Change History

Changed 11 months ago by guest

Test case that fails

Changed 11 months ago by guest

Test case that is successful

Changed 11 months ago by guest

Me again,

just to be clear :

I changed :

var _190=new RegExp?(Xinha.escapeStringForRegExp(document.location.href.replace(/&/g,"&"))+"(#['\" ]*)","g");

to

var _190=new RegExp?(Xinha.escapeStringForRegExp(unescape(document.location.href.replace(/&/g,"&")))+"(#['\" ]*)","g");

in function fixRelativeLinks,

Thanks,

Frederick Samson

Changed 11 months ago by ray

  • status changed from new to closed
  • resolution set to fixed

fixed rev [933]

Thanks for your contribution

Note: See TracTickets for help on using tickets.