View Full Version : Certain Search Strings Causing Errors

12-22-2004, 11:40 AM
Whenever I attempt to make a search using certain strings such as 'news' or 'ah', the search engine will crash and give me this error repeatedly:

Notice: Uninitialized string offset: 0 in F:\Documents and Settings\Jesse\My Documents\sites\Animal Rights\testserver\search\phpdig\libs\search_function.php on line 597

Yet, when I type something like 'ahbe' as the query string, it works fine, so I do not believe that it has something to do with the string length. Any ideas about what could be causing this error?

I'm using v 1.8.6 of PhpDig.

BTW, hope everyone is enjoying the holidays. :santa:

12-22-2004, 11:53 PM
If it were a problem with phpdig, I would think I'd get the same error when I try the same search on my site. However, that worked fine for me.

Did you make any mods to phpdig? If so, I'd start looking there for a problem.

01-04-2005, 11:15 PM
It's a bug... to fix do the following:

In search_function.php find:

else {
$num_in_strings_arr = count($strings);
$leven_final = "";
$leven_sum = 0;

And replace with:

else {
if (is_array($strings)) {
$strings = array_values($strings);
$num_in_strings_arr = count($strings);
else { $num_in_strings_arr = 0; }
$leven_final = "";
$leven_sum = 0;