温馨提醒
如果文章内容或图片资源失效,请留言反馈,我们会及时处理,谢谢
本文最后更新于2023年12月4日,已超过 180天没有更新
1、修改 include/dedecollection.class.php
//自动分析关键字和摘要
preg_match("/<meta[s]+name=['"]keywords['"] content=['"](.*)['"]/isU",$this->tmpHtml,$inarr);
preg_match("/<meta[s]+content=['"](.*)['"] name=['"]keywords['"]/isU",$this->tmpHtml,$inarr2);
if(!isset($inarr[1]) && isset($inarr2[1]))
{
$inarr[1] = $inarr2[1];
}
用下面一段代码替换上面的
//自动分析关键字和摘要
preg_match("/<meta[s]+name=['"]keywords['"] content=['"](.*)['"]/isU",$this->tmpHtml,$inarr);
preg_match("/<meta[s]+content=['"](.*)['"] name=['"]keywords['"]/isU",$this->tmpHtml,$inarr2);
preg_match("/<meta[s]+name=keywords content=['"](.*)['"]/isU",$this->tmpHtml,$inarr3);
if(!isset($inarr[1]) && isset($inarr2[1]))
{
$inarr[1] = $inarr2[1];
}
if(!isset($inarr[1]) && isset($inarr3[1]))
{
$inarr[1] = $inarr3[1];
}
改了上面的, 还有另一个地方需要修改的
preg_match("/<meta[s]+name=['"]description['"] content=['"](.*)['"]/isU",$this->tmpHtml,$inarr);
preg_match("/<meta[s]+content=['"](.*)['"] name=['"]description['"]/isU",$this->tmpHtml,$inarr2);
if(!isset($inarr[1]) && isset($inarr2[1]))
{
$inarr[1] = $inarr2[1];
}
用下面的代码替换掉上面的:
preg_match("/<meta[s]+name=['"]description['"] content=['"](.*)['"]/isU",$this->tmpHtml,$inarr);
preg_match("/<meta[s]+content=['"](.*)['"] name=['"]description['"]/isU",$this->tmpHtml,$inarr2);
preg_match("/<meta[s]+name=description content=['"](.*)['"]/isU",$this->tmpHtml,$inarr3);
if(!isset($inarr[1]) && isset($inarr2[1]))
{
$inarr[1] = $inarr2[1];
}
if(!isset($inarr[1]) && isset($inarr3[1]))
{
$inarr[1] = $inarr3[1];
}
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系客服QQ3387285338进行处理。


评论0+