Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../public_h.../clone/wp-inclu...
File: class-wp-simplepie-sanitize-kses.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* Feed API: WP_SimplePie_Sanitize_KSES class
[2] Fix | Delete
*
[3] Fix | Delete
* @package WordPress
[4] Fix | Delete
* @subpackage Feed
[5] Fix | Delete
* @since 4.7.0
[6] Fix | Delete
*/
[7] Fix | Delete
[8] Fix | Delete
/**
[9] Fix | Delete
* Core class used to implement SimplePie feed sanitization.
[10] Fix | Delete
*
[11] Fix | Delete
* Extends the SimplePie_Sanitize class to use KSES, because
[12] Fix | Delete
* we cannot universally count on DOMDocument being available.
[13] Fix | Delete
*
[14] Fix | Delete
* @since 3.5.0
[15] Fix | Delete
*/
[16] Fix | Delete
#[AllowDynamicProperties]
[17] Fix | Delete
class WP_SimplePie_Sanitize_KSES extends SimplePie_Sanitize {
[18] Fix | Delete
[19] Fix | Delete
/**
[20] Fix | Delete
* WordPress SimplePie sanitization using KSES.
[21] Fix | Delete
*
[22] Fix | Delete
* Sanitizes the incoming data, to ensure that it matches the type of data expected, using KSES.
[23] Fix | Delete
*
[24] Fix | Delete
* @since 3.5.0
[25] Fix | Delete
*
[26] Fix | Delete
* @param mixed $data The data that needs to be sanitized.
[27] Fix | Delete
* @param int $type The type of data that it's supposed to be.
[28] Fix | Delete
* @param string $base Optional. The `xml:base` value to use when converting relative
[29] Fix | Delete
* URLs to absolute ones. Default empty.
[30] Fix | Delete
* @return mixed Sanitized data.
[31] Fix | Delete
*/
[32] Fix | Delete
public function sanitize( $data, $type, $base = '' ) {
[33] Fix | Delete
$data = trim( $data );
[34] Fix | Delete
if ( $type & SIMPLEPIE_CONSTRUCT_MAYBE_HTML ) {
[35] Fix | Delete
if ( preg_match( '/(&(#(x[0-9a-fA-F]+|[0-9]+)|[a-zA-Z0-9]+)|<\/[A-Za-z][^\x09\x0A\x0B\x0C\x0D\x20\x2F\x3E]*' . SIMPLEPIE_PCRE_HTML_ATTRIBUTE . '>)/', $data ) ) {
[36] Fix | Delete
$type |= SIMPLEPIE_CONSTRUCT_HTML;
[37] Fix | Delete
} else {
[38] Fix | Delete
$type |= SIMPLEPIE_CONSTRUCT_TEXT;
[39] Fix | Delete
}
[40] Fix | Delete
}
[41] Fix | Delete
if ( $type & SIMPLEPIE_CONSTRUCT_BASE64 ) {
[42] Fix | Delete
$data = base64_decode( $data );
[43] Fix | Delete
}
[44] Fix | Delete
if ( $type & ( SIMPLEPIE_CONSTRUCT_HTML | SIMPLEPIE_CONSTRUCT_XHTML ) ) {
[45] Fix | Delete
$data = wp_kses_post( $data );
[46] Fix | Delete
if ( 'UTF-8' !== $this->output_encoding ) {
[47] Fix | Delete
$data = $this->registry->call( 'Misc', 'change_encoding', array( $data, 'UTF-8', $this->output_encoding ) );
[48] Fix | Delete
}
[49] Fix | Delete
return $data;
[50] Fix | Delete
} else {
[51] Fix | Delete
return parent::sanitize( $data, $type, $base );
[52] Fix | Delete
}
[53] Fix | Delete
}
[54] Fix | Delete
}
[55] Fix | Delete
[56] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function