Searching problem - characters being returned. Searching problem - characters being returned.
 

News:

CPG Release 1.6.27
change DB IP storage fields to accommodate IPv6 addresses
remove use of E_STRICT (PHP 8.4 deprecated)
update README to reflect new website
align code with new .com CPG website
correct deprecation in captcha

Main Menu

Searching problem - characters being returned.

Started by essaytee, January 14, 2011, 06:13:17 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

essaytee

I've installed Coppermine 1.5.   Testing the search feature, I enter a single character, "1", searching against the default set (title, keywords etc.).   The problem is that where "1" is in the keyword ie "2010" it's being returned as a result, which shouldn't be the case.

I tag many photos with the bib number of runners & cyclists.   Sometimes bib numbers are single digits as opposed to three or more digits.

Any clues or suggestions please.


ΑndrĂ©

Untested: open include/search.inc.php, find
if (in_array($param, $allowed)) $fields[] = "$param LIKE '%$word%'";
and replace with
if (in_array($param, $allowed)) $fields[] = "$param = '$word'";

Maybe you have to replace
if (in_array($param, $allowed)) $fields[] = "$param LIKE '%$string%'";
with
if (in_array($param, $allowed)) $fields[] = "$param = '$string'";
additionally.

essaytee