Important notice about the future of Stripcreator (Updated: May 2nd, 2023)

stripcreator forums
Jump to:

Stripcreator » Regarding Stripcreator » Weird Slash-Thingy

Author

Message

MikeyG
Shoots the shit and often misses

Member Rated:

All of a sudden a bunch of backslashes are popping up in my older comics. Like so:

[Click to view comic: 'FTC 21: A Clockwork Bore-angst']

---
The giant three-phallused phallus of Uzbekistan will one day squirt the cosmic jizz of revenge all over Canada.

3-12-04 10:30am (new)
quote : comics : pm : info


attitudechicka
is never bored.

Member Rated:

This seems to be a problem with edited comics. I honestly don't know why it happens, I just know it happens to edited comics. I call it ECD or Edited Comics Disease.

---
Mediocrity at its most average.

3-12-04 6:11pm (new)
quote : comics : pm : info


Brad
Feature Creep

Member Rated:

This is bizarre, I can't seem to get it to do this in tests. You're just editing the comic and those slashes appear?

---
www.bradsucks.net

3-13-04 12:01am (new)
quote : comics : pm : info


Ahri
Stripcreator Newbie

Member Rated:

3-13-04 9:30am (new)
quote : comics : pm : info


Brad
Feature Creep

Member Rated:

That would remove all slashes from the text, meaning nobody could use the slash character at all.

---
www.bradsucks.net

3-13-04 2:01pm (new)
quote : comics : pm : info


DragonXero
I'm Here, You're Queer, Get Used to it

Member Rated:

And that would suck.

---
Do you want ants? Because that's how you get ants.

3-13-04 2:17pm (new)
quote : comics : pm : info


laughinginyourface
Chuck Norris's bitch

Member Rated:

Damn straight it would.

---
...and pain joined his urge to percieve...

3-13-04 4:31pm (new)
quote : comics : pm : info


Ahri
Stripcreator Newbie

Member Rated:

Ah, you're partly mistaken there Brad! You're right that it would remove slashes altogether from unescaped strings, but if all strings are being escaped (perhaps even twice in your case) then that is not an issue. Allow me to attempt to diagnose the problem and offer a vague solution.

Here's what I think is currently happening, in an oversimplified form:

As you may be able to see, addslashes() is named oddly, since it's actually escaping potentially harmful characters. Similarly stripslashes() isn't just meandering about deleting slashes, it's un-escaping characters (for output.) The first time addslashes() is used in the above example the only harmful character is the apostrophe, so it's escaped with a slash. The second time though both the slash and the apostrophe are deemed harmful, so both are escaped (slashes put in front of them both.) Note that a slash is escaped both because it could be used maliciously and because if it wasn't escaped then it would be lost upon use of stripslashes().

So somewhere along the lines you're escaping the string twice. I suggest that since it's (reportedly) only affecting editted comics that you need to stripslashes() the submitted strings in the editting script, before using mysql_escape_string() (or whatever database function you're using to sanitize your strings.) Note that my above example can be altered to use mysql_escape_string() instead of addslashes() with no difference to the resulting string as in this narrow example they perform the exact same job.

Without access to your code I can't make a better guess, so I hope that helps.

I reccomend that you try to stop the escaping occuring twice, rather than counter-acting it at output; prevention being better than cure and all that ;)

3-13-04 8:33pm (new)
quote : comics : pm : info


Ahri
Stripcreator Newbie

Member Rated:

Adendum: My tests didn't yeild the same results as MikeyG. So either he's adding the slashes himself (unlikely since it's a phenomenon observed by others) or you have some weird code to fix up :)

Oh for some opensource goodness.....

3-13-04 8:40pm (new)
quote : comics : pm : info


Ahri
Stripcreator Newbie

Member Rated:

Addendum: I do know how to spell 'addendum'. Oops.

3-13-04 8:41pm (new)
quote : comics : pm : info


Brad
Feature Creep

Member Rated:

Well, it's pretty clear that the text is getting addslashes() run on it twice. However, I can't get this to happen on any comics when I edit them so that makes it pretty hard to track the problem down. Is anyone else having this problem?

---
www.bradsucks.net

3-13-04 9:16pm (new)
quote : comics : pm : info


KajunFirefly
chooby digital (in stereo)

Member Rated:

[Click to view comic: 'The continuing adventures of Captain Editor!']

No problems with mine.

---
Dad was flammable

3-14-04 4:11am (new)
quote : comics : pm : info


attitudechicka
is never bored.

Member Rated:

I observed it before with some comics that had appostrophes (and sometimes with commas) used. I checked through mine, but couldn't find any slashes, though I'm sure I had to deal with it at some point. The worst part is, I don't know how I fixed it.

---
Mediocrity at its most average.

3-14-04 7:16am (new)
quote : comics : pm : info


MikeyG
Shoots the shit and often misses

Member Rated:

Brad, I only seem to get it with old edited comics where there owuld be ab apostrophe or quotation marks. I am not even sure if it's ONLY edited comics, and it didn't happen right after I edited them. It took me browsing through my oldies last week to see these mad slashes.

---
The giant three-phallused phallus of Uzbekistan will one day squirt the cosmic jizz of revenge all over Canada.

3-17-04 9:03am (new)
quote : comics : pm : info


jes_lawson
I don't know what I'm doing either

Member Rated:

Sounds like a problem with the escape characters.

[Click to view comic: 'Pointless Drivel: Testing testing...']

Works fine for me.

---
Please replace the handset, and try again.

3-19-04 5:51am (new)
quote : comics : pm : info

Stripcreator » Regarding Stripcreator » Weird Slash-Thingy


reload page with comics

Jump to:

Post A Reply


stripcreator
Make a comic
Your comics
Log in
Create account
Forums
Help
comics
Random Comic
Comic Contests
Sets
All Comics
Search
featuring
diesel sweeties
jerkcity
exploding dog
goats
ko fight club
penny arcade
chopping block
also
Brad Sucks