WordPress.org

Make WordPress Core

Opened 4 years ago

Last modified 5 days ago

#41208 assigned defect (bug)

Dashboard News & Events widget does not properly handle entities (e.g. en/em dash)

Reported by: nickciske Owned by:
Milestone: 5.9 Priority: low
Severity: normal Version: 4.8
Component: Administration Keywords: has-patch
Focuses: ui, javascript Cc:

Description

"WordCamp Minneapolis – St. Paul, Minnesota, USA" is displayed as "WordCamp Minneapolis – St. Paul, Minnesota, USA"

Attachments (6)

Screen Shot 2017-06-29 at 2.02.53 PM.png (45.1 KB) - added by nickciske 4 years ago.
Screenshot of issue
WP News and Announcements OK at-sign.PNG (38.9 KB) - added by kpegoraro 4 years ago.
Screenshot of at sign in WP News and Events
WP News and Announcements OK em-dash.PNG (68.3 KB) - added by kpegoraro 4 years ago.
WP News and Events em-dash example
WP News and Announcements OK en-dash.PNG (57.3 KB) - added by kpegoraro 4 years ago.
WP News and Announcements OK en-dash example screenshot
41208.diff (667 bytes) - added by sayedulsayem 7 days ago.
This is documented function of lodash to convert string from escaped string.
41208.2.diff (657 bytes) - added by sayedulsayem 7 days ago.
padrone me for my previous patch. This is the actual working solution

Download all attachments as: .zip

Change History (14)

@nickciske
4 years ago

Screenshot of issue

#1 @kpegoraro
4 years ago

On Chrome on Windows, I see the same result for the Minneapolis event in the first screenshot from nickciske, but I do see em- and en-dashes and at-signs properly for other events (screenshots attached).

@kpegoraro
4 years ago

Screenshot of at sign in WP News and Events

@kpegoraro
4 years ago

WP News and Events em-dash example

@kpegoraro
4 years ago

WP News and Announcements OK en-dash example screenshot

#2 @iandunn
4 years ago

  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to Future Release
  • Owner set to iandunn
  • Priority changed from normal to low
  • Status changed from new to accepted

I'm seeing this too. I haven't had time to really dig into it, but the – entity is returned by the w.org API, which seems appropriate at first glance.

My first guess would be that {{ is preventing the entity from being rendered. Running the data through htmlspecialchars_decode() before it gets returned from get_events() might be a good fix. I think that'd be safe, since it'd still be passed through {{, but we'd need to verify that.

#3 @shedonist
4 years ago

I think this issue may have been resolved by Meetup itself. I tried editing one of my future meetups (https://www.meetup.com/WordpressDevSeacoast/events/243889267/ - on 1/11/18) to contain an endash or an emdash and it shows properly both in Meetup and also when I looked at it in the dashboard (search for "Nottingham") and the "Users — TBD" meetup shows fine.

Steps: What I did was paste the entity directly into the meetup title. Then I waited for the widget to refresh itself (I deleted my local transients, but it seems like Meetup or something up the chain was caching the titles for a bit). I am able to find my meetup at the moment by searching for "Nottingham" (this narrows the search so I can see further ahead to the Jan meetup). Once the updated "Users — TBD" title appeared in the widget, it was displaying correctly.

#4 @iandunn
3 years ago

  • Owner iandunn deleted
  • Status changed from accepted to assigned

#5 @iandunn
2 months ago

#53851 was marked as a duplicate.

#6 @Hareesh Pillai
2 months ago

  • Milestone changed from Future Release to 5.9

Adding it to the upcoming major milestone for consideration. A similar issue was faced recently with Santa Catarina - Brazil.

@sayedulsayem
7 days ago

This is documented function of lodash to convert string from escaped string.

@sayedulsayem
7 days ago

padrone me for my previous patch. This is the actual working solution

#7 @sayedulsayem
7 days ago

  • Keywords has-patch added; needs-patch removed

#8 @sayedulsayem
5 days ago

  • Focuses ui javascript added
Note: See TracTickets for help on using tickets.