#51 preg_match()를 substr_compare() 또는 strncmp()로 대체

This commit is contained in:
bnu 2013-11-22 12:50:01 +09:00
parent 681a9b2d07
commit 63e0fd6f3b
20 changed files with 68 additions and 61 deletions

View file

@ -553,20 +553,17 @@ class mcontent extends WidgetHandler
$content_item->setTitle($item->title);
$content_item->setNickName(max($item->author,$item->{'dc:creator'}));
$content_item->setAuthorSite($value->author->uri->body);
//$content_item->setCategory($item->category);
$item->description = preg_replace('!<a href=!is','<a onclick="window.open(this.href);return false" href=', $item->content);
if($item->description)
$item->description = ($item->content) ? $item->content : $item->description = $item->summary;
$item->description = preg_replace('!<a href=!is','<a onclick="window.open(this.href);return false" href=', $item->description);
if(($item->content && stripos($value->content->attrs->type, "html") === FALSE) || (!$item->content && stripos($value->summary->attrs->type, "html") === FALSE))
{
if(!preg_match("/html/i", $value->content->attrs->type)) $item->description = htmlspecialchars($item->description, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
}
if(!$item->description)
{
$item->description = $item->summary;
if($item->description)
{
if(!preg_match("/html/i", $value->summary->attrs->type)) $item->description = htmlspecialchars($item->description, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
}
$item->description = htmlspecialchars($item->description, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
}
$content_item->setContent($this->_getSummary($item->description, $args->content_cut_size));
$content_item->setLink($item->link);
$date = date('YmdHis', strtotime(max($item->published,$item->updated,$item->{'dc:date'})));