Make WordPress Core


Ignore:
Timestamp:
08/29/2007 05:28:07 PM (17 years ago)
Author:
westi
Message:

Fix xhtml output for RSS widget when feed contains no items. Fixed #4671 props brettz95 and Nazgul

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/widgets.php

    r5960 r5968  
    967967        <?php echo $before_widget; ?>
    968968            <?php $title ? print($before_title . $title . $after_title) : null; ?>
    969             <ul>
    970 <?php
    971     if ( is_array( $rss->items ) ) {
     969<?php
     970    if ( is_array( $rss->items ) && !empty( $rss->items ) ) {
    972971        $rss->items = array_slice($rss->items, 0, $num_items);
     972        echo '<ul>';
    973973        foreach ($rss->items as $item ) {
    974974            while ( strstr($item['link'], 'http') != $item['link'] )
     
    988988            echo "<li><a class='rsswidget' href='$link' title='$desc'>$title</a>$summary</li>";
    989989        }
     990        echo '</ul>';
    990991    } else {
    991         echo '<li>' . __( 'An error has occurred; the feed is probably down. Try again later.' ) . '</li>';
    992     }
    993 ?>
    994             </ul>
    995         <?php echo $after_widget; ?>
    996 <?php
     992        echo '<ul><li>' . __( 'An error has occurred; the feed is probably down. Try again later.' ) . '</li></ul>';
     993    }
     994   
     995    echo $after_widget;
    997996}
    998997
Note: See TracChangeset for help on using the changeset viewer.