From 9c2a3492427a1fa7b37758b7c30cf9c82ea047c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Wed, 18 Oct 2023 10:58:25 +0800 Subject: [PATCH] eee --- kiri-engine/Core/Xml.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/kiri-engine/Core/Xml.php b/kiri-engine/Core/Xml.php index 04d29f83..89e0ca64 100644 --- a/kiri-engine/Core/Xml.php +++ b/kiri-engine/Core/Xml.php @@ -26,11 +26,11 @@ class Xml */ public static function toArray($data, bool $asArray = true): object|array { - $data = simplexml_load_string($data, 'SimpleXMLElement', LIBXML_NOCDATA); + $data = \simplexml_load_string($data, 'SimpleXMLElement', LIBXML_NOCDATA); if ($data === false) { throw new Exception('Parameter format error.'); } - $array = get_object_vars($data); + $array = \get_object_vars($data); if (isset($array[0])) { $array[$data->getName()] = $array[0]; unset($array[0]); @@ -45,9 +45,9 @@ class Xml */ public static function isXml($str): object|bool|array { - $xml_parser = xml_parser_create(); - if (!xml_parse($xml_parser, $str, true)) { - xml_parser_free($xml_parser); + $xml_parser = \xml_parser_create(); + if (!\xml_parse($xml_parser, $str, true)) { + \xml_parser_free($xml_parser); return false; } else { return self::toArray($str);