Welcome to Geeklog, Anonymous Wednesday, November 27 2024 @ 11:30 am EST

Geeklog Forums

search with apostrophe produces SQL error


Status: offline

destr0yr

Forum User
Full Member
Registered: 07/06/02
Posts: 324
I'm running gl-1.3.10rc3, however, this issue plagued me during all the 1.3.9 releases; i was just too lazy to post about it. In any case, if you visit my site's search page (here) and do a search with an apostrophe in it, a SQL error is pooped back. Here's the error.log:
Text Formatted Code
Thu Nov 25 17:58:04 2004 - 1064: 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') OR MATCH (answer) AGAINST ('donkey's') ORDER BY score' at l. SQL in question: SELECT topicID, question, answer, keywords As Score, name as category FROM gl_faq_topics topic LEFT JOIN gl_faq_categories category ON topic.catID=category.catID WHERE MATCH (keywords) AGAINST ('donkey's') OR MATCH (answer) AGAINST ('donkey's') ORDER BY score
 

PHP is version 4.3.9, I've tried w/magic_quotes on and off, same issue. Any comments/suggestions would be greatly appreciated.
-- destr0yr
"I love deadlines. I like the whooshing sound they make as they fly by." -- Douglas Adams
 Quote

tokyoahead

Anonymous
I guess in this case its an error of the plugin.
The search-function for the plugin is not written by the geeklog core-team, and this one might have an error.

I guess I better go and check my own plugin :-)
 Quote

Status: offline

destr0yr

Forum User
Full Member
Registered: 07/06/02
Posts: 324
i went through my plugins... seems to be the faqman, upage and journal that are giving me grief. i think Very Happy
-- destr0yr
"I love deadlines. I like the whooshing sound they make as they fly by." -- Douglas Adams
 Quote

Status: Banned

machinari

Forum User
Full Member
Registered: 03/22/04
Posts: 1512
went through my installed plugins and found that faqman and geekary were my culprits.

easy fix. i just added $query = addslashes($query); to the proper place in their respective functions.inc file and all is well.
but you all knew that already Leaves me speechless
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
We've actually been using a fixed functions.inc for the FAQ manager plugin here on geeklog.net for a while. You can download it from here now.

It also includes support for the faq: autotag that I described here (requires Geeklog 1.3.10, of course).

bye, Dirk
 Quote

Status: offline

destr0yr

Forum User
Full Member
Registered: 07/06/02
Posts: 324
Quote by machinari: went through my installed plugins and found that faqman and geekary were my culprits.

easy fix. i just added $query = addslashes($query); to the proper place in their respective functions.inc file and all is well.
but you all knew that already Leaves me speechless

Yah, I added the "addslashes" to the journal and userpages and it worked great, thank you machinari. Also noticed the faqman functions fix, thanks Dirk.
-- destr0yr
"I love deadlines. I like the whooshing sound they make as they fly by." -- Douglas Adams
 Quote

Status: offline

Marites

Forum User
Chatty
Registered: 02/04/04
Posts: 64
I find this is a problem more apparent than other CMS. If any unusual character appears in the title the RSS gets messed up. We donate space on our server to a PHPNuke site it does not happen on there. I have a copy of Mambo with another small site it doesn't happen with that either.

I have just learnt when posting to Geeklog certain characters are out of bounds so I don't use them .... it's annoying but there never seems to be a resolve or solution - so I I prefer GL I just put up with it's little annoyances.

-Tess-
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Quote by Marites: I find this is a problem more apparent than other CMS. If any unusual character appears in the title the RSS gets messed up.

Well, sending in bug report may help ... I wasn't aware of any problems with special characters in feeds. Do you have an example?

bye, Dirk
 Quote

Status: offline

Marites

Forum User
Chatty
Registered: 02/04/04
Posts: 64
I did Dirk to you personally and a report Smile not complaining I just use a workaround - will post up some sample asap.

- Tess -


Quote by Dirk:
Quote by Marites: I find this is a problem more apparent than other CMS. If any unusual character appears in the title the RSS gets messed up.

Well, sending in bug report may help ... I wasn't aware of any problems with special characters in feeds. Do you have an example?

bye, Dirk
 Quote

steve

Anonymous
Why not just parse the user input and replace all ' with ''
 Quote

All times are EST. The time is now 11:30 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content