Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#867 closed defect (invalid)

Problem with ampersands in links

Reported by: mario@… Owned by: wymsy
Priority: normal Milestone:
Component: Plugin_GetHtml Version:
Severity: normal Keywords: ampersands
Cc:

Description

Hi, there is a bug when we add a link in xinha and use ampersands.

exemple: http://test.com/test.php?a=1&b=2

becames: http://test.com/teste/php?a=1&b=2

Is there a solution?

tks

Mário

Change History (5)

comment:1 Changed 13 years ago by ray

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

This is absolutely correct, as & is a reserved character in HTML and has to be written as &

comment:2 Changed 13 years ago by ray

Oh, I have not read correctly: Is it really

teste/php?a=1&b=2

?

comment:3 Changed 13 years ago by mario@…

  • Resolution invalid deleted
  • Status changed from closed to reopened

Hi.

It's teste.php?a=1&b=2.

I agree that in a normal text, & should be translated to &
But it's not ok that this be translated inside a hyperlink. This way the link will not work.

exemple,
this is ok:
Name &: Name associates

this is not ok:
<a href="teste.php?a=1&b=2">Click here</a>

comment:4 Changed 13 years ago by ray

  • Resolution set to invalid
  • Status changed from reopened to closed

Single ampersands. Although HTML user agents have tended to turn a blind eye, you should never have a single ampersand (&) in your document. You should pay particular attention to URIs that include parameters. For example, your document should contain http://example.org/my-script.php?class=guest&name=user, rather than http://example.org/my-script.php?class=guest&amp;name=user.

http://www.w3.org/International/questions/qa-escapes#bytheway

http://www.w3.org/TR/html401/charset.html#h-5.3.2

comment:5 Changed 13 years ago by gogo

This thread is a bit confusing because some entities have been converted by the looks of things.

To summarize: the entization shown being performed in the original post is CORRECT. An entity is not only valid at that point, it is required for the document to be valid. If your browser isn't handling the entity in the URL correctly, then it is probably very very old and definately very very broken.

Note: See TracTickets for help on using tickets.