From 8766d419a1fb7a24d0051e85f87af05e7ef87294 Mon Sep 17 00:00:00 2001 From: Stephan Vock Date: Wed, 13 Oct 2021 13:56:09 +0100 Subject: [PATCH] PHP8: remove disable entity loader --- lib/recurly/client.php | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/lib/recurly/client.php b/lib/recurly/client.php index 196b3a9b..c003313e 100644 --- a/lib/recurly/client.php +++ b/lib/recurly/client.php @@ -123,14 +123,17 @@ public static function apiUrl() { */ public static function disableXmlEntityLoading() { - $disable = getenv('RECURLY_DISABLE_ENTITY_LOADING'); - if ($disable === false) { - $disable = true; - } else { - $disable = (bool)$disable; + // As of libxml 2.9.0 entity substitution is disabled by default, so there is no need to disable the loading of external entities + if (LIBXML_VERSION < 20900) { + $disable = getenv('RECURLY_DISABLE_ENTITY_LOADING'); + if ($disable === false) { + $disable = true; + } else { + $disable = (bool)$disable; + } + + libxml_disable_entity_loader($disable); } - - libxml_disable_entity_loader($disable); } /**