1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-30 09:39:55 +02:00

Fixed PHP warnings in search class

This commit is contained in:
Cameron
2014-02-04 09:22:34 -08:00
parent 47c546c2fb
commit 3ca9052f69

View File

@@ -271,7 +271,11 @@ class e_search
$endcrop = FALSE;
$output = '<!-- Start Search Results -->';
$title = TRUE;
foreach ($matches as $this -> text) {
if(!empty($matches))
{
foreach ($matches as $this -> text)
{
$this -> text = nl2br($this -> text);
$t_search = $tp -> search;
$t_replace = $tp -> replace;
@@ -282,6 +286,9 @@ class e_search
$this -> text = strip_tags(str_replace($search, $replace, $this -> text));
if(!empty($this->keywords['match']))
{
foreach ($this -> keywords['match'] as $match_id => $this -> query)
{
$boundary = $search_prefs['boundary'] ? '\b' : '';
@@ -290,7 +297,8 @@ class e_search
} else {
$regex_append = $boundary.")";
}
if (($match_start = $tp->ustristr($this -> text, $this -> query)) !== FALSE) {
if (($match_start = $tp->ustristr($this -> text, $this -> query)) !== FALSE)
{
$this -> pos = $tp->ustrlen($this -> text) - $tp->ustrlen($match_start);
if (!$endcrop && !$title) {
$this -> parsesearch_crop();
@@ -300,6 +308,9 @@ class e_search
$this -> text = preg_replace("#(".$boundary.$this -> query.$regex_append."#i", "<span class='searchhighlight'>\\1</span>", $this -> text);
}
}
}
if($title)
{
if ($pre_title == 0)
@@ -325,7 +336,7 @@ class e_search
$output .= $this -> text;
$title = FALSE;
}
}
$display_rel = $search_prefs['relevance'] ? " | ".LAN_SEARCH_69.": ".round($row['relevance'], 1) : "";
$output_array['text'][] = $output.$res['post_summary']."<br /><small>".$res['detail'].$display_rel."</small><br /><br />";
}