External libraries: Include upstream GetID3 fix for PHP 8.

Props jrf, xknown.
Built from https://develop.svn.wordpress.org/trunk@50714


git-svn-id: http://core.svn.wordpress.org/trunk@50323 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
desrosj 2021-04-14 23:10:04 +00:00
parent b7280388d6
commit ac930e0e5f
2 changed files with 7 additions and 11 deletions

View File

@ -720,18 +720,14 @@ class getid3_lib
*/ */
public static function XML2array($XMLstring) { public static function XML2array($XMLstring) {
if (function_exists('simplexml_load_string') && function_exists('libxml_disable_entity_loader')) { if (function_exists('simplexml_load_string') && function_exists('libxml_disable_entity_loader')) {
if (PHP_VERSION_ID < 80000) {
// http://websec.io/2012/08/27/Preventing-XEE-in-PHP.html // http://websec.io/2012/08/27/Preventing-XEE-in-PHP.html
// https://core.trac.wordpress.org/changeset/29378 // 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 // 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. // disabled by default, but is still needed when LIBXML_NOENT is used.
$loader = libxml_disable_entity_loader(true); $loader = @libxml_disable_entity_loader(true);
}
$XMLobject = simplexml_load_string($XMLstring, 'SimpleXMLElement', LIBXML_NOENT); $XMLobject = simplexml_load_string($XMLstring, 'SimpleXMLElement', LIBXML_NOENT);
$return = self::SimpleXMLelement2array($XMLobject); $return = self::SimpleXMLelement2array($XMLobject);
if (PHP_VERSION_ID < 80000 && isset($loader)) { @libxml_disable_entity_loader($loader);
libxml_disable_entity_loader($loader);
}
return $return; return $return;
} }
return false; return false;

View File

@ -13,7 +13,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '5.8-alpha-50713'; $wp_version = '5.8-alpha-50714';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.