Forums / Developer / PROBLEM: editing keyword attribute!!!
Valentina Ferrari
Wednesday 10 November 2004 2:43:33 am
Hi all!I have this problem:
I create a new object that contains a keyword attribute. I fill this attribute with a text that contains an apostrophe (for example: It's fine).I publish this object and all it's right.
BUT, when I edit this object, the keyword attribute value is repeated n times separeted by a comma (for example: It's fine, It's fine, It's fine)
Anybody knows the solution about this problem????
TIAValentina
Wenyue Yu
Wednesday 10 November 2004 5:07:20 am
Hi,
This is caused by not changing ' to \' when select existing keyword. We will fix it in next release. You can fix it yourself by editing file kernel/classes/datatypes/ezkeyword/ezkeyword.php around line 161:
Change
$existingWords =& $db->arrayQuery( "SELECT * FROM ezkeyword WHERE keyword IN ( '$wordsString' ) AND class_id='$classID' " );
to
$wordsString = $db->escapeString( $wordsString ); $existingWords =& $db->arrayQuery( "SELECT * FROM ezkeyword WHERE keyword IN ( '$wordsString' ) AND class_id='$classID' " );
Regards,wenyue