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:
@@ -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,7 +308,10 @@ class e_search
|
||||
$this -> text = preg_replace("#(".$boundary.$this -> query.$regex_append."#i", "<span class='searchhighlight'>\\1</span>", $this -> text);
|
||||
}
|
||||
}
|
||||
if ($title)
|
||||
}
|
||||
|
||||
|
||||
if($title)
|
||||
{
|
||||
if ($pre_title == 0)
|
||||
{
|
||||
@@ -317,7 +328,7 @@ class e_search
|
||||
|
||||
$this -> text = $this -> bullet." <b><a class='visit' href='".$res['link']."'>".$pre_title_output.$this -> text."</a></b><br />".$res['pre_summary'];
|
||||
}
|
||||
else if (!$endcrop)
|
||||
elseif (!$endcrop)
|
||||
{
|
||||
$this -> parsesearch_crop();
|
||||
}
|
||||
@@ -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 />";
|
||||
}
|
||||
|
Reference in New Issue
Block a user