Various fixes to improve PHP 8.0 compatibility

- XmlParser 클래스가 PHP 내장 클래스가 되어버려서 XeXmlParser로 변경
- 함수나 파라미터의 형태가 맞지 않아서 치명적인 오류 나는 곳 수정
- undefined 변수 및 배열 키 다수 수정 (치명적인 오류는 아님)
- 계속 수정중...
This commit is contained in:
Kijin Sung 2020-10-31 00:25:26 +09:00
parent 90084efd75
commit 8c161bc28d
38 changed files with 136 additions and 100 deletions

View file

@ -275,7 +275,7 @@ class widgetController extends widget
{
$buff = trim($matches[0]);
$oXmlParser = new XmlParser();
$oXmlParser = new XeXmlParser();
$xml_doc = $oXmlParser->parse(trim($buff));
if($xml_doc->img) $vars = $xml_doc->img->attrs;
@ -294,7 +294,7 @@ class widgetController extends widget
function transWidgetBox($matches)
{
$buff = preg_replace('/<div><div>(.*)$/i','</div>',$matches[0]);
$oXmlParser = new XmlParser();
$oXmlParser = new XeXmlParser();
$xml_doc = $oXmlParser->parse($buff);
$vars = $xml_doc->div->attrs;
@ -317,7 +317,7 @@ class widgetController extends widget
// Bringing widget cache sequence
preg_match_all('!<img([^\>]*)widget=([^\>]*?)\>!is', $content, $matches);
$oXmlParser = new XmlParser();
$oXmlParser = new XeXmlParser();
$cnt = count($matches[1]);
for($i=0;$i<$cnt;$i++)

View file

@ -137,7 +137,7 @@ class widgetModel extends widget
return $widget_info;
}
// If no cache file exists, parse the xml and then return the variable.
$oXmlParser = new XmlParser();
$oXmlParser = new XeXmlParser();
$tmp_xml_obj = $oXmlParser->loadXmlFile($xml_file);
$xml_obj = $tmp_xml_obj->widget;
if(!$xml_obj) return;
@ -207,6 +207,7 @@ class widgetModel extends widget
$extra_var_count = count($extra_vars);
$buff .= sprintf('$widget_info->extra_var_count = %d;', $extra_var_count);
$buff .= '$widget_info->extra_var = new stdClass;';
for($i=0;$i<$extra_var_count;$i++)
{
unset($var);
@ -279,7 +280,7 @@ class widgetModel extends widget
return $widgetStyle_info;
}
// If no cache file exists, parse the xml and then return the variable.
$oXmlParser = new XmlParser();
$oXmlParser = new XeXmlParser();
$tmp_xml_obj = $oXmlParser->loadXmlFile($xml_file);
$xml_obj = $tmp_xml_obj->widgetstyle;
if(!$xml_obj) return;