Make WordPress Core

Opened 13 years ago

Closed 13 years ago

#21702 closed defect (bug) (fixed)

RSS Widget adds [...] even if the entire content is shown

Reported by: madtownlems's profile MadtownLems Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 3.6 Priority: normal
Severity: normal Version: 2.5
Component: Widgets Keywords: has-patch
Focuses: Cc:

Description (last modified by SergeyBiryukov)

When the option to display item content is checked, the core RSS widget adds [...] regardless of if any trimming was actually done or not.

I believe [...] should only show up if something is cut off, and should not show when the entire excerpt is shown (due to its short length).

This seems related to #11244 which was marked as fixed.

Attachments (2)

21702.patch (573 bytes) - added by c3mdigital 13 years ago.
21702.diff (1.2 KB) - added by kovshenin 13 years ago.
Preserve the original $desc and use $excerpt instead. Comparing the two will tell whether or not hellip should be added.

Download all attachments as: .zip

Change History (11)

#1 @SergeyBiryukov
13 years ago

  • Description modified (diff)

@c3mdigital
13 years ago

#2 @c3mdigital
13 years ago

  • Keywords has-patch added
  • Version set to 2.5

Patch checks length of string using mb_strlen. Only adds [...] if the length is > 355.

#3 @nacin
13 years ago

  • Milestone changed from Awaiting Review to 3.5

@kovshenin
13 years ago

Preserve the original $desc and use $excerpt instead. Comparing the two will tell whether or not hellip should be added.

#4 @kovshenin
13 years ago

Also, if you decide to use mb_strlen, make sure the function exists first and maybe fall back to strlen.

#5 @nacin
13 years ago

  • Milestone changed from 3.5 to Future Release

Let's come to a consensus on a patch.

#6 @SergeyBiryukov
13 years ago

  • Keywords 3.6-early added

21702.diff seems good to me.

#7 @WraithKenny
13 years ago

  • Cc Ken@… added

I like 21702.diff

#8 @SergeyBiryukov
13 years ago

  • Keywords 3.6-early removed
  • Milestone changed from Future Release to 3.6

Related: #11446

#9 @SergeyBiryukov
13 years ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from new to closed

In 24213:

Don't append ellipsis in RSS widget if the entire content is shown. props kovshenin. fixes #21702.

Note: See TracTickets for help on using tickets.