Changeset 10739 for trunk/wp-includes/widgets.php
- Timestamp:
- 03/07/2009 07:44:28 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/widgets.php
r10712 r10739 1542 1542 1543 1543 $url = $options[$number]['url']; 1544 while ( str str($url, 'http') != $url )1544 while ( stristr($url, 'http') != $url ) 1545 1545 $url = substr($url, 1); 1546 1546 if ( empty($url) ) … … 1548 1548 1549 1549 $rss = fetch_feed($url); 1550 $link = clean_url(strip_tags($rss->get_permalink()));1551 while ( strstr($link, 'http') != $link )1552 $link = substr($link, 1);1553 $desc = attribute_escape(strip_tags(html_entity_decode($rss->get_description(), ENT_QUOTES, get_option('blog_charset'))));1554 1550 $title = $options[$number]['title']; 1555 if ( empty($title) ) 1556 $title = htmlentities(strip_tags($rss->get_title())); 1551 $desc = ''; 1552 $link = ''; 1553 if ( ! is_wp_error($rss) ) { 1554 $desc = attribute_escape(strip_tags(html_entity_decode($rss->get_description(), ENT_QUOTES, get_option('blog_charset')))); 1555 if ( empty($title) ) 1556 $title = htmlentities(strip_tags($rss->get_title())); 1557 $link = clean_url(strip_tags($rss->get_permalink())); 1558 while ( stristr($link, 'http') != $link ) 1559 $link = substr($link, 1); 1560 } 1557 1561 if ( empty($title) ) 1558 1562 $title = $desc; … … 1561 1565 $title = apply_filters('widget_title', $title ); 1562 1566 $url = clean_url(strip_tags($url)); 1563 if ( file_exists(dirname(__FILE__) . '/rss.png') ) 1564 $icon = str_replace(ABSPATH, site_url() . '/', dirname(__FILE__)) . '/rss.png'; 1565 else 1566 $icon = includes_url('images/rss.png'); 1567 $icon = includes_url('images/rss.png'); 1567 1568 $title = "<a class='rsswidget' href='$url' title='" . attribute_escape(__('Syndicate this content')) ."'><img style='background:orange;color:white;border:none;' width='14' height='14' src='$icon' alt='RSS' /></a> <a class='rsswidget' href='$link' title='$desc'>$title</a>"; 1568 1569 … … 1585 1586 function wp_widget_rss_output( $rss, $args = array() ) { 1586 1587 if ( is_string( $rss ) ) { 1587 if ( !$rss = fetch_feed($rss) ) 1588 return; 1588 $rss = fetch_feed($rss); 1589 1589 } elseif ( is_array($rss) && isset($rss['url']) ) { 1590 1590 $args = $rss; 1591 if ( !$rss = fetch_feed($rss['url']) ) 1592 return; 1591 $rss = fetch_feed($rss['url']); 1593 1592 } elseif ( !is_object($rss) ) { 1594 1593 return; … … 1623 1622 foreach ( $rss->get_items(0, $items) as $item ) { 1624 1623 $link = $item->get_link(); 1625 while ( str str($link, 'http') != $link )1624 while ( stristr($link, 'http') != $link ) 1626 1625 $link = substr($link, 1); 1627 1626 $link = clean_url(strip_tags($link)); … … 1855 1854 $error = false; 1856 1855 $link = ''; 1857 if ( !is_object($rss) ) {1856 if ( is_wp_error($rss) ) { 1858 1857 $url = wp_specialchars(__('Error: could not find an RSS or ATOM feed at that URL.'), 1); 1859 1858 $error = sprintf(__('Error in RSS %1$d'), $widget_number ); 1860 1859 } else { 1861 1860 $link = clean_url(strip_tags($rss->get_permalink())); 1862 while ( str str($link, 'http') != $link )1861 while ( stristr($link, 'http') != $link ) 1863 1862 $link = substr($link, 1); 1864 1863 }
Note: See TracChangeset
for help on using the changeset viewer.