Make WordPress Core

Opened 5 months ago

Closed 4 months ago

#61341 closed defect (bug) (fixed)

Lack of escaping in Moment.js localization

Reported by: swissspidy's profile swissspidy Owned by: audrasjb's profile audrasjb
Milestone: 6.6 Priority: low
Severity: minor Version:
Component: Script Loader Keywords: has-patch commit
Focuses: Cc:

Description

If for some reason get_user_locale() doesn't return a simply string, it can break the inline script added for Moment.js localization here: https://github.com/WordPress/wordpress-develop/blob/2c818502ea70b27c36f420112152b26bd0ebe8fe/src/wp-includes/script-loader.php#L146-L147

Attachments (1)

61341.diff (475 bytes) - added by swissspidy 5 months ago.

Download all attachments as: .zip

Change History (3)

@swissspidy
5 months ago

#1 @swissspidy
5 months ago

  • Keywords commit added

#2 @audrasjb
4 months ago

  • Owner set to audrasjb
  • Resolution set to fixed
  • Status changed from assigned to closed

In 58288:

Script Loader: Add missing escaping function to Moment.js string localization.

This changeset avoids breaking the inline script added for Moment.js localization if for some reason get_user_locale() doesn't return a simply string.

Props swissspidy.
Fixes #61341.

Note: See TracTickets for help on using tickets.