Ticket #1207: 1207b.diff

File 1207b.diff, 2.4 KB (added by mdawaffe, 5 years ago)

alt, logic cleanup, formatting

  • wp-includes/classes.php

     
    575575        function start_el($output, $category, $depth, $args) { 
    576576                extract($args); 
    577577 
    578                 $link = '<a href="' . get_category_link($category->cat_ID) . '" '; 
     578                $cat_name = wp_specialchars( $category->cat_name, 1 ); 
     579                $link = '<a href="' . get_category_link( $category->cat_ID ) . '" '; 
    579580                if ( $use_desc_for_title == 0 || empty($category->category_description) ) 
    580                         $link .= 'title="'. sprintf(__("View all posts filed under %s"), wp_specialchars($category->cat_name, 1)) . '"'; 
     581                        $link .= 'title="' . sprintf(__( 'View all posts filed under %s' ), $cat_name) . '"'; 
    581582                else 
    582                         $link .= 'title="' . wp_specialchars(apply_filters('category_description',$category->category_description,$category),1) . '"'; 
     583                        $link .= 'title="' . wp_specialchars( apply_filters( 'category_description', $category->category_description, $category ), 1 ) . '"'; 
    583584                $link .= '>'; 
    584                 $link .= apply_filters('list_cats', $category->cat_name, $category).'</a>'; 
     585                $link .= apply_filters( 'list_cats', $category->cat_name, $category ).'</a>'; 
    585586 
    586587                if ( (! empty($feed_image)) || (! empty($feed)) ) { 
    587588                        $link .= ' '; 
     
    589590                        if ( empty($feed_image) ) 
    590591                                $link .= '('; 
    591592 
    592                         $link .= '<a href="' . get_category_rss_link(0, $category->cat_ID, $category->category_nicename) . '"'; 
     593                        $link .= '<a href="' . get_category_rss_link( 0, $category->cat_ID, $category->category_nicename ) . '"'; 
    593594 
    594                         if ( !empty($feed) ) { 
     595                        if ( emtpy($feed) ) 
     596                                $alt = ' alt="' . sprintf(__( 'Feed for all posts filed under %s' ), $cat_name ) . '"'; 
     597                        else { 
    595598                                $title = ' title="' . $feed . '"'; 
    596599                                $alt = ' alt="' . $feed . '"'; 
    597600                                $name = $feed; 
     
    600603 
    601604                        $link .= '>'; 
    602605 
    603                         if ( !empty($feed_image) ) 
    604                                 $link .= "<img src='$feed_image' $alt$title" . ' />'; 
     606                        if ( empty($feed_image) ) 
     607                                $link .= $name; 
    605608                        else 
    606                                 $link .= $name; 
     609                                $link .= "<img src='$feed_image'$alt$title" . ' />'; 
    607610                        $link .= '</a>'; 
    608                         if (empty($feed_image)) 
     611                        if ( empty($feed_image) ) 
    609612                                $link .= ')'; 
    610613                } 
    611614         
    612615                if ( isset($show_count) && $show_count ) 
    613                         $link .= ' ('.intval($category->category_count).')'; 
     616                        $link .= ' (' . intval($category->category_count) . ')'; 
    614617         
    615618                if ( isset($show_date) && $show_date ) { 
    616619                        $link .= ' ' . gmdate('Y-m-d', $category->last_update_timestamp);