sNews Forum

Previous sNews versions => sNews 1.5 Final => Bug Report => Topic started by: asphodel587 on February 11, 2007, 07:17:17 am

Title: Punctuation in Article Titles
Post by: asphodel587 on February 11, 2007, 07:17:17 am
Apparently, if you attempt to use any sort of punctuation in article titles, the article either won't save or won't update (depending on whether it's a new article or an edit).  Unless there's something wrong with how my php is integrating with mysql (missing library or whatever).  I'm going to browse through the code as best as i can to see if there's a way around it.  I have applied the patch that invloved removing function_decode as well.

Interestingly enough, I have similar problems in the custom page section.  I have to make all the page edits in html manually, then use phpmyadmin (or command line mysql) to add them to the db.  I can make the punctuation appear in the article titles in a similar fashion as well.  It's a little bit of a pain, but I really like this software and the community!

I seem to have narrowed the problem down:  It is NOT in fact because of html, or just any puncuation, specifically it's the apostrophe that causes the problem.  If there is an apostrophe anywhere in something you're going to post, it won't be written to the db, but snews will say the article or edit or custom page has been added successfully.  If you put an escape character before the apostrophe, (e.g. their\'s instead of their's) the changes will post and the apostrophe will be fine.  I would assume this difficulty is due to the apostrophe being the equivelant of a single-quote, but i find it rather odd that no one else has had this issue.  I'll post back in a bit, if i can get that function to work.

Edit #2
Ok, by making magic_quotes_gpc On in my php.ini, php now automatically adds an escape character when it is needed.  the comments in php.ini indicate that using addslashes() on input data would make editing the ini file uncessesary.  I browsed through the code a bit, but my php skills are not up to par, so it's taking me a little longer to find where i should be playing around with these edits, though, as mentioned in another post, it is a lot more fun to do it myself, than to wait for someone else to do it. =p
Title: Punctuation in Article Titles
Post by: piXelatedEmpire on February 11, 2007, 11:45:58 pm
reported here (
Title: Punctuation in Article Titles
Post by: asphodel587 on February 13, 2007, 04:22:58 pm
Ah. Well, I did a search before I posted, but at the time I did not realize it was due to single/double quotes, I thought it was an issue with the db query.  Thanks for the response and the link to the issue!