WordPress.org

Make WordPress Core

Ticket #14584: 14584.diff

File 14584.diff, 2.2 KB (added by lavamind, 5 years ago)
  • export.php

    b a  
    137137                if ( seems_utf8( $str ) == false ) 
    138138                        $str = utf8_encode( $str ); 
    139139 
    140                 // $str = ent2ncr(esc_html($str)); 
     140                $str = html_entity_decode($str); 
    141141                $str = "<![CDATA[$str" . ( ( substr( $str, -1 ) == ']' ) ? ' ' : '') . "]]>"; 
    142142 
    143143                return $str; 
     
    263263                        $term_name = sanitize_term_field( 'name', $term->name, $term->term_id, $term->taxonomy, $filter ); 
    264264                        // Back compat. 
    265265                        if ( 'category' == $term->taxonomy ) 
    266                                 $the_list .= "\n\t\t<category><![CDATA[$term_name]]></category>\n"; 
     266                                $the_list .= "\n\t\t<category>" . wxr_cdata($term_name) . "</category>\n"; 
    267267                        elseif ( 'post_tag' == $term->taxonomy ) 
    268                                 $the_list .= "\n\t\t<category domain=\"$domain\"><![CDATA[$term_name]]></category>\n"; 
     268                                $the_list .= "\n\t\t<category domain=\"$domain\">" . wxr_cdata($term_name) . "</category>\n"; 
    269269                        // forwards compatibility as above 
    270                         $the_list .= "\n\t\t<category domain=\"$domain\" nicename=\"{$term->slug}\"><![CDATA[$term_name]]></category>\n"; 
     270                        $the_list .= "\n\t\t<category domain=\"$domain\" nicename=\"{$term->slug}\">" . wxr_cdata($term_name) . "</category>\n"; 
    271271                } 
    272272                echo $the_list; 
    273273        } 
     
    311311        <wp:base_site_url><?php echo wxr_site_url(); ?></wp:base_site_url> 
    312312        <wp:base_blog_url><?php bloginfo_rss( 'url' ); ?></wp:base_blog_url> 
    313313        <?php if ( $cats ) : foreach ( $cats as $c ) : ?> 
    314         <wp:category><wp:category_nicename><?php echo $c->slug; ?></wp:category_nicename><wp:category_parent><?php echo $c->parent ? $cats[$c->parent]->name : ''; ?></wp:category_parent><?php wxr_cat_name( $c ); ?><?php wxr_category_description( $c ); ?></wp:category> 
     314        <wp:category><wp:category_nicename><?php echo $c->slug; ?></wp:category_nicename><wp:category_parent><?php echo $c->parent ? wxr_cdata($cats[$c->parent]->name) : ''; ?></wp:category_parent><?php wxr_cat_name( $c ); ?><?php wxr_category_description( $c ); ?></wp:category> 
    315315        <?php endforeach; endif; ?> 
    316316        <?php if ( $tags ) : foreach ( $tags as $t ) : ?> 
    317317        <wp:tag><wp:tag_slug><?php echo $t->slug; ?></wp:tag_slug><?php wxr_tag_name( $t ); ?><?php wxr_tag_description( $t ); ?></wp:tag>