Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Escape message #820

Merged
merged 5 commits into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
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
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'] ),
davidperezgar marked this conversation as resolved.
Show resolved Hide resolved
$file_message['source'],
$file_name,
$file_message['line'],
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
6 changes: 3 additions & 3 deletions tests/phpunit/tests/Checker/Checks/I18n_Usage_Check_Tests.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ public function test_run_without_default_textdomain() {

// Explicitly using the 'default' text domain is a warning, omitting a text domain is an error.
$this->assertNotEmpty( $check_result->get_errors() );
$this->assertNotEmpty( $check_result->get_warnings() );
$this->assertEquals( 1, $check_result->get_error_count() );
$this->assertEquals( 1, $check_result->get_warning_count() );
$this->assertEmpty( $check_result->get_warnings() );
$this->assertEquals( 2, $check_result->get_error_count() );
$this->assertEquals( 0, $check_result->get_warning_count() );
davidperezgar marked this conversation as resolved.
Show resolved Hide resolved
}
}
Loading