Changeset 5548

Show
Ignore:
Timestamp:
05/25/07 15:55:30 (1 year ago)
Author:
rob1n
Message:

Fix Atom feeds' categories. fixes #4307

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/2.2/wp-includes/feed.php

    r5134 r5548  
    152152    $the_list = ''; 
    153153    foreach ( (array) $categories as $category ) { 
    154         $category->cat_name = convert_chars($category->cat_name); 
     154        $cat_name = convert_chars($category->cat_name); 
    155155        if ( 'rdf' == $type ) 
    156             $the_list .= "\n\t\t<dc:subject><![CDATA[$category->cat_name]]></dc:subject>\n"; 
     156            $the_list .= "\n\t\t<dc:subject><![CDATA[$cat_name]]></dc:subject>\n"; 
    157157        if ( 'atom' == $type ) 
    158             $the_list .= "<category scheme='$home' term='$category->cat_name' />"
     158            $the_list .= sprintf( '<category scheme="%1$s" term="%2$s" />', attribute_escape( apply_filters( 'get_bloginfo_rss', get_bloginfo( 'url' ) ) ), attribute_escape( $category->cat_name ) )
    159159        else 
    160             $the_list .= "\n\t\t<category><![CDATA[$category->cat_name]]></category>\n"; 
     160            $the_list .= "\n\t\t<category><![CDATA[$cat_name]]></category>\n"; 
    161161    } 
    162162    return apply_filters('the_category_rss', $the_list, $type); 
  • trunk/wp-includes/feed.php

    r5134 r5548  
    152152    $the_list = ''; 
    153153    foreach ( (array) $categories as $category ) { 
    154         $category->cat_name = convert_chars($category->cat_name); 
     154        $cat_name = convert_chars($category->cat_name); 
    155155        if ( 'rdf' == $type ) 
    156             $the_list .= "\n\t\t<dc:subject><![CDATA[$category->cat_name]]></dc:subject>\n"; 
     156            $the_list .= "\n\t\t<dc:subject><![CDATA[$cat_name]]></dc:subject>\n"; 
    157157        if ( 'atom' == $type ) 
    158             $the_list .= "<category scheme='$home' term='$category->cat_name' />"
     158            $the_list .= sprintf( '<category scheme="%1$s" term="%2$s" />', attribute_escape( apply_filters( 'get_bloginfo_rss', get_bloginfo( 'url' ) ) ), attribute_escape( $category->cat_name ) )
    159159        else 
    160             $the_list .= "\n\t\t<category><![CDATA[$category->cat_name]]></category>\n"; 
     160            $the_list .= "\n\t\t<category><![CDATA[$cat_name]]></category>\n"; 
    161161    } 
    162162    return apply_filters('the_category_rss', $the_list, $type);