1From 26c59f5ce7fac44150e5986cef33808c79cd9ded Mon Sep 17 00:00:00 2001
2From: Carl Schwan <carl@carlschwan.eu>
3Date: Wed, 22 Sep 2021 10:05:41 +0200
4Subject: [PATCH] Use libxml version instead of PHP version before calling
5 libxml_disable_entity_loader
6
7In some cases older version of php 7.4 are using libxml > 2.9.0 so use
8the libxml version instad of the php 8.0 to see if the call of libxml is
9useful.
10
11Otherwise this creates some warning.
12
13Signed-off-by: Carl Schwan <carl@carlschwan.eu>
14---
15 lib/Reader.php | 2 +-
16 1 file changed, 1 insertion(+), 1 deletion(-)
17
18diff --git a/lib/Reader.php b/lib/Reader.php
19index 368e8ff..1a27af7 100644
20--- a/lib/Reader.php
21+++ b/lib/Reader.php
22@@ -56,7 +56,7 @@ public function getClark()
23     public function parse(): array
24     {
25         $previousEntityState = null;
26-        $shouldCallLibxmlDisableEntityLoader = (\PHP_VERSION_ID < 80000);
27+        $shouldCallLibxmlDisableEntityLoader = (\LIBXML_VERSION < 20900);
28         if ($shouldCallLibxmlDisableEntityLoader) {
29             $previousEntityState = libxml_disable_entity_loader(true);
30         }
31