Version 4.6.0
This commit is contained in:
1 parent
f79dcf067a
commit
517a5e1f70
2036 files changed
+110041
-26162
No files matched your search
@@ -45,6 +45,12 @@ class _DOMDocument extends \DOMDocument
|
||||
public function loadHTML( $source, $options=0 )
|
||||
{
|
||||
libxml_use_internal_errors( TRUE );
|
||||
|
||||
/* Disabling the entity loader is not required in PHP 8 and is deprecated */
|
||||
if( version_compare( PHP_VERSION, '8.0.0', '>=' ) )
|
||||
{
|
||||
return parent::loadHTML( $source, $options );
|
||||
}
|
||||
|
||||
/* Turn off external entity loader to prevent XXE */
|
||||
$entityLoaderValue = libxml_disable_entity_loader( TRUE );
|
||||
@@ -83,6 +89,12 @@ class _DOMDocument extends \DOMDocument
|
||||
public function loadXML( $source, $options=0 )
|
||||
{
|
||||
libxml_use_internal_errors( TRUE );
|
||||
|
||||
/* Disabling the entity loader is not required in PHP 8 and is deprecated */
|
||||
if( version_compare( PHP_VERSION, '8.0.0', '>=' ) )
|
||||
{
|
||||
return parent::loadXML( $source, $options );
|
||||
}
|
||||
|
||||
/* Turn off external entity loader to prevent XXE */
|
||||
$entityLoaderValue = libxml_disable_entity_loader( TRUE );
|
||||
@@ -106,6 +118,6 @@ class _DOMDocument extends \DOMDocument
|
||||
*/
|
||||
static public function wrapHtml( $content )
|
||||
{
|
||||
return "<!DOCTYPE html><head><meta http-equiv='Content-Type' content='text/html; charset=utf-8'/></head>" . $content;
|
||||
return "<!DOCTYPE html><html><head><meta http-equiv='Content-Type' content='text/html; charset=utf-8'/></head><body>" . $content. "</body></html>";
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user