Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-04-03 21:09:12

systyrant
New Member
Registered: 2006-12-18
Posts: 8

Ampersand in the site name?

My business name has an ampersand in it and I use it in the site name, but textpattern keeps replacing the proper ascii code with a single ampersand. How do I make it stop that and use a proper ampersand code?

Offline

#2 2008-04-03 21:26:49

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Ampersand in the site name?

That’s a bug. If you change the & to & in the site name, it will store it exactly like that, even if it doesn’t display the escaped ampersand in the preferences. It also shows up correctly escaped in the resulting HTML code on the public side… but if you change something in the preferences later on, it saves the ampersand in the site name as it is shown, without escaping. The only way to stop that is to make sure you alter the site name to contain an escaped ampersand before you save the preferences.

For those interested, the problem is in the fInput function which does not escape the ampersand. That causes problems in situations like this. It really should escape ampersands as well, except for article titles which (unfortunately) already have their ampersands escaped due to textile-ing). I think the correct solution is fixing fInput to escape the ampersand as well (and use htmlspecialchars instead of cleanfInput), but that would need some modifications elsewhere to fix article title escaping.

Offline

#3 2008-05-08 18:59:46

gerhard01
Plugin Author
Registered: 2006-12-07
Posts: 108

Re: Ampersand in the site name?

ruud wrote:

That’s a bug.

The same behaviour holds true for links stored under “Links”. Any chance for a fix in 4.0.7?

Thanks!

Offline

#4 2008-05-09 08:16:20

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Ampersand in the site name?

Thanks for bumping this thread. I’ll look into this.

Offline

#5 2008-05-17 15:44:17

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Ampersand in the site name?

Offline

#6 2008-05-18 19:26:23

gerhard01
Plugin Author
Registered: 2006-12-07
Posts: 108

Re: Ampersand in the site name?

Thanks a lot!

Offline

Board footer

Powered by FluxBB