Disable external entity loading unconditionally #2556

This commit is contained in:
Kijin Sung 2025-05-22 22:58:28 +09:00
parent 2af43ee6a7
commit 464985b1ef

View file

@ -1120,6 +1120,14 @@ class Context
self::$_instance->security_check = 'DENY ALL';
self::$_instance->security_check_detail = 'ERR_UNSAFE_ENV';
}
if (PHP_VERSION_ID < 80000)
{
libxml_disable_entity_loader(true);
}
libxml_set_external_entity_loader(function($a, $b, $c) {
return null;
});
}
/**
@ -1261,10 +1269,6 @@ class Context
$GLOBALS['HTTP_RAW_POST_DATA'] = '';
return;
}
if (PHP_VERSION_ID < 80000)
{
libxml_disable_entity_loader(true);
}
$params = Rhymix\Framework\Parsers\XMLRPCParser::parse($GLOBALS['HTTP_RAW_POST_DATA']) ?: [];
}
elseif($request_method === 'JSON')