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

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,963
  • Latest: BiZaJe
Stats
  • Total Posts: 195,917
  • Total Topics: 21,308
  • Online today: 790
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 1
  • Guests: 634
  • Total: 635
  • tino

[bugtracker] Global Tags & Article Names

Started by Thor{DoH}, February 27, 2009, 05:48:23 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Thor{DoH}

I have found that if I have an article with a single quote in the title and I update the article to include global tags that it will error out with the following:

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 'z Killaz ','tparticle_itemtags','globaltag_item','',0,'Thor','','',5)' at line 2
File: /home/destroye/public_html/40k/Sources/TPortalAdmin.php
Line: 231

If I remove the single quote from the article title it works fine. What I have to do is remove the single quote from the article title, leave off global tags and update the article. I can then add the global tags and update it again. Lastly, I then go back and update the article title to include my single quote.

It would appear the query that runs in TPoralAdmin.php when you're updating global tags is not set to handle single quotes and that's what is throwing the query error.

bloc

- Saving article titles with single quotes caused errors in saving global_tags. Fixed for TP v1.0 beta4

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

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


There were more fixes actually, but that *should* help with the saving.

This website is proudly hosted on Crocweb Cloud Website Hosting.