phpBB

Code Changes

File: search.php

  Unmodified   Added   Modified   Removed
Line 538Line 538
	{
$firstpost_only = ($search_fields === 'firstpost' || $search_fields == 'titleonly') ? true : false;
$total_match_count = $search->author_search($show_results, $firstpost_only, $sort_by_sql, $sort_key, $sort_dir, $sort_days, $ex_fid_ary, $m_approve_fid_ary, $topic_id, $author_id_ary, $sql_author_match, $id_ary, $start, $per_page);

	{
$firstpost_only = ($search_fields === 'firstpost' || $search_fields == 'titleonly') ? true : false;
$total_match_count = $search->author_search($show_results, $firstpost_only, $sort_by_sql, $sort_key, $sort_dir, $sort_days, $ex_fid_ary, $m_approve_fid_ary, $topic_id, $author_id_ary, $sql_author_match, $id_ary, $start, $per_page);

	}

// For some searches we need to print out the "no results" page directly to allow re-sorting/refining the search options.
if (!sizeof($id_ary) && !$search_id)
{
trigger_error('NO_SEARCH_RESULTS');

 
	}

$sql_where = '';

	}

$sql_where = '';

Line 580Line 574
	}

// define some vars for urls

	}

// define some vars for urls

	$hilit = implode('|', explode(' ', preg_replace('#\s+#u', ' ', str_replace(array('+', '-', '|', '(', ')', '"'), ' ', $keywords))));
// Do not allow *only* wildcard being used for hilight
$hilit = (strspn($hilit, '*') === strlen($hilit)) ? '' : $hilit;

	// A single wildcard will make the search results look ugly
$hilit = phpbb_clean_search_string(str_replace(array('+', '-', '|', '(', ')', '"'), ' ', $keywords));
$hilit = str_replace(' ', '|', $hilit);


$u_hilit = urlencode(htmlspecialchars_decode(str_replace('|', ' ', $hilit)));
$u_show_results = '&sr=' . $show_results;


$u_hilit = urlencode(htmlspecialchars_decode(str_replace('|', ' ', $hilit)));
$u_show_results = '&sr=' . $show_results;

Line 846Line 840
			$hilit_array = array_filter(explode('|', $hilit), 'strlen');
foreach ($hilit_array as $key => $value)
{

			$hilit_array = array_filter(explode('|', $hilit), 'strlen');
foreach ($hilit_array as $key => $value)
{

				$hilit_array[$key] = str_replace('\*', '\w*?', preg_quote($value, '#'));


				$hilit_array[$key] = phpbb_clean_search_string($value);
$hilit_array[$key] = str_replace('\*', '\w*?', preg_quote($hilit_array[$key], '#'));

				$hilit_array[$key] = preg_replace('#(^|\s)\\\\w\*\?(\s|$)#', '$1\w+?$2', $hilit_array[$key]);
}
$hilit = implode('|', $hilit_array);

				$hilit_array[$key] = preg_replace('#(^|\s)\\\\w\*\?(\s|$)#', '$1\w+?$2', $hilit_array[$key]);
}
$hilit = implode('|', $hilit_array);