From 96c780e731f889ed3772a4c45f9eb4953f6b012e Mon Sep 17 00:00:00 2001 From: MatteoPistorello Date: Wed, 6 Apr 2022 11:07:18 +0200 Subject: [PATCH] Fix minore --- src/Util/XML.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/Util/XML.php b/src/Util/XML.php index 9f7c9ffd8..7f7b057d6 100755 --- a/src/Util/XML.php +++ b/src/Util/XML.php @@ -172,14 +172,16 @@ TXT; * * @return array */ - public static function forceArray($array) + public static function forceArray($value) { - if (!array_key_exists(0, $array)) { - $result = $array; - $array = []; - $array[0] = $result; + if (is_array($value)) { + if (!array_key_exists(0, $value)) { + $result = $value; + $value = []; + $value[0] = $result; + } } - return $array; + return $value; } }