Quote:
Originally Posted by RedWingFan
Not random. If I choose "View Results as Posts", I get the errors. If I view results as threads, no errors.
Code:
Warning: strpos() [function.strpos]: Empty delimiter in [path]/includes/functions_search.php on line 829
The proper search results do display below, however...
|
More info, if anyone cares to debug this. For now, I just put error_reporting(0); as the first line in includes/search_functions.php to kill the error message. It doesn't cure the problem, but at least removes a small amount of end-user panic.
Here is how to duplicate it:
1) Use no search terms
2) Enter a valid username
3) Choose "Threads started by user", and check Exact Name
4) View results as posts
The function's affected lines are here (strpos is the affected line):
PHP Code:
// ###################### Start process_quote_removal #######################
function process_quote_removal($text, $cancelwords)
{
$lowertext = strtolower($text);
foreach ($cancelwords AS $word)
{
$word = str_replace('*', '', strtolower($word));
if (strpos($lowertext, $word) !== false)
{
// we found a highlight word -- keep the quote
return "\n" . str_replace('\"', '"', $text) . "\n";
}
}
return '';
}
//
So, I'm thinking the $cancelwords array is empty when being passed to this function. (Follow my logic?) Not knowing enough about this or the vB search function, or the Sphinx file I uploaded, I don't know where I'd begin troubleshooting this. The function is used at around line 2817 in search.php:
PHP Code:
$post['pagetext'] = preg_replace('#\[quote(=("|"|\'|)??.*\\2)?\](((?>[^\[]*?|(?R)|.))*)\[/quote\]#siUe', "process_quote_removal('\\3', \$display['highlight'])", $post['pagetext']);
//
//
If there's something that'll work, to fix this, I'm all ears.
Beyond that, the search is working fine on our test forum...and I'm anxious to run this on our live forum as soon as I can get this ironed out.