Welcome to Geeklog, Anonymous Wednesday, May 15 2024 @ 02:44 am EDT

Geeklog Forums

ampersand comment bug?


Status: offline

bobotron

Forum User
Newbie
Registered: 05/02/02
Posts: 8
On my site -- and here at geeklog.net -- when I add a comment with '&' in the title, it appears as '& amp ;' (without the spaces).

I'm sure this is probably a quick fix, but I wouldn't have a clue where to look.
 Quote

Status: offline

vinny

Site Admin
Admin
Registered: 06/24/02
Posts: 352
Location:Colorado, USA
It looks like we're calling htmlspecialchars() against the title both before we save the title into the database and when we load it out of the database for display. We probably shouldn't be doing it before we load it into the database...

In comment.php (in the savecomment() function) you want to change the line:
Text Formatted Code
$title = htmlspecialchars (COM_checkWords (strip_tags (COM_stripslashes ($title))));
 

to:
Text Formatted Code
$title = COM_checkWords (strip_tags (COM_stripslashes ($title)));
 


I'll get this fix into CVS today...

-Vinny
 Quote

Status: offline

bobotron

Forum User
Newbie
Registered: 05/02/02
Posts: 8
thoughtful
This appears to fix the resulting comment, but it's still screwed up in the comment preview.

Not a big deal to me, but thought you'd want to know.

Thanks!

-bob
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Vinny,

isn't this the same issue as in bug #174?

bye, Dirk
 Quote

Status: offline

vinny

Site Admin
Admin
Registered: 06/24/02
Posts: 352
Location:Colorado, USA
Quote by Dirk: isn't this the same issue as in bug #174?

Similar problems, but I think there is one other thing that needs to be fixed before this works as expected... I'll look into it.

Quote by bobotron:This appears to fix the resulting comment, but it's still screwed up in the comment preview.

Good Catch, I'll fix that up as well.

-Vinny
 Quote

All times are EDT. The time is now 02:44 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content