Skip to content

Commit

Permalink
Merge pull request #820 from WordPress/fix/escape
Browse files Browse the repository at this point in the history
Fix Escape message
  • Loading branch information
davidperezgar authored Dec 6, 2024
2 parents f928fbb + 9440314 commit 49c9f0e
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions includes/CLI/Plugin_Check_Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -555,6 +555,7 @@ private function flatten_file_results( $file_errors, $file_warnings ) {
foreach ( $column_errors as $column_error ) {

$column_error['message'] = str_replace( array( '<br>', '<strong>', '</strong>', '<code>', '</code>' ), array( ' ', '', '', '`', '`' ), $column_error['message'] );
$column_error['message'] = html_entity_decode( $column_error['message'] );

$file_results[] = array_merge(
$column_error,
Expand Down
2 changes: 1 addition & 1 deletion includes/Checker/Checks/Abstract_PHP_CodeSniffer_Check.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ final public function run( Check_Result $result ) {
$this->add_result_message_for_file(
$result,
strtoupper( $file_message['type'] ) === 'ERROR',
$file_message['message'],
esc_html( $file_message['message'] ),
$file_message['source'],
$file_name,
$file_message['line'],
Expand Down
2 changes: 1 addition & 1 deletion includes/Checker/Checks/General/I18n_Usage_Check.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public function get_documentation_url(): string {
*/
protected function add_result_message_for_file( Check_Result $result, $error, $message, $code, $file, $line = 0, $column = 0, string $docs = '', $severity = 5 ) {
// Downgrade errors about usage of the 'default' text domain from WordPress Core to warnings.
if ( $error && str_ends_with( $message, " but got 'default'." ) ) {
if ( $error && str_ends_with( $message, ' but got &#039;default&#039;.' ) ) {
$error = false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ private function check_headers( Check_Result $result, string $readme_file, Parse
$result,
sprintf(
/* translators: 1: currently used version, 2: latest stable WordPress version, 3: 'Tested up to' */
__( '<strong>Tested up to: %1$s < %2$s.</strong><br>The "%3$s" value in your plugin is not set to the current version of WordPress. This means your plugin will not show up in searches, as we require plugins to be compatible and documented as tested up to the most recent version of WordPress.', 'plugin-check' ),
__( '<strong>Tested up to: %1$s &lt; %2$s.</strong><br>The "%3$s" value in your plugin is not set to the current version of WordPress. This means your plugin will not show up in searches, as we require plugins to be compatible and documented as tested up to the most recent version of WordPress.', 'plugin-check' ),
$parser->{$field_key},
$latest_wordpress_version,
'Tested up to'
Expand Down

0 comments on commit 49c9f0e

Please sign in to comment.