关键词 增加转义后的匹配

hotfix/远程访问多媒体中心
lyt 8 years ago
parent 6f0c8cf407
commit 8caa243730

@ -468,6 +468,7 @@ class Keyworlds extends CI_Controller {
preg_match_all($match_fun, $response, $store); preg_match_all($match_fun, $response, $store);
foreach ($store[1] as $k => $v) { foreach ($store[1] as $k => $v) {
$ismatch = stripos($v, $site_url); $ismatch = stripos($v, $site_url);
$ismatch = $ismatch ? $ismatch : stripos($v, addcslashes(addslashes($site_url), "/"));
if (false !== $ismatch) { if (false !== $ismatch) {
//计算排名 //计算排名
$rank[$rank_flag] = $start + $k + 1; $rank[$rank_flag] = $start + $k + 1;
@ -531,6 +532,7 @@ class Keyworlds extends CI_Controller {
preg_match_all($match_fun, $response, $store); preg_match_all($match_fun, $response, $store);
foreach ($store[1] as $k => $v) { foreach ($store[1] as $k => $v) {
$start_s = stripos($v, $site_url); $start_s = stripos($v, $site_url);
$start_s = $start_s ? $start_s : stripos($v, addcslashes(addslashes($site_url), "/"));
if (false !== $start_s) { if (false !== $start_s) {
$rank[$rank_flag] = $startrank + $k + 1; $rank[$rank_flag] = $startrank + $k + 1;
$end_s = stripos($v, '" ', $start_s); $end_s = stripos($v, '" ', $start_s);

Loading…
Cancel
Save