mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-10-06 07:36:58 +00:00
General: Check to see that the PHP-XML module is enabled before using XML functions.
There are a handful of places where we don't check that the XML functions exist before we use them. Ubuntu's PHP 7 packages don't include PHP-XML by default, increasing the chance of this causing issues. Props kraftbj, markoheijnen. Fixes #37122. git-svn-id: https://develop.svn.wordpress.org/trunk@38883 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -44,6 +44,11 @@ class IXR_Message
|
||||
|
||||
function parse()
|
||||
{
|
||||
if ( ! function_exists( 'xml_parser_create' ) ) {
|
||||
trigger_error( __( "PHP's XML extension is not available. Please contact your hosting provider to enable PHP's XML" ) );
|
||||
return false;
|
||||
}
|
||||
|
||||
// first remove the XML declaration
|
||||
// merged from WP #10698 - this method avoids the RAM usage of preg_replace on very large messages
|
||||
$header = preg_replace( '/<\?xml.*?\?'.'>/s', '', substr( $this->message, 0, 100 ), 1 );
|
||||
|
||||
Reference in New Issue
Block a user