Skip to content

Commit 7d34be3

Browse files
authored
Merge pull request #387 from lloc/raise-coverage
Ignore some escaping errors
2 parents 6509fa4 + 51180b3 commit 7d34be3

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

includes/Component/Input/Checkbox.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ public function __construct( string $key, ?string $value ) {
3636
public function render(): string {
3737
return sprintf(
3838
'<input type="checkbox" id="%1$s" name="msls[%1$s]" value="1" %2$s/>',
39-
$this->key,
40-
$this->selected
39+
esc_attr( $this->key ),
40+
$this->selected // phpcs:ignore WordPress.Security.EscapeOutput
4141
);
4242
}
4343
}

includes/Component/Input/Group.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function add( InputInterface $input ): self {
4848
public function render(): string {
4949
$items = array_map(
5050
function ( InputInterface $input ) {
51-
return $input->render();
51+
return $input->render(); // phpcs:ignore WordPress.Security.EscapeOutput
5252
},
5353
$this->arr
5454
);

includes/Component/Input/Label.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
/**
88
* Class Label
9+
*
910
* @package lloc\Msls\Component\Input
1011
*/
1112
class Label implements InputInterface {
@@ -33,7 +34,6 @@ public function __construct( string $key, string $text ) {
3334
* @return string
3435
*/
3536
public function render(): string {
36-
return sprintf( '<label for="%1$s">%2$s</label>', $this->key, $this->text );
37+
return sprintf( '<label for="%1$s">%2$s</label>', esc_html( $this->key ), esc_html( $this->text ) );
3738
}
38-
39-
}
39+
}

includes/Component/Input/Select.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function render(): string {
4242
'<select id="%1$s" name="%2$s">%3$s</select>',
4343
esc_attr( $this->key ),
4444
esc_attr( $name ),
45-
$this->options->render()
45+
$this->options->render() // phpcs:ignore WordPress.Security.EscapeOutput
4646
);
4747
}
4848
}

includes/Component/Input/Text.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ public function render(): string {
5050
'<input type="text" class="regular-text" id="%1$s" name="msls[%1$s]" value="%2$s" size="%3$d"%4$s/>',
5151
esc_attr( $this->key ),
5252
esc_attr( $this->value ),
53-
$this->size,
54-
esc_attr( $this->readonly )
53+
esc_attr( $this->size ),
54+
$this->readonly // phpcs:ignore WordPress.Security.EscapeOutput
5555
);
5656
}
5757
}

includes/MslsAdmin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public function get_menu_slug(): string {
6868
}
6969

7070
/**
71-
* Get's the link for the switcher-settings in the wp-admin
71+
* Gets the link for the switcher-settings in the wp-admin
7272
*
7373
* @return string
7474
*/

0 commit comments

Comments
 (0)