Version 4.7.0
This commit is contained in:
1 parent
517a5e1f70
commit
8ba7d43898
1933 files changed
+65613
-11332
No files matched your search
@@ -62,15 +62,22 @@ class _SimpleXML extends \SimpleXMLElement
|
||||
*/
|
||||
public static function loadString( $xml )
|
||||
{
|
||||
/* Turn off external entity loader to prevent XXE */
|
||||
$entityLoaderValue = libxml_disable_entity_loader( TRUE );
|
||||
|
||||
/* Load it */
|
||||
$class = @simplexml_load_string( $xml, \get_called_class() );
|
||||
|
||||
/* Turn external entity loader back to what it was before so we're not messing with other
|
||||
PHP scripts on this server */
|
||||
libxml_disable_entity_loader( $entityLoaderValue );
|
||||
if ( version_compare( PHP_VERSION, '8.0.0' ) >= 0 )
|
||||
{
|
||||
$class = @simplexml_load_string( $xml, \get_called_class() );
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Turn off external entity loader to prevent XXE in PHP less than 8.0 */
|
||||
$entityLoaderValue = libxml_disable_entity_loader( TRUE );
|
||||
|
||||
/* Load it */
|
||||
$class = @simplexml_load_string( $xml, \get_called_class() );
|
||||
|
||||
/* Turn external entity loader back to what it was before so we're not messing with other
|
||||
PHP scripts on this server */
|
||||
libxml_disable_entity_loader( $entityLoaderValue );
|
||||
}
|
||||
|
||||
/* Return */
|
||||
if ( $class === FALSE )
|
||||
|
||||
Reference in new issue
Block a user