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

Ignore some escaping errors #387

Merged
merged 1 commit into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 2 additions & 2 deletions includes/Component/Input/Checkbox.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ public function __construct( string $key, ?string $value ) {
public function render(): string {
return sprintf(
'<input type="checkbox" id="%1$s" name="msls[%1$s]" value="1" %2$s/>',
$this->key,
$this->selected
esc_attr( $this->key ),
$this->selected // phpcs:ignore WordPress.Security.EscapeOutput
);
}
}
2 changes: 1 addition & 1 deletion includes/Component/Input/Group.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function add( InputInterface $input ): self {
public function render(): string {
$items = array_map(
function ( InputInterface $input ) {
return $input->render();
return $input->render(); // phpcs:ignore WordPress.Security.EscapeOutput
},
$this->arr
);
Expand Down
6 changes: 3 additions & 3 deletions includes/Component/Input/Label.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

/**
* Class Label
*
* @package lloc\Msls\Component\Input
*/
class Label implements InputInterface {
Expand Down Expand Up @@ -33,7 +34,6 @@ public function __construct( string $key, string $text ) {
* @return string
*/
public function render(): string {
return sprintf( '<label for="%1$s">%2$s</label>', $this->key, $this->text );
return sprintf( '<label for="%1$s">%2$s</label>', esc_html( $this->key ), esc_html( $this->text ) );
}

}
}
2 changes: 1 addition & 1 deletion includes/Component/Input/Select.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function render(): string {
'<select id="%1$s" name="%2$s">%3$s</select>',
esc_attr( $this->key ),
esc_attr( $name ),
$this->options->render()
$this->options->render() // phpcs:ignore WordPress.Security.EscapeOutput
);
}
}
4 changes: 2 additions & 2 deletions includes/Component/Input/Text.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ public function render(): string {
'<input type="text" class="regular-text" id="%1$s" name="msls[%1$s]" value="%2$s" size="%3$d"%4$s/>',
esc_attr( $this->key ),
esc_attr( $this->value ),
$this->size,
esc_attr( $this->readonly )
esc_attr( $this->size ),
$this->readonly // phpcs:ignore WordPress.Security.EscapeOutput
);
}
}
2 changes: 1 addition & 1 deletion includes/MslsAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public function get_menu_slug(): string {
}

/**
* Get's the link for the switcher-settings in the wp-admin
* Gets the link for the switcher-settings in the wp-admin
*
* @return string
*/
Expand Down
Loading