diff --git a/wp-includes/ID3/getid3.lib.php b/wp-includes/ID3/getid3.lib.php index ebdc569864..3a5983fc26 100644 --- a/wp-includes/ID3/getid3.lib.php +++ b/wp-includes/ID3/getid3.lib.php @@ -720,12 +720,18 @@ class getid3_lib */ public static function XML2array($XMLstring) { if (function_exists('simplexml_load_string') && function_exists('libxml_disable_entity_loader')) { - // http://websec.io/2012/08/27/Preventing-XEE-in-PHP.html - // https://core.trac.wordpress.org/changeset/29378 - $loader = libxml_disable_entity_loader(true); + if (PHP_VERSION_ID < 80000) { + // http://websec.io/2012/08/27/Preventing-XEE-in-PHP.html + // https://core.trac.wordpress.org/changeset/29378 + // This function has been deprecated in PHP 8.0 because in libxml 2.9.0, external entity loading is + // disabled by default, so this function is no longer needed to protect against XXE attacks. + $loader = libxml_disable_entity_loader(true); + } $XMLobject = simplexml_load_string($XMLstring, 'SimpleXMLElement', LIBXML_NOENT); $return = self::SimpleXMLelement2array($XMLobject); - libxml_disable_entity_loader($loader); + if (PHP_VERSION_ID < 80000 && isset($loader)) { + libxml_disable_entity_loader($loader); + } return $return; } return false; diff --git a/wp-includes/version.php b/wp-includes/version.php index 00c2762b63..193c9ff977 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.6-beta4-49620'; +$wp_version = '5.6-beta4-49621'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.