Opened 9 months ago

Closed 12 days ago

#21702 closed defect (bug) (fixed)

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

Reported by: MadtownLems Owned by: SergeyBiryukov
Priority: normal Milestone: 3.6
Component: Widgets Version: 2.5
Severity: normal Keywords: has-patch
Cc: Ken@…

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 9 months ago.
21702.diff (1.2 KB) - added by kovshenin 7 months 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)

  • Description modified (diff)
  • Keywords has-patch added
  • Version set to 2.5

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

  • Milestone changed from Awaiting Review to 3.5

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

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

  • Milestone changed from 3.5 to Future Release

Let's come to a consensus on a patch.

  • Keywords 3.6-early added

21702.diff seems good to me.

  • Cc Ken@… added

I like 21702.diff

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

Related: #11446

  • 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.