• So I am having trouble validating my podcast feed. I have some DIV and other html in the podcast description to embed some Bible references and a PDF of the sermon slides. But the feed doesn’t validate because of them. So the html is not being stripped from my podcast XML as described. Is there anyway to tell it to ignore this?

    The specific tags showing in the itunes summary is <div> and <iframe>.

    • This topic was modified 8 years, 2 months ago by themps.
Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter themps

    (@themps)

    So I take it I’m the only one that html is not being stripped out of the description and getting delisted from podcast stores and directories because the feed is not validating?

    Hello themps,

    This forum doesn’t get a lot of traffic. I am aware of your issue and we are considering adding code to SM (sermon manager) that specifically removes formatting tags from the summary when generating the XML but currently SM does not do that by default. Use only text in the summary field.

    Thread Starter themps

    (@themps)

    Thanks Allen! So this is actually the itunes:summary part of the XML that I’m talking about. It worked fine and validated with the html previously then at the end of July (i think) it was being rejected by iTunes. I looked at the code and it looks like it is supposed to stripping html

    ‘podcast-functions.php’

    // add itunes specific info to each item
    function wpfc_podcast_add_item(){
    	
    	global $post;
    	
        $audio = get_post_meta($post->ID, 'sermon_audio', 'true');
    	$speaker = strip_tags( get_the_term_list( $post->ID, 'wpfc_preacher', '', ' & ', '' ) );
    	$series = strip_tags( get_the_term_list( $post->ID, 'wpfc_sermon_series', '', ', ', '' ) );
    	// Sermon Topics
    	$topic_list = wp_get_post_terms( get_the_ID() , 'wpfc_sermon_topics' );
    	$topics = false;
    	if( $topic_list && count( $topic_list ) > 0 ) {
    		$c = 0;
    		foreach( $topic_list as $t ) {
    			if( $c == 0 ) {
    				$topics = esc_html( $t->name );
    				++$c;
    			} else {
    				$topics .= ', ' . esc_html( $t->name );
    			}
    		}
    	}
    
    	$post_image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'large' );
    	$post_image = ( $post_image ) ? $post_image['0'] : null;
    	//$enclosure = get_post_meta($post->ID, 'enclosure', 'true');
    	
    
    	$audio_duration = get_post_meta($post->ID, '_wpfc_sermon_duration', 'true');
    	if ($audio_duration == '' ) $audio_duration = '0:00'; //zero if undefined
    	?>
    	<itunes:author><?php echo $speaker ?></itunes:author>
    	<itunes:subtitle><?php echo $series ?></itunes:subtitle>
    	<itunes:summary><?php wp_filter_nohtml_kses( wpfc_sermon_meta('sermon_description') ); ?></itunes:summary>
    	<?php if ( $post_image ) : ?>
    	<itunes:image href="<?php echo $post_image; ?>" />
    	<?php endif; ?>
    	<?php if ( $audio !== '' ) : ?>
    		<enclosure url="<?php echo $audio; ?>" length="0" type="audio/mpeg"/>
    	<?php endif; ?>
    	<itunes:duration><?php echo esc_html( $audio_duration ); ?></itunes:duration>
    	<?php if( $topics ) { ?>
    		<itunes:keywords><?php echo esc_html( $topics ); ?></itunes:keywords>
    	<?php } 
    }

    and also in the podcast-feed.php

    Thread Starter themps

    (@themps)

    It’s like wp_filter_nohtml_kses is broken?

    podcast-functions.php is non-referenced file that ultimately needs to be removed from future versions. The original dev was using functions from there but not anymore. Everything that happens to XML happens in podcast-feed.php

    FYI

    retract that…i meant podcast-feed.php is the old one.

    Thread Starter themps

    (@themps)

    Oh okay. So podcast-functions is still in use? That was first one I referenced with the code. It seems as though it’s trying to filter the html with use of wordpress’s wp_filter_nohtml_kses but the end result shows every html code in the description which then invalidates the feed. I wish I could just leave the desription as text but at this point it’s stuck in my presentation so it’s either no podcast or have only the audio on the page without the active content. I find it strange that it started happening all the sudden when it was working fine before. Any ideas? I’m fully willing to play guinea pig. I know how to restore if it goes south haha.

    • This reply was modified 8 years, 1 month ago by themps.
    Thread Starter themps

    (@themps)

    So I just checked the php in podcast-functions again. (I’m not a coder so bear with me)

    It definately is supposed to be stripping out the html wp_filter_nohtml_kses is listed in the podcast functions. Which is a standard built into wordpress function. Is it possible SM isn’t using it correctly somehow?

    Thread Starter themps

    (@themps)

    So…is there any hope this will be fixed at any point? the html strip function isn’t doing anything.

    Thanks!

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Podcast feed HTML strip’ is closed to new replies.