From 3f6dbf847dfeed100e19924bb7f116642d24e177 Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Sun, 18 May 2025 22:04:18 +0900 Subject: [PATCH] Remove references to old XeXmlParser in widget module --- modules/widget/widget.controller.php | 7 ++----- modules/widget/widget.model.php | 10 ++++------ 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/modules/widget/widget.controller.php b/modules/widget/widget.controller.php index 0ba27cf30..4f87a6500 100644 --- a/modules/widget/widget.controller.php +++ b/modules/widget/widget.controller.php @@ -301,8 +301,7 @@ class WidgetController extends Widget function transWidgetBox($matches) { $buff = preg_replace('/
(.*)$/i','
',$matches[0]); - $oXmlParser = new XeXmlParser(); - $xml_doc = $oXmlParser->parse($buff); + $xml_doc = Rhymix\Framework\Parsers\XEXMLParser::loadXMLString($buff); $vars = $xml_doc->div->attrs; $widget = $vars->widget; @@ -324,13 +323,11 @@ class WidgetController extends Widget // Bringing widget cache sequence preg_match_all('!]*)widget=([^\>]*?)\>!is', $content, $matches); - $oXmlParser = new XeXmlParser(); - $cnt = count($matches[1]); for($i=0;$i<$cnt;$i++) { $buff = $matches[0][$i]; - $xml_doc = $oXmlParser->parse(trim($buff)); + $xml_doc = Rhymix\Framework\Parsers\XEXMLParser::loadXMLString(trim($buff)); $args = $xml_doc->img->attrs; $widget = $args->widget; if(!$args || !$widget || empty($args->widget_cache)) diff --git a/modules/widget/widget.model.php b/modules/widget/widget.model.php index cedf80bbc..78f5651be 100644 --- a/modules/widget/widget.model.php +++ b/modules/widget/widget.model.php @@ -137,9 +137,8 @@ class WidgetModel extends Widget return $widget_info; } // If no cache file exists, parse the xml and then return the variable. - $oXmlParser = new XeXmlParser(); - $tmp_xml_obj = $oXmlParser->loadXmlFile($xml_file); - $xml_obj = $tmp_xml_obj->widget; + $tmp_xml_obj = Rhymix\Framework\Parsers\XEXMLParser::loadXMLFile($xml_file); + $xml_obj = $tmp_xml_obj->widget ?? null; if(!$xml_obj) return; $buff = '$widget_info = new stdClass;'; @@ -287,9 +286,8 @@ class WidgetModel extends Widget return $widgetStyle_info; } // If no cache file exists, parse the xml and then return the variable. - $oXmlParser = new XeXmlParser(); - $tmp_xml_obj = $oXmlParser->loadXmlFile($xml_file); - $xml_obj = $tmp_xml_obj->widgetstyle; + $tmp_xml_obj = Rhymix\Framework\Parsers\XEXMLParser::loadXMLFile($xml_file); + $xml_obj = $tmp_xml_obj->widgetstyle ?? null; if(!$xml_obj) return; $buff = array();