Make WordPress Core


Ignore:
Timestamp:
11/19/2006 07:56:05 AM (19 years ago)
Author:
ryan
Message:

Remove trailing spaces and convert spaces to tabs. Props Nazgul. fixes #986

File:
1 edited

Legend:

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

    r4399 r4495  
    1212define('MAGPIE_USER_AGENT', 'WordPress/' . $wp_version);
    1313
    14 class MagpieRSS { 
     14class MagpieRSS {
    1515    var $parser;
    1616    var $current_item   = array();  // item currently being parsed
     
    2626    var $inchannel          = false;
    2727    var $initem             = false;
    28     var $incontent          = false; // if in Atom <content mode="xml"> field 
     28    var $incontent          = false; // if in Atom <content mode="xml"> field
    2929    var $intextinput        = false;
    3030    var $inimage            = false;
     
    5555        #
    5656        xml_set_object( $this->parser, $this );
    57         xml_set_element_handler($this->parser, 
     57        xml_set_element_handler($this->parser,
    5858                'feed_start_element', 'feed_end_element' );
    5959
    60         xml_set_character_data_handler( $this->parser, 'feed_cdata' ); 
     60        xml_set_character_data_handler( $this->parser, 'feed_cdata' );
    6161
    6262        $status = xml_parse( $this->parser, $source );
     
    8686        $ns = false;
    8787        if ( strpos( $element, ':' ) ) {
    88             list($ns, $el) = split( ':', $element, 2); 
     88            list($ns, $el) = split( ':', $element, 2);
    8989        }
    9090        if ( $ns and $ns != 'rdf' ) {
     
    112112        }
    113113
    114         if ( $el == 'channel' ) 
     114        if ( $el == 'channel' )
    115115        {
    116116            $this->inchannel = true;
    117117        }
    118         elseif ($el == 'item' or $el == 'entry' ) 
     118        elseif ($el == 'item' or $el == 'entry' )
    119119        {
    120120            $this->initem = true;
     
    126126        // if we're in the default namespace of an RSS feed,
    127127        //  record textinput or image fields
    128         elseif ( 
    129             $this->feed_type == RSS and 
    130             $this->current_namespace == '' and 
    131             $el == 'textinput' ) 
     128        elseif (
     129            $this->feed_type == RSS and
     130            $this->current_namespace == '' and
     131            $el == 'textinput' )
    132132        {
    133133            $this->intextinput = true;
     
    135135
    136136        elseif (
    137             $this->feed_type == RSS and 
    138             $this->current_namespace == '' and 
    139             $el == 'image' ) 
     137            $this->feed_type == RSS and
     138            $this->current_namespace == '' and
     139            $el == 'image' )
    140140        {
    141141            $this->inimage = true;
     
    156156
    157157        // if inside an Atom content construct (e.g. content or summary) field treat tags as text
    158         elseif ($this->feed_type == ATOM and $this->incontent ) 
     158        elseif ($this->feed_type == ATOM and $this->incontent )
    159159        {
    160160            // if tags are inlined, then flatten
    161             $attrs_str = join(' ', 
    162                     array_map('map_attrs', 
    163                     array_keys($attrs), 
     161            $attrs_str = join(' ',
     162                    array_map('map_attrs',
     163                    array_keys($attrs),
    164164                    array_values($attrs) ) );
    165165
     
    173173        // as being equivalent to RSS's simple link element.
    174174        //
    175         elseif ($this->feed_type == ATOM and $el == 'link' ) 
    176         {
    177             if ( isset($attrs['rel']) and $attrs['rel'] == 'alternate' ) 
     175        elseif ($this->feed_type == ATOM and $el == 'link' )
     176        {
     177            if ( isset($attrs['rel']) and $attrs['rel'] == 'alternate' )
    178178            {
    179179                $link_el = 'link';
     
    195195    function feed_cdata ($p, $text) {
    196196
    197         if ($this->feed_type == ATOM and $this->incontent) 
     197        if ($this->feed_type == ATOM and $this->incontent)
    198198        {
    199199            $this->append_content( $text );
     
    208208        $el = strtolower($el);
    209209
    210         if ( $el == 'item' or $el == 'entry' ) 
     210        if ( $el == 'item' or $el == 'entry' )
    211211        {
    212212            $this->items[] = $this->current_item;
     
    214214            $this->initem = false;
    215215        }
    216         elseif ($this->feed_type == RSS and $this->current_namespace == '' and $el == 'textinput' ) 
     216        elseif ($this->feed_type == RSS and $this->current_namespace == '' and $el == 'textinput' )
    217217        {
    218218            $this->intextinput = false;
    219219        }
    220         elseif ($this->feed_type == RSS and $this->current_namespace == '' and $el == 'image' ) 
     220        elseif ($this->feed_type == RSS and $this->current_namespace == '' and $el == 'image' )
    221221        {
    222222            $this->inimage = false;
     
    226226            $this->incontent = false;
    227227        }
    228         elseif ($el == 'channel' or $el == 'feed' ) 
     228        elseif ($el == 'channel' or $el == 'feed' )
    229229        {
    230230            $this->inchannel = false;
     
    233233            // balance tags properly
    234234            // note:  i don't think this is actually neccessary
    235             if ( $this->stack[0] == $el ) 
     235            if ( $this->stack[0] == $el )
    236236            {
    237237                $this->append_content("</$el>");
     
    271271            return;
    272272        }
    273         if ( $this->current_namespace ) 
     273        if ( $this->current_namespace )
    274274        {
    275275            if ( $this->initem ) {
     
    396396            return false;
    397397        }
    398     } 
     398    }
    399399    // else cache is ON
    400400    else {
     
    473473                    # compensate for Snoopy's annoying habbit to tacking
    474474                    # on '\n'
    475                     $http_error = substr($resp->error, 0, -2); 
     475                    $http_error = substr($resp->error, 0, -2);
    476476                    $errormsg .= "(HTTP Error: $http_error)";
    477477                }
     
    614614}
    615615
    616 function is_info ($sc) { 
    617     return $sc >= 100 && $sc < 200; 
    618 }
    619 
    620 function is_success ($sc) { 
    621     return $sc >= 200 && $sc < 300; 
    622 }
    623 
    624 function is_redirect ($sc) { 
    625     return $sc >= 300 && $sc < 400; 
    626 }
    627 
    628 function is_error ($sc) { 
    629     return $sc >= 400 && $sc < 600; 
    630 }
    631 
    632 function is_client_error ($sc) { 
    633     return $sc >= 400 && $sc < 500; 
    634 }
    635 
    636 function is_server_error ($sc) { 
    637     return $sc >= 500 && $sc < 600; 
     616function is_info ($sc) {
     617    return $sc >= 100 && $sc < 200;
     618}
     619
     620function is_success ($sc) {
     621    return $sc >= 200 && $sc < 300;
     622}
     623
     624function is_redirect ($sc) {
     625    return $sc >= 300 && $sc < 400;
     626}
     627
     628function is_error ($sc) {
     629    return $sc >= 400 && $sc < 600;
     630}
     631
     632function is_client_error ($sc) {
     633    return $sc >= 400 && $sc < 500;
     634}
     635
     636function is_server_error ($sc) {
     637    return $sc >= 500 && $sc < 600;
    638638}
    639639
     
    686686
    687687        if ( ! get_option( $cache_option ) ) {
    688             $this->debug( 
     688            $this->debug(
    689689                "Cache doesn't contain: $url (cache option: $cache_option)"
    690690            );
     
    758758    function error ($errormsg, $lvl=E_USER_WARNING) {
    759759        // append PHP's error message if track_errors enabled
    760         if ( isset($php_errormsg) ) { 
     760        if ( isset($php_errormsg) ) {
    761761            $errormsg .= " ($php_errormsg)";
    762762        }
     
    782782
    783783    if ( preg_match( $pat, $date_str, $match ) ) {
    784         list( $year, $month, $day, $hours, $minutes, $seconds) = 
     784        list( $year, $month, $day, $hours, $minutes, $seconds) =
    785785            array( $match[1], $match[2], $match[3], $match[4], $match[5], $match[6]);
    786786
Note: See TracChangeset for help on using the changeset viewer.