TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

April 25, 2024, 08:08:36 PM

Login with username, password and session length
Members
  • Total Members: 3,885
  • Latest: Growner
Stats
  • Total Posts: 195,173
  • Total Topics: 21,219
  • Online today: 287
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 0
  • Guests: 293
  • Total: 293

[bugtracker] Apostrophes

Started by ZarPrime, May 07, 2010, 03:54:23 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ZarPrime

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

Tziena

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

Tziena

#2
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.

Freddy

Which file was this please ?

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

Tziena

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.

ZarPrime

Freddy,

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

ZarPrime


ZarPrime