PhpDig.net

PhpDig.net (http://www.phpdig.net/forum/index.php)
-   Bug Tracker (http://www.phpdig.net/forum/forumdisplay.php?f=27)
-   -   Certain Search Strings Causing Errors (http://www.phpdig.net/forum/showthread.php?t=1666)

BBUCommander 12-22-2004 10:40 AM

Certain Search Strings Causing Errors
 
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:

Quote:

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:

vinyl-junkie 12-22-2004 10: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.

Charter 01-04-2005 10:15 PM

It's a bug... to fix do the following:

In search_function.php find:
PHP Code:

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

And replace with:
PHP Code:

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



All times are GMT -8. The time now is 11:59 PM.

Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 2001 - 2005, ThinkDing LLC. All Rights Reserved.