Skip to content

Commit 49c9f0e

Browse files
Merge pull request #820 from WordPress/fix/escape
Fix Escape message
2 parents f928fbb + 9440314 commit 49c9f0e

File tree

4 files changed

+4
-3
lines changed

4 files changed

+4
-3
lines changed

includes/CLI/Plugin_Check_Command.php

+1
Original file line numberDiff line numberDiff line change
@@ -555,6 +555,7 @@ private function flatten_file_results( $file_errors, $file_warnings ) {
555555
foreach ( $column_errors as $column_error ) {
556556

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

559560
$file_results[] = array_merge(
560561
$column_error,

includes/Checker/Checks/Abstract_PHP_CodeSniffer_Check.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ final public function run( Check_Result $result ) {
142142
$this->add_result_message_for_file(
143143
$result,
144144
strtoupper( $file_message['type'] ) === 'ERROR',
145-
$file_message['message'],
145+
esc_html( $file_message['message'] ),
146146
$file_message['source'],
147147
$file_name,
148148
$file_message['line'],

includes/Checker/Checks/General/I18n_Usage_Check.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public function get_documentation_url(): string {
9999
*/
100100
protected function add_result_message_for_file( Check_Result $result, $error, $message, $code, $file, $line = 0, $column = 0, string $docs = '', $severity = 5 ) {
101101
// Downgrade errors about usage of the 'default' text domain from WordPress Core to warnings.
102-
if ( $error && str_ends_with( $message, " but got 'default'." ) ) {
102+
if ( $error && str_ends_with( $message, ' but got &#039;default&#039;.' ) ) {
103103
$error = false;
104104
}
105105

includes/Checker/Checks/Plugin_Repo/Plugin_Readme_Check.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ private function check_headers( Check_Result $result, string $readme_file, Parse
213213
$result,
214214
sprintf(
215215
/* translators: 1: currently used version, 2: latest stable WordPress version, 3: 'Tested up to' */
216-
__( '<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' ),
216+
__( '<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' ),
217217
$parser->{$field_key},
218218
$latest_wordpress_version,
219219
'Tested up to'

0 commit comments

Comments
 (0)