TinyPortal

Development => Feedback => Bugs/Errors => Topic started by: Touti on November 12, 2009, 01:18:42 PM

Title: [bugtracker] SQL Error when assigning tags to Topic with apostrophe in title.
Post by: Touti on November 12, 2009, 01:18:42 PM
SMF Version: 1.1.10
TP Version: 1.0 Beta 4
Theme: Rhino114
Forum Language: French
Bug: The following SQL error occurs when trying to assign a tag to a topic with a single quote character in the title.
Topic Title: Preparation d'un trip Montréal - Lima
Tag: Ouest


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 'un trip Montréal - Lima ','tpadmin_topictags','globaltag_item','',0,'Oues' at line 2
Fichier: /home/frenchep/public_html/Sources/TPortalAdmin.php
Ligne: 261


Title: Re: [bugtracker] SQL Error when assigning tags to Topic with apostrophe in title.
Post by: Touti on November 12, 2009, 03:16:53 PM
Here's my temporary fix in case other french admins have the same problem.

In TPortalAdmin.php near line 261 find

$subject = '<span style="background: url('.$settings['tp_images_url'].'/glyph_topic.png) no-repeat;" class="taglink">' . title[0]. '</span>';


and replace with
$subject = '<span style="background: url('.$settings['tp_images_url'].'/glyph_topic.png) no-repeat;" class="taglink">' . str_replace("'","\'",$title[0]). '</span>';