WordPress.org

Make WordPress Core

Ticket #21990: 21990-subclass.2.diff

File 21990-subclass.2.diff, 1.1 KB (added by markjaquith, 9 years ago)

Doesn't touch SP files.

  • new file wp-includes/class-simplepie-kses.php

    diff --git a/wp-includes/class-simplepie-kses.php b/wp-includes/class-simplepie-kses.php
    new file mode 100644
    index 0000000..6a892ab
    - +  
     1<?php
     2
     3class WP_SimplePie_Sanitize_KSES extends SimplePie_Sanitize {
     4        public function sanitize( $data, $type, $base = '' ) {
     5                if ( $type & ( SIMPLEPIE_CONSTRUCT_HTML | SIMPLEPIE_CONSTRUCT_XHTML ) ) {
     6                        return wp_kses_post( $data );
     7                } else {
     8                        return parent::sanitize( $data, $type, $base );
     9                }
     10        }
     11}
  • wp-includes/feed.php

    diff --git a/wp-includes/feed.php b/wp-includes/feed.php
    index 262acd7..8274eb7 100644
    a b function feed_content_type( $type = '' ) { 
    525525 */
    526526function fetch_feed($url) {
    527527        require_once (ABSPATH . WPINC . '/class-feed.php');
     528        require_once (ABSPATH . WPINC . '/class-simplepie-kses.php');
    528529
    529530        $feed = new SimplePie();
    530531
     532        $feed->set_sanitize_class( 'WP_SimplePie_Sanitize_KSES' );
     533        $feed->sanitize = new WP_SimplePie_Sanitize_KSES();
    531534        $feed->set_cache_class( 'WP_Feed_Cache' );
    532535        $feed->set_file_class( 'WP_SimplePie_File' );
    533536