Skip to content

Commit 16e55ec

Browse files
authored
Components fixed (#404)
1 parent 5a75a19 commit 16e55ec

File tree

2 files changed

+17
-15
lines changed

2 files changed

+17
-15
lines changed

includes/Component/Component.php

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,28 +13,28 @@ abstract class Component {
1313

1414
const ALLOWED_HTML = array(
1515
'form' => array(
16-
'action' => array(),
17-
'method' => array(),
16+
'action' => true,
17+
'method' => true,
1818
),
1919
'label' => array(
20-
'for' => array(),
20+
'for' => true,
2121
),
2222
'option' => array(
23-
'value' => array(),
24-
'selected' => array(),
23+
'value' => true,
24+
'selected' => true,
2525
),
2626
'select' => array(
27-
'id' => array(),
28-
'name' => array(),
27+
'id' => true,
28+
'name' => true,
2929
),
3030
'input' => array(
31-
'type' => array(),
32-
'class' => array(),
33-
'id' => array(),
34-
'name' => array(),
35-
'value' => array(),
36-
'size' => array(),
37-
'readonly' => array(),
31+
'type' => true,
32+
'class' => true,
33+
'id' => true,
34+
'name' => true,
35+
'value' => true,
36+
'size' => true,
37+
'readonly' => true,
3838
),
3939
);
4040

@@ -45,6 +45,8 @@ abstract public function render(): string;
4545

4646
/**
4747
* Adds our input elements to the allowed HTML elements of a post
48+
*
49+
* @return array<string, array<string, bool>>
4850
*/
4951
public static function get_allowed_html(): array {
5052
$my_allowed = wp_kses_allowed_html( 'post' );

includes/Component/Input/Text.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function render(): string {
4949
'<input type="text" class="regular-text" id="%1$s" name="msls[%1$s]" value="%2$s" size="%3$d"%4$s/>',
5050
esc_attr( $this->key ),
5151
esc_attr( $this->value ),
52-
esc_attr( $this->size ),
52+
$this->size,
5353
$this->readonly // phpcs:ignore WordPress.Security.EscapeOutput
5454
);
5555
}

0 commit comments

Comments
 (0)