Make WordPress Core

Opened 12 months ago

Closed 12 months ago

Last modified 12 months ago

#58129 closed defect (bug) (fixed)

Rename the $myHTML parameter in htmlentities2()

Reported by: sergeybiryukov's profile SergeyBiryukov Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 6.3 Priority: normal
Severity: normal Version:
Component: Formatting Keywords: good-first-bug has-patch
Focuses: coding-standards Cc:

Description

There is currently a WPCS warning in wp-includes/formatting.php:

Variable "$myHTML" is not in valid snake_case format, try "$my_h_t_m_l"

Renaming the $myHTML parameter to $text in htmlentities2() should fix the warning.

It would also match other formatting functions with the $text parameter, e.g. esc_html(), ent2ncr(), etc.

Change History (3)

This ticket was mentioned in PR #4327 on WordPress/wordpress-develop by @victoranto.


12 months ago
#1

  • Keywords has-patch added; needs-patch removed

Rename parameter $myHTML to $text to follow the standard snake_case. Now matches other formating functions like esc_js, esc_html, etc.

Trac ticket: https://core.trac.wordpress.org/ticket/58129#no0

#2 @SergeyBiryukov
12 months ago

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

In 55651:

Coding Standards: Rename the $myHTML parameter to $text in htmlentities2().

This resolves a WPCS warning:

Variable "$myHTML" is not in valid snake_case format, try "$my_h_t_m_l"

It also matches other formatting functions with the $text parameter, e.g. esc_html(), ent2ncr(), etc.

Follow-up to [1727], [3717], [8662], [8743], [54927].

Props victoranto, audrasjb, jrf.
Fixes #58129.

@SergeyBiryukov commented on PR #4327:


12 months ago
#3

Thanks for the PR! Merged in r55651.

Note: See TracTickets for help on using tickets.