Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Improve escaping output by wrapping entire string in esc_html()
  • Loading branch information
westonruter committed Aug 6, 2024
commit 21ebb9744efdbfabbc022e37deb8128ed5bd5ac9
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function register_metric( string $metric_slug, array $args ): void {
_doing_it_wrong(
__METHOD__,
/* translators: %s: metric slug */
sprintf( esc_html__( 'A metric with the slug %s is already registered.', 'performance-lab' ), esc_attr( $metric_slug ) ),
esc_html( sprintf( __( 'A metric with the slug %s is already registered.', 'performance-lab' ), $metric_slug ) ),
''
);
return;
Expand All @@ -71,7 +71,7 @@ public function register_metric( string $metric_slug, array $args ): void {
_doing_it_wrong(
__METHOD__,
/* translators: %s: WordPress action name */
sprintf( esc_html__( 'The method must be called before or during the %s action.', 'performance-lab' ), 'perflab_server_timing_send_header' ),
esc_html( sprintf( __( 'The method must be called before or during the %s action.', 'performance-lab' ), 'perflab_server_timing_send_header' ) ),
''
);
return;
Expand All @@ -88,7 +88,7 @@ public function register_metric( string $metric_slug, array $args ): void {
_doing_it_wrong(
__METHOD__,
/* translators: %s: PHP parameter name */
sprintf( esc_html__( 'The %s argument is required and must be a callable.', 'performance-lab' ), 'measure_callback' ),
esc_html( sprintf( __( 'The %s argument is required and must be a callable.', 'performance-lab' ), 'measure_callback' ) ),
''
);
return;
Expand All @@ -97,7 +97,7 @@ public function register_metric( string $metric_slug, array $args ): void {
_doing_it_wrong(
__METHOD__,
/* translators: %s: PHP parameter name */
sprintf( esc_html__( 'The %s argument is required and must be a string.', 'performance-lab' ), 'access_cap' ),
esc_html( sprintf( __( 'The %s argument is required and must be a string.', 'performance-lab' ), 'access_cap' ) ),
''
);
return;
Expand Down