Skip to content

Commit

Permalink
Ignore some escaping errors
Browse files Browse the repository at this point in the history
  • Loading branch information
lloc committed Sep 24, 2024
1 parent ae3f291 commit 6e5a28e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
18 changes: 13 additions & 5 deletions includes/MslsAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,9 @@ public function has_problems(): bool {
public function render(): void {
printf(
'<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>',
__( 'Multisite Language Switcher Options', 'multisite-language-switcher' ),
$this->subsubsub(),
__(
esc_html__( 'Multisite Language Switcher Options', 'multisite-language-switcher' ),
$this->subsubsub(), // phpcs:ignore WordPress.Security.EscapeOutput
esc_html__(
'To achieve maximum flexibility, you have to configure each blog separately.',
'multisite-language-switcher'
)
Expand Down Expand Up @@ -338,28 +338,32 @@ public function blog_language(): void {
$languages = $this->options->get_available_languages();
$selected = get_locale();

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

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

/**
* Shows the select-form-field 'admin_display'
*/
public function admin_display(): void {
echo ( new Select(
$select = new Select(
'admin_display',
array(
MslsAdminIcon::TYPE_FLAG => __( 'Flag', 'multisite-language-switcher' ),
MslsAdminIcon::TYPE_LABEL => __( 'Label', 'multisite-language-switcher' ),
),
$this->options->get_icon_type()
) )->render();
);

echo $select->render(); // phpcs:ignore WordPress.Security.EscapeOutput
}

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

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

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

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

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

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

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

Expand Down
2 changes: 1 addition & 1 deletion includes/MslsPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ function () {
}

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

/**
Expand Down
2 changes: 1 addition & 1 deletion includes/MslsPostTag.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public static function suggest(): void {
restore_current_blog();
}

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

public static function init(): void {
Expand Down

0 comments on commit 6e5a28e

Please sign in to comment.