搜索原先的样子,代码位置e/search/result/index.php 99行
//替换列表变量
$repvar=ReplaceListVars($no,$listvar,$subnews,$subtitle,$formatdate,$url,$have_class,$r,$ret_r,$docode);
$listtext=str_replace("",$repvar,$listtext);
$changerow+=1;
//超过行数
修改后的代码
//替换列表变量
$repvar=ReplaceListVars($no,$listvar,$subnews,$subtitle,$formatdate,$url,$have_class,$r,$ret_r,$docode);
$content=$repvar;
$content= preg_replace('/(0[0-9]{2,3}[-]?[2-9])[0-9]{3,4}([0-9]{3}[-]?[0-9]?)/i','$1****$2',$content);//隐藏电话号码中间四位
$repvar = preg_replace('/(1[358]{1}[0-9])[0-9]{4}([0-9]{4})/i','$1****$2',$content);
$listtext=str_replace("",$repvar,$listtext);
$changerow+=1;
//超过行数
修改前:
老三楼068栋有房出租,黄金地段,联系电话18812341118
修改后的搜索结果为下面样子:
老三楼068栋有房出租,黄金地段,联系电话188****1118
正文完