Re: Trying to strip.tags in searchresults
Here are my changes to achieve the same goal (from lib/search/searchlib.php):
Copy to clipboard
$search1= array('*','!','__','((','))'); $replace1= array('','','','',''); $cant=0; $ret=array(); while ($res = $result->fetchRow()) { if($this->user_has_perm_on_object($user,$res["page"],'wiki page','tiki_p_view')) { $href = "tiki-index.php?page=".urlencode($res["page"]); ++$cant; $ret[] = array( 'pageName' => $res["page"], 'location' => tra("Wiki"), 'data' => str_replace($search1,$replace1,substr($res["data"],0,250)), 'hits' => $res["hits"], 'lastModif' => $res["lastModif"], 'href' => $href, 'relevance' => $res["count"] ); } }
Essentially, search1 is an array of strings that I want to replace with the the array replace1. I do the actual replace a few lines down with the str_replace function.
Hope this helps,
Tyler