- Joined: 01 Feb 2004
- Posts: 1464
- Location: Sunny ol Tamworth, New England NSW AU
|
inverted commas shown as "e in last post column
Posted: Tue Apr 01, 2008 1:23 pm
|
Hey Maxim and/or Bock,
I was looking at the main page of the forum and noticed that when a topic has "inverted" commas it appears as "e on the link in the Latest Post column, yet in the hover text on the link it appears correctly..
I don't know if this is a bug or the way in which the forum works. I have a screenshot attached so you can see what I mean.
Thanks
Scott
|
- Joined: 12 Apr 2005
- Posts: 391
- Location: London, United Kingdom
|
Posted: Tue Apr 01, 2008 1:33 pm
|
Interestingly, IE8, Opera 9 and Safari 3 all render " (without the semicolon) as ".
|
- Site Admin
- Joined: 19 Oct 1999
- Posts: 14685
- Location: London
|
Posted: Tue Apr 01, 2008 2:34 pm
|
Strings are stored in the DB with certain characters stored as "HTML entities" like "e; for various reasons. For display there we have to trim titles because long titles can have bad effects on the page layout. Thus you can get the title trimmed in the middle of an entity and it looks odd. There's not much we can do about it without substantially affecting the forum layout. I do have a prototype forum template where it's better (and a lot of other things are improved) but it's not ready for use yet.
|
- Joined: 12 Apr 2005
- Posts: 391
- Location: London, United Kingdom
|
Posted: Tue Apr 01, 2008 2:47 pm
|
Is the trimming done on the DB or in PHP?
If in PHP, you could replace substr($string, 0, $length) (or equivalent) with:
htmlspecialchars(substr(html_entity_decode($string, ENT_QUOTES), 0, $length), ENT_QUOTES);
|
- Site Admin
- Joined: 19 Oct 1999
- Posts: 14685
- Location: London
|
Posted: Tue Apr 01, 2008 3:27 pm
|