critical error when there is a single quote in album keyword field critical error when there is a single quote in album keyword field
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

critical error when there is a single quote in album keyword field

Started by Tranz, September 24, 2005, 09:19:29 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Tranz

When there is a single quote in an album keyword field, the page on which exists the album sustains a critical error:
QuoteWhile executing query "SELECT count(pid) AS link_pic_count
                      FROM cpg11d_pictures
                        WHERE aid != 77 AND
                        keywords LIKE '%'Darcy'%' AND
                        approved = 'YES'" on 0

mySQL error: 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 'Darcy'%' AND
                        approved = 'YES'' at line

We could tell people to avoid using single quotes, but is there another way to handle this?

artistsinhawaii

TranzNDance,

It's a known issue or bug. I reported on it here: http://forum.coppermine-gallery.net/index.php?topic=20853.0

There are other issues with keywords in 1.4x as well.  Japanese character sets, whether separated with a space or by quotes still read as ONE keyword.  Search.php lists keyword phrases such as "one potato" that have been braced with quotes (")  as "one  and potato".

Dennis 
Learn and live ... In January of 2011, after a botched stent attempt, the doctors told me I needed a multiple bypass surgery or I could die.  I told them I needed new doctors.

Tranz

I found your post before I posted mine. :) However, you wrote about it in a thread that I didn't think was really related. For bug tracking, I thought it would be better to create a separate report. But if it's considered a keyword issue in general, this could be merged, I guess.

Aditya Mooley

Added fix for bug and committed to CVS.
Please confirm the fix.
--- "Its Nice 2 BE Important but its more Important 2 Be NICE" ---
Follow Coppermine on Twitter

artistsinhawaii

Quote from: Aditya Mooley on September 26, 2005, 11:59:12 AM
Added fix for bug and committed to CVS.
Please confirm the fix.

Works for me. 

See additional notes on special characters in keyword fieds here:  http://forum.coppermine-gallery.net/index.php?topic=20853.msg101849#msg101849


Dennis
Learn and live ... In January of 2011, after a botched stent attempt, the doctors told me I needed a multiple bypass surgery or I could die.  I told them I needed new doctors.