WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#32128 closed defect (bug) (fixed)

Emoji error loop

Reported by: obenland Owned by: azaozz
Milestone: 4.2.2 Priority: normal
Severity: normal Version: 4.2
Component: Formatting Keywords: fixed-major has-patch
Focuses: javascript Cc:
PR Number:

Description

If the emoji scripts has to replace emojis with images but the images can't be found, twemoji replaces those images with the image's alt attribute. wp-emoji has a listener in place to then again run the emoji script over theses nodes, resulting in an infinite replacement loop. At least that's what I think happens.

Attachments (2)

32128.diff (970 bytes) - added by obenland 5 years ago.
Probably not the most elegant solution.
32128.patch (1.0 KB) - added by iseulde 5 years ago.

Download all attachments as: .zip

Change History (10)

@obenland
5 years ago

Probably not the most elegant solution.

#1 @DrewAPicture
5 years ago

  • Component changed from General to Formatting

#2 @DrewAPicture
5 years ago

  • Keywords needs-testing added

#3 @SergeyBiryukov
5 years ago

#32157 was marked as a duplicate.

#4 @iseulde
5 years ago

The documentation says object can also be a string, so doing object.className without any other checks is not good. It's probably better to even prevent that function from executing and handle it in the mutation observer callback.

@iseulde
5 years ago

#5 @iseulde
5 years ago

The second patch is a bit more code, but should be faster, it runs earlier and less often.

#6 @azaozz
5 years ago

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

In 32323:

Emoji: fix loop when replacement images fail to load.
Props iseulde. Fixes #32128 for trunk.

#7 @azaozz
5 years ago

  • Keywords fixed-major added; needs-testing removed
  • Resolution fixed deleted
  • Status changed from closed to reopened

Reopen for 4.2.

#8 @azaozz
5 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 32360:

Emoji: fix loop when replacement images fail to load.
Props iseulde. Fixes #32128 for 4.2.

Note: See TracTickets for help on using tickets.