Fix undeclared variable $rss when parsing atom feed

This commit is contained in:
Kijin Sung 2023-09-25 22:42:41 +09:00
parent 7cac909435
commit 23c5f66479

View file

@ -195,7 +195,7 @@ class content extends WidgetHandler
{ {
$obj->is_secret = 'N'; $obj->is_secret = 'N';
} }
// Get model object of the comment module and execute getCommentList() method // Get model object of the comment module and execute getCommentList() method
$oCommentModel = getModel('comment'); $oCommentModel = getModel('comment');
$output = $oCommentModel->getNewestCommentList($obj); $output = $oCommentModel->getNewestCommentList($obj);
@ -209,7 +209,7 @@ class content extends WidgetHandler
{ {
continue; continue;
} }
$attribute = $oComment->getObjectVars(); $attribute = $oComment->getObjectVars();
$title = $oComment->getSummary($args->content_cut_size); $title = $oComment->getSummary($args->content_cut_size);
$thumbnail = $oComment->getThumbnail($args->thumbnail_width,$args->thumbnail_height,$args->thumbnail_type); $thumbnail = $oComment->getThumbnail($args->thumbnail_width,$args->thumbnail_height,$args->thumbnail_type);
@ -259,7 +259,7 @@ class content extends WidgetHandler
{ {
$obj->order_type = $args->order_type=="desc"?"desc":"asc"; $obj->order_type = $args->order_type=="desc"?"desc":"asc";
} }
if($args->show_secret == 'Y') if($args->show_secret == 'Y')
{ {
$obj->statusList = array('PUBLIC', 'SECRET'); $obj->statusList = array('PUBLIC', 'SECRET');
@ -268,7 +268,7 @@ class content extends WidgetHandler
{ {
$obj->statusList = array('PUBLIC'); $obj->statusList = array('PUBLIC');
} }
$obj->list_count = $args->list_count * $args->page_count; $obj->list_count = $args->list_count * $args->page_count;
$output = executeQueryArray('widgets.content.getNewestDocuments', $obj); $output = executeQueryArray('widgets.content.getNewestDocuments', $obj);
if(!$output->toBool() || !$output->data) return; if(!$output->toBool() || !$output->data) return;
@ -464,16 +464,16 @@ class content extends WidgetHandler
{ {
// Remove tags // Remove tags
$content = strip_tags($content); $content = strip_tags($content);
// Convert temporarily html entity for truncate // Convert temporarily html entity for truncate
$content = html_entity_decode($content, ENT_QUOTES); $content = html_entity_decode($content, ENT_QUOTES);
// Replace all whitespaces to single space // Replace all whitespaces to single space
$content = utf8_trim(utf8_normalize_spaces($content)); $content = utf8_trim(utf8_normalize_spaces($content));
// Truncate string // Truncate string
$content = cut_str($content, $str_size, '...'); $content = cut_str($content, $str_size, '...');
return escape($content); return escape($content);
} }
@ -583,6 +583,7 @@ class content extends WidgetHandler
else if($xml_doc->feed && $xml_doc->feed->attrs->xmlns == 'http://www.w3.org/2005/Atom') else if($xml_doc->feed && $xml_doc->feed->attrs->xmlns == 'http://www.w3.org/2005/Atom')
{ {
// Atom 1.0 spec supported by misol // Atom 1.0 spec supported by misol
$rss = new stdClass;
$rss->title = $xml_doc->feed->title->body; $rss->title = $xml_doc->feed->title->body;
$links = $xml_doc->feed->link; $links = $xml_doc->feed->link;
if(is_array($links)) if(is_array($links))
@ -765,7 +766,7 @@ class content extends WidgetHandler
$widget_info->tab_type = $args->tab_type; $widget_info->tab_type = $args->tab_type;
$widget_info->markup_type = $args->markup_type; $widget_info->markup_type = $args->markup_type;
// If it is a tab type, list up tab items and change key value(module_srl) to index // If it is a tab type, list up tab items and change key value(module_srl) to index
if($args->tab_type != 'none' && $args->tab_type) if($args->tab_type != 'none' && $args->tab_type)
{ {
$tab = array(); $tab = array();
@ -967,7 +968,7 @@ class contentItem extends BaseObject
return $this->get('thumbnail_x' . intval($source_size)); return $this->get('thumbnail_x' . intval($source_size));
} }
} }
function getMemberSrl() function getMemberSrl()
{ {
return $this->get('member_srl'); return $this->get('member_srl');
} }