Log in

View Full Version : Extra "/" Characters are showing up


gopherhockey
05-13-2004, 12:14 PM
Ever since moving to vb3 I have noticed a few of my hacks are adding extra "/" characters in certain areas. Mainly in fields typed in by users... such as photopost where the user describes the photo, or a hack I have that does trail conditions for mountain biking - the description adds "/" characters before a ' or a " character.. sometimes as many as 3 of them.

See: http://www.morcmtb.org/forums/trail.php?action=showtrail (http://www.morcmtb.org/forums/trail.php?action=showtrail)

I see these characters in the database, so they appear to be caught at the time they are entered.

I really have no clue where to go looking for this... can anyone help? It seems odd they suddenly appeared in vb3 but were not there before. I'm guessing it might have to do with the query that updates the text in question - I see a .addslashes($message) for example. Should I just remove the .addslashes?

gopherhockey
05-13-2004, 12:29 PM
I removed the addslashes and that seemed to work.. but I'd still like to know why that was there or why it caused a change if anyone happens to know.

Maybe it has more to do with the server I'm on than the version of vb.. I did switch servers recently as well.

Oblivion Knight
05-13-2004, 02:36 PM
With vB3, it requires the added slashes to be stripped before being displayed..

So in your example with the $message variable, above where it is called within the file, you'd add something like this: $message = stripslashes($message);

Boofo
05-13-2004, 02:54 PM
I removed the addslashes and that seemed to work.. but I'd still like to know why that was there or why it caused a change if anyone happens to know.

Maybe it has more to do with the server I'm on than the version of vb.. I did switch servers recently as well.
If you remove the addslashes, you will start getting DB errors for messages with single quotes and apostrophes. Leave that in and do as Oblivion suggested on stripping the slashes when you pull the messages from the db.