wip
This commit is contained in:
@@ -599,7 +599,11 @@ function prep_atom_text_construct( $data ) {
|
||||
$parser = xml_parser_create();
|
||||
xml_parse( $parser, '<div>' . $data . '</div>', true );
|
||||
$code = xml_get_error_code( $parser );
|
||||
xml_parser_free( $parser );
|
||||
|
||||
if ( PHP_VERSION_ID < 80000 ) { // xml_parser_free() has no effect as of PHP 8.0.
|
||||
xml_parser_free( $parser );
|
||||
}
|
||||
|
||||
unset( $parser );
|
||||
|
||||
if ( ! $code ) {
|
||||
@@ -808,7 +812,8 @@ function fetch_feed( $url ) {
|
||||
|
||||
$feed = new SimplePie\SimplePie();
|
||||
|
||||
$feed->set_sanitize_class( 'WP_SimplePie_Sanitize_KSES' );
|
||||
$feed->get_registry()->register( SimplePie\Sanitize::class, 'WP_SimplePie_Sanitize_KSES', true );
|
||||
|
||||
/*
|
||||
* We must manually overwrite $feed->sanitize because SimplePie's constructor
|
||||
* sets it before we have a chance to set the sanitization class.
|
||||
@@ -825,7 +830,7 @@ function fetch_feed( $url ) {
|
||||
$feed->set_cache_class( 'WP_Feed_Cache' );
|
||||
}
|
||||
|
||||
$feed->set_file_class( 'WP_SimplePie_File' );
|
||||
$feed->get_registry()->register( SimplePie\File::class, 'WP_SimplePie_File', true );
|
||||
|
||||
$feed->set_feed_url( $url );
|
||||
/** This filter is documented in wp-includes/class-wp-feed-cache-transient.php */
|
||||
|
||||
Reference in New Issue
Block a user