Skip to content

Commit b1a7cb5

Browse files
committed
more phg8 compat
1 parent 6f9229e commit b1a7cb5

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

lib/aws-sdk/Guzzle/Http/Message/Response.php

+8-2
Original file line numberDiff line numberDiff line change
@@ -879,7 +879,10 @@ public function xml()
879879
{
880880
$errorMessage = null;
881881
$internalErrors = libxml_use_internal_errors(true);
882-
$disableEntities = libxml_disable_entity_loader(true);
882+
$disableEntities = true;
883+
if (\PHP_VERSION_ID < 80000) {
884+
$disableEntities = libxml_disable_entity_loader(true);
885+
}
883886
libxml_clear_errors();
884887

885888
try {
@@ -893,7 +896,10 @@ public function xml()
893896

894897
libxml_clear_errors();
895898
libxml_use_internal_errors($internalErrors);
896-
libxml_disable_entity_loader($disableEntities);
899+
900+
if (\PHP_VERSION_ID < 80000) {
901+
libxml_disable_entity_loader($disableEntities);
902+
}
897903

898904
if ($errorMessage) {
899905
throw new RuntimeException('Unable to parse response body into XML: ' . $errorMessage);

0 commit comments

Comments
 (0)