mirror of
https://github.com/WordPress/WordPress.git
synced 2026-06-19 07:37:07 +00:00
Abilities API: Stop HTML-escaping the ability name in WP_Error messages
Ability names are pattern-validated at registration, so `esc_html()` on them is always a no-op. Drop it from the `WP_Error` messages, which are commonly serialized to JSON where the escaping would be incorrect. Follow-up to [62398]. See #64311. Built from https://develop.svn.wordpress.org/trunk@62401 git-svn-id: http://core.svn.wordpress.org/trunk@61682 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -561,7 +561,7 @@ class WP_Ability {
|
||||
sprintf(
|
||||
/* translators: 1: Ability name, 2: Exception message. */
|
||||
__( 'Ability "%1$s" callback threw an exception: %2$s' ),
|
||||
esc_html( $this->name ),
|
||||
$this->name,
|
||||
esc_html( $e->getMessage() )
|
||||
)
|
||||
);
|
||||
@@ -590,7 +590,7 @@ class WP_Ability {
|
||||
return new WP_Error(
|
||||
'ability_invalid_permission_callback',
|
||||
/* translators: %s ability name. */
|
||||
sprintf( __( 'Ability "%s" does not have a valid permission callback.' ), esc_html( $this->name ) )
|
||||
sprintf( __( 'Ability "%s" does not have a valid permission callback.' ), $this->name )
|
||||
);
|
||||
}
|
||||
|
||||
@@ -638,7 +638,7 @@ class WP_Ability {
|
||||
$result = new WP_Error(
|
||||
'ability_invalid_execute_callback',
|
||||
/* translators: %s ability name. */
|
||||
sprintf( __( 'Ability "%s" does not have a valid execute callback.' ), esc_html( $this->name ) )
|
||||
sprintf( __( 'Ability "%s" does not have a valid execute callback.' ), $this->name )
|
||||
);
|
||||
} else {
|
||||
$result = $this->invoke_callback( $this->execute_callback, $input );
|
||||
@@ -783,7 +783,7 @@ class WP_Ability {
|
||||
return new WP_Error(
|
||||
'ability_invalid_permissions',
|
||||
/* translators: %s ability name. */
|
||||
sprintf( __( 'Ability "%s" does not have necessary permission.' ), esc_html( $this->name ) )
|
||||
sprintf( __( 'Ability "%s" does not have necessary permission.' ), $this->name )
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '7.1-alpha-62400';
|
||||
$wp_version = '7.1-alpha-62401';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
||||
Reference in New Issue
Block a user