Make WordPress Core

Ticket #59731: 59731.patch

File 59731.patch, 976 bytes (added by mihirdev21, 3 years ago)

Patch added!

  • wp-includes/rss.php

    diff --git a/wp-includes/rss.php b/wp-includes/rss.php
    index 6d8941ab38..6371793d8b 100644
    a b class MagpieRSS { 
    338338        function normalize () {
    339339                // if atom populate rss fields
    340340                if ( $this->is_atom() ) {
     341                        $atom_items = count($this->items);
    341342                        $this->channel['description'] = $this->channel['tagline'];
    342                         for ( $i = 0; $i < count($this->items); $i++) {
     343                        for ( $i = 0; $i < $atom_items; $i++) {
    343344                                $item = $this->items[$i];
    344345                                if ( isset($item['summary']) )
    345346                                        $item['description'] = $item['summary'];
    class MagpieRSS { 
    350351                        }
    351352                }
    352353                elseif ( $this->is_rss() ) {
     354                        $rss_items = count($this->items);
    353355                        $this->channel['tagline'] = $this->channel['description'];
    354                         for ( $i = 0; $i < count($this->items); $i++) {
     356                        for ( $i = 0; $i < $rss_items; $i++) {
    355357                                $item = $this->items[$i];
    356358                                if ( isset($item['description']))
    357359                                        $item['summary'] = $item['description'];