4images Forum & Community

4images Help / Hilfe => Bug Fixes & Patches => Topic started by: kai on December 03, 2010, 09:29:46 AM

Title: [1.7.9] DB Error: Bad SQL Query: INSERT INTO 4images_wordmatch (image_id, ...
Post by: kai on December 03, 2010, 09:29:46 AM
If you upload an image which has the same words in title, description and keywords you can get a "DB Error: Bad SQL Query: INSERT INTO 4images_wordmatch (image_id, ..." message.

To fix this:

in includes/search_utils.php

FIND:
array_walk($split_words, 'trim_value');

and REPLACE WITH:
$split_words = array_map('trim', $split_words);
$split_words = array_map('strip_tags', $split_words);
$split_words = array_map('convert_special', $split_words);
$split_words = array_map('strtolower', $split_words);
Title: Re: [1.7.9] DB Error: Bad SQL Query: INSERT INTO 4images_wordmatch (image_id, ...
Post by: mawenzi on December 09, 2010, 10:22:41 PM
@ Kai ...
... thanks for this fix ...

@ all ...
... only a hint : the file search_utils.php is to find in /includes/ ...

Title: Re: [1.7.9] DB Error: Bad SQL Query: INSERT INTO 4images_wordmatch (image_id, ...
Post by: haider512 on December 27, 2010, 11:56:43 PM
Many Thanks...Keep rocking....