TinyPortal

Development => Feedback => Bugs/Errors => Topic started by: ZarPrime on May 07, 2010, 03:54:23 PM

Title: [bugtracker] Apostrophes
Post by: ZarPrime on May 07, 2010, 03:54:23 PM
I know that the apostrophe thing has been difficult to sort out.  This bug
report may be a duplicate but it can't hurt to report it anyway.

Apparently, apostrophes in the titles are not the only problem.  It seems that
even having them in the text of an article may have been causing problems
as well (reference topic --> http://www.tinyportal.net/index.php?topic=32640.msg262252#msg262252)

ZarPrime
Title: Re: [bugtracker] Apostrophes
Post by: Tziena on August 05, 2010, 05:15:50 AM
Link to my site: http://www.swtor-rp.com
SMF version: SMF 2.0 RC3
TP version: TinyPortal 1.0 beta 5.2
Theme name and version: it's actually my variant of the Curve theme ( only visual CSS and graphic design was altered, no layout changes. )
Browser Name and Version: Firefox 3.6.8 and IE 8 (64 bit)
Mods installed:  This isn't exactly important, but I'll list them here anyway... none of these touch TPmodules.php
1.Spoiler Tag
2.TinyPortal
3.SimplePortal
4.Fix the search
5.Share This Topic
6.Stars And Badges
7.Ad Managment
8.Proxy Blocker
9.Auto Merge Double Post
10.Reason For Editing Mod
13.Ultimate Profile
14.Users Online Today
15.Aeva Media
16.SubAccounts Mod
17.Ignore User Button
18.Twitter and Facebook Publisher mod

Related Error messages:
Anytime there is an apostrophe in a user's comment to an article this error occurs. I am going to attempt to get my technical admin to take a look at the issue, but I thought I should mention this to you guys. I really like tinypotal, I'd like for it to function well with SMF 2.0. If we come up with a fix, I'll let you know, until then, I'd like someone here to look at it, too.

The comment entered was: "It's a test"
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 's a test','2','article_comment','1280981074',24)' at line 2
File: /home/tziena/public_html/swtor-rp.com/Sources/TPmodules.php
Line: 155


If you'd like to reach me on IM, I can be found at these handles: YIM - Tziena, AIM - Tziena, and MSN - tziena@hotmail.com, or feel free to send me an email at tziena@starsidergalaxy.com.

Good luck
Title: Re: [bugtracker] Apostrophes
Post by: Tziena on August 05, 2010, 05:56:18 AM
I can't believe this, but I believe I found a fix for it. It's a bit of a hack, I'm sure, but here it is.

Sources/TPmodules.php

Find:
$comment = substr($_POST['tp_article_bodytext'],0,65536);

Add after:
$comment = str_replace("'", "’", $comment);

So far I have not found any errors, but as you can see, it's not been long since I posted about the error. I'll keep you updated if I find out anything.
Title: Re: [bugtracker] Apostrophes
Post by: Freddy on August 05, 2010, 07:29:41 AM
Which file was this please ?

I think you might be able to use PHP addslashes() there too instead as another solution.
Title: Re: [bugtracker] Apostrophes
Post by: Tziena on August 05, 2010, 01:20:11 PM
Quote from: Freddy on August 05, 2010, 07:29:41 AM
Which file was this please ?

I think you might be able to use PHP addslashes() there too instead as another solution.

Oh sorry, I though the file name was a given: Sources/TPmodules.php I'll edit my post.

addslashes() didn't work because that's a PHP cancellation not an SQL cancellation. I tried that.
Title: Re: [bugtracker] Apostrophes
Post by: ZarPrime on August 05, 2010, 04:26:01 PM
Freddy,

You might want to go ahead and stick this in the new BugTracker if it's not already in there.

ZarPrime
Title: Re: [bugtracker] Apostrophes
Post by: Freddy on August 05, 2010, 04:37:53 PM
Done : http://www.tinyportal.net/index.php?issue=12.com16#com15
Title: Re: [bugtracker] Apostrophes
Post by: ZarPrime on August 05, 2010, 04:54:18 PM
Thanks. O0

ZP