Skip to content

Commit 6e5a28e

Browse files
committed
Ignore some escaping errors
1 parent ae3f291 commit 6e5a28e

File tree

3 files changed

+15
-7
lines changed

3 files changed

+15
-7
lines changed

includes/MslsAdmin.php

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,9 @@ public function has_problems(): bool {
157157
public function render(): void {
158158
printf(
159159
'<div class="wrap"><div class="icon32" id="icon-options-general"><br/></div><h1>%s</h1>%s<br class="clear"/><form action="options.php" method="post"><p>%s</p>',
160-
__( 'Multisite Language Switcher Options', 'multisite-language-switcher' ),
161-
$this->subsubsub(),
162-
__(
160+
esc_html__( 'Multisite Language Switcher Options', 'multisite-language-switcher' ),
161+
$this->subsubsub(), // phpcs:ignore WordPress.Security.EscapeOutput
162+
esc_html__(
163163
'To achieve maximum flexibility, you have to configure each blog separately.',
164164
'multisite-language-switcher'
165165
)
@@ -338,28 +338,32 @@ public function blog_language(): void {
338338
$languages = $this->options->get_available_languages();
339339
$selected = get_locale();
340340

341+
// phpcs:ignore WordPress.Security.EscapeOutput
341342
echo ( new Select( 'blog_language', $languages, $selected ) )->render();
342343
}
343344

344345
/**
345346
* Shows the select-form-field 'display'
346347
*/
347348
public function display(): void {
349+
// phpcs:ignore WordPress.Security.EscapeOutput
348350
echo ( new Select( 'display', MslsLink::get_types_description(), strval( $this->options->display ) ) )->render();
349351
}
350352

351353
/**
352354
* Shows the select-form-field 'admin_display'
353355
*/
354356
public function admin_display(): void {
355-
echo ( new Select(
357+
$select = new Select(
356358
'admin_display',
357359
array(
358360
MslsAdminIcon::TYPE_FLAG => __( 'Flag', 'multisite-language-switcher' ),
359361
MslsAdminIcon::TYPE_LABEL => __( 'Label', 'multisite-language-switcher' ),
360362
),
361363
$this->options->get_icon_type()
362-
) )->render();
364+
);
365+
366+
echo $select->render(); // phpcs:ignore WordPress.Security.EscapeOutput
363367
}
364368

365369
/**
@@ -384,6 +388,7 @@ public function reference_user(): void {
384388
trigger_error( sprintf( $format, self::MAX_REFERENCE_USERS ) );
385389
}
386390

391+
// phpcs:ignore WordPress.Security.EscapeOutput
387392
echo ( new Select( 'reference_user', $users, strval( $this->options->reference_user ) ) )->render();
388393
}
389394

@@ -393,6 +398,7 @@ public function reference_user(): void {
393398
* The language will be used ff there is no description.
394399
*/
395400
public function description(): void {
401+
// phpcs:ignore WordPress.Security.EscapeOutput
396402
echo ( new Text( 'description', $this->options->description, 40 ) )->render();
397403
}
398404

@@ -408,6 +414,7 @@ public function content_priority(): void {
408414
$arr = array_combine( $temp, $temp );
409415
$selected = empty( $this->options->content_priority ) ? 10 : $this->options->content_priority;
410416

417+
// phpcs:ignore WordPress.Security.EscapeOutput
411418
echo ( new Select( 'content_priority', $arr, strval( $selected ) ) )->render();
412419
}
413420

@@ -426,6 +433,7 @@ public function render_rewrite( $key ): void {
426433
$value = $rewrite['slug'];
427434
}
428435

436+
// phpcs:ignore WordPress.Security.EscapeOutput
429437
echo ( new Text( "rewrite_{$key}", $value, 30, true ) )->render();
430438
}
431439

includes/MslsPlugin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ function () {
102102
}
103103

104104
public static function print_alternate_links(): void {
105-
echo msls_output()->get_alternate_links(), PHP_EOL;
105+
echo msls_output()->get_alternate_links(), PHP_EOL; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
106106
}
107107

108108
/**

includes/MslsPostTag.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public static function suggest(): void {
7171
restore_current_blog();
7272
}
7373

74-
wp_die( $json->encode() );
74+
wp_die( $json->encode() ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
7575
}
7676

7777
public static function init(): void {

0 commit comments

Comments
 (0)