Index: wp-includes/rss.php =================================================================== --- wp-includes/rss.php (revision 8856) +++ wp-includes/rss.php (working copy) @@ -37,6 +37,7 @@ var $inchannel = false; var $initem = false; var $incontent = false; // if in Atom field + var $insource = false; // if in Atom field var $intextinput = false; var $inimage = false; var $current_field = ''; @@ -153,6 +154,11 @@ } # handle atom content constructs + # google reader fix: added 'source' handler to avoid detecting (and thus storing) 'title' again inside such blocks + elseif ( $this->feed_type == ATOM and $el == 'source' ) + { + $this->insource = true; + } elseif ( $this->feed_type == ATOM and in_array($el, $this->_CONTENT_CONSTRUCTS) ) { // avoid clashing w/ RSS mod_content @@ -168,6 +174,8 @@ // if inside an Atom content construct (e.g. content or summary) field treat tags as text elseif ($this->feed_type == ATOM and $this->incontent ) { + if (!$this->insource) # google reader fix: don't mind anything from + { // if tags are inlined, then flatten $attrs_str = join(' ', array_map('map_attrs', @@ -177,6 +185,7 @@ $this->append_content( "<$element $attrs_str>" ); array_unshift( $this->stack, $el ); + } } // Atom support many links per containging element. @@ -185,6 +194,8 @@ // elseif ($this->feed_type == ATOM and $el == 'link' ) { + if (!$this->insource) # google reader fix: don't mind anything from + { if ( isset($attrs['rel']) and $attrs['rel'] == 'alternate' ) { $link_el = 'link'; @@ -194,6 +205,7 @@ } $this->append($link_el, $attrs['href']); + } } // set stack[0] to current element else { @@ -207,7 +219,10 @@ if ($this->feed_type == ATOM and $this->incontent) { - $this->append_content( $text ); + if (!$this->insource) # google reader fix: don't mind anything from + { + $this->append_content( $text ); + } } else { $current_el = join('_', array_reverse($this->stack)); @@ -240,9 +255,15 @@ { $this->inchannel = false; } - elseif ($this->feed_type == ATOM and $this->incontent ) { + elseif ($this->feed_type == ATOM and $el == 'source') + { + $this->insource = false; + } + elseif ($this->feed_type == ATOM and $this->incontent ) { // balance tags properly // note: i don't think this is actually neccessary + if (!$this->insource) # google reader fix: don't mind anything from + { if ( $this->stack[0] == $el ) { $this->append_content(""); @@ -252,6 +273,7 @@ } array_shift( $this->stack ); + } } else { array_shift( $this->stack ); @@ -360,7 +382,11 @@ function is_atom() { if ( $this->feed_type == ATOM ) { - return $this->feed_version; + # google reader fix: feed version may be blank + if ($this->feed_version) + return $this->feed_version; + else + return 1; } else { return false;