Make WordPress Core

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#30693 closed defect (bug) (wontfix)

feed-rss2.php redundancy

Reported by: clodromanean's profile clodromanean Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.0.1
Component: Feeds Keywords:
Focuses: template Cc:

Description (last modified by TobiasBg)

In feed-rss2.php there is the following code segment starting on line 90:

<?php if (get_option('rss_use_excerpt')) : ?>
		<description><![CDATA[<?php the_excerpt_rss(); ?>]]></description>
<?php else : ?>
		<description><![CDATA[<?php the_excerpt_rss(); ?>]]></description>

The if and else actions are the same. The statement after the else should be something else, or if unnecessary, should be removed.

Change History (4)

#1 @TobiasBg
10 years ago

  • Component changed from General to Feeds
  • Description modified (diff)
  • Focuses template added
  • Keywords needs-patch good-first-bug 2nd-opinion added

Thanks for your report and for contributing to WordPress core!

There's actually another if/else-block coming after the the else that you mention (six lines of code, down to the line <?php endif; ?>). Thus, the if and else actions are in fact different here.

Now, there is a redundancy with the <description><![CDATA[<?php the_excerpt_rss(); ?>]]></description> line, which technically could be moved out of this if/else check. I don't really think that this brings advantages here though. It might just make the code harder to comprehend.

Of course, if you want, create a patch for this and I'm sure a core committer will take a second look! :-)

#2 @clodromanean
10 years ago

My bad. There was some indentation that threw me off. Everything is correct.

#3 @clodromanean
10 years ago

  • Keywords close added
  • Resolution set to wontfix
  • Status changed from new to closed

#4 @SergeyBiryukov
10 years ago

  • Keywords needs-patch good-first-bug 2nd-opinion close removed
  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.