Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-02-17 08:30:39

forgethisname
New Member
Registered: 2007-01-22
Posts: 5

Bad ampersand encoding from build tag

Hi,

If I use the tag builder on the Files tab to create Textile or XHTML for a file download link, I get an extra #38; in the resulting code which means that the link doesn’t work see

"0042_001.pdf":http://www.xxx.com/index.php?s=file_download&id=118
<a href="http://www.xxx.com/index.php?s=file_download&#38;id=118">0042_001.pdf</a>

Can anyone help with a solution?

Thanks

Offline

#2 2009-02-17 11:55:04

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

Re: Bad ampersand encoding from build tag

Seems to be a bug if you are in messy mode. Just remove the “#38;” (leaving the &).

wet wrote:

Please be aware of the fact that & is the valid entity encoding for an ampersand. Cf. HTML 4.01 specification, appendix B.

My mistake — I took the OP at his word when saying the link didn’t work.

Last edited by jsoo (2009-02-17 15:17:26)


Code is topiary

Offline

#3 2009-02-17 12:05:36

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,340
Website GitHub Mastodon

Re: Bad ampersand encoding from build tag

Please be aware of the fact that &#38; is the valid entity encoding for an ampersand. Cf. HTML 4.01 specification, appendix B.

Offline

#4 2009-02-18 06:56:19

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,340
Website GitHub Mastodon

Re: Bad ampersand encoding from build tag

Thanks for the report, though I was a bit slow to understand the real problem here. Fixed in r3114.

Offline

#5 2009-02-19 15:36:23

forgethisname
New Member
Registered: 2007-01-22
Posts: 5

Re: Bad ampersand encoding from build tag

Firstly, thank you for your quick responses.
Please excuse my ignorance.

  1. I note your reference to the HTML 4.01 spec. stating that this is valid entity encoding of the ampersand; nonetheless the code generated by the tag builder doesn’t generate a valid link when the article in which it is pasted is rendered. Is this a problem with my server or with TxP?
  2. Does “Fixed in r3114” mean it has been identified as a bug and rectified ready for release in the next version? If so, is it safe for me to apply the correction to my clients installation in the meantime?

Offline

#6 2009-02-19 18:00:43

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,340
Website GitHub Mastodon

Re: Bad ampersand encoding from build tag

forgethisname wrote:

I note your reference to the HTML 4.01 spec. stating that this is valid entity encoding of the ampersand; nonetheless the code generated by the tag builder doesn’t generate a valid link when the article in which it is pasted is rendered. Is this a problem with my server or with TxP?

This is a bug in Textpattern and does not depend on the server. The ampersand was entity-encoded twice (once by the tag builder, once again by Textile). I’ve removed the first encoding.

Does “Fixed in r3114” mean it has been identified as a bug and rectified ready for release in the next version?

Yes.

If so, is it safe for me to apply the correction to my clients installation in the meantime?

Yes.

Offline

#7 2009-02-20 09:16:58

forgethisname
New Member
Registered: 2007-01-22
Posts: 5

Re: Bad ampersand encoding from build tag

Fantastic. Thanks so much.

Offline

Board footer

Powered by FluxBB