Opened 9 years ago

Closed 9 years ago

#1126 closed defect (fixed)

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 (2)

ticket.html (2.0 KB) - added by guest 9 years ago.
Test case that fails
ticketfixed.html (3.4 KB) - added by guest 9 years ago.
Test case that is successful

Download all attachments as: .zip

Change History (4)

Changed 9 years ago by guest

Test case that fails

Changed 9 years ago by guest

Test case that is successful

comment:1 Changed 9 years 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

comment:2 Changed 9 years ago by ray

  • Resolution set to fixed
  • Status changed from new to closed

fixed rev [933]

Thanks for your contribution

Note: See TracTickets for help on using tickets.