Skip to content

Commit b9aa5a0

Browse files
committed
Properly escape all the strings
1 parent 8e665f9 commit b9aa5a0

File tree

1 file changed

+16
-17
lines changed

1 file changed

+16
-17
lines changed

extensions/blocks/revue/revue.php

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -34,30 +34,29 @@ function jetpack_render_revue_block( $attributes ) {
3434
$last_name_label = jetpack_get_revue_attribute( 'lastNameLabel', $attributes );
3535
$last_name_placeholder = jetpack_get_revue_attribute( 'lastNamePlaceholder', $attributes );
3636
$last_name_show = jetpack_get_revue_attribute( 'lastNameShow', $attributes );
37-
$url = esc_url( sprintf( 'https://www.getrevue.co/profile/%s/add_subscriber', $attributes['revueUsername'] ) );
37+
$url = sprintf( 'https://www.getrevue.co/profile/%s/add_subscriber', $attributes['revueUsername'] );
3838

3939
Jetpack_Gutenberg::load_assets_as_required( 'revue' );
4040

4141
ob_start();
42-
// phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped -- output escaped in the get functions
4342
?>
4443

4544
<div class="wp-block-jetpack-revue">
4645
<form
47-
action="<?php echo $url; ?>"
46+
action="<?php echo esc_url( $url ); ?>"
4847
class="wp-block-jetpack-revue__form is-visible"
4948
method="post"
5049
name="revue-form"
5150
target="_blank"
5251
>
5352
<div>
5453
<label>
55-
<?php echo $email_label; ?>
54+
<?php echo esc_html( $email_label ); ?>
5655
<span class="required"><?php esc_html_e( '(required)', 'jetpack' ); ?></span>
5756
<input
5857
class="wp-block-jetpack-revue__email"
5958
name="member[email]"
60-
placeholder="<?php echo $email_placeholder; ?>"
59+
placeholder="<?php echo esc_attr( $email_placeholder ); ?>"
6160
required
6261
type="email"
6362
/>
@@ -66,11 +65,11 @@ class="wp-block-jetpack-revue__email"
6665
<?php if ( $first_name_show ) : ?>
6766
<div>
6867
<label>
69-
<?php echo $first_name_label; ?>
68+
<?php echo esc_html( $first_name_label ); ?>
7069
<input
7170
class="wp-block-jetpack-revue__first-name"
7271
name="member[first_name]"
73-
placeholder="<?php echo $first_name_placeholder; ?>"
72+
placeholder="<?php echo esc_attr( $first_name_placeholder ); ?>"
7473
type="text"
7574
/>
7675
</label>
@@ -81,17 +80,18 @@ class="wp-block-jetpack-revue__first-name"
8180
?>
8281
<div>
8382
<label>
84-
<?php echo $last_name_label; ?>
83+
<?php echo esc_html( $last_name_label ); ?>
8584
<input
8685
class="wp-block-jetpack-revue__last-name"
8786
name="member[last_name]"
88-
placeholder="<?php echo $last_name_placeholder; ?>"
87+
placeholder="<?php echo esc_attr( $last_name_placeholder ); ?>"
8988
type="text"
9089
/>
9190
</label>
9291
</div>
9392
<?php
9493
endif;
94+
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
9595
echo jetpack_get_revue_button( $attributes );
9696
?>
9797
</form>
@@ -106,7 +106,6 @@ class="wp-block-jetpack-revue__last-name"
106106
</div>
107107

108108
<?php
109-
// phpcs:enable WordPress.Security.EscapeOutput.OutputNotEscaped
110109
return ob_get_clean();
111110
}
112111

@@ -212,14 +211,14 @@ function jetpack_get_revue_attribute( $attribute, $attributes ) {
212211
}
213212

214213
$default_attributes = array(
215-
'text' => esc_html__( 'Subscribe', 'jetpack' ),
216-
'emailLabel' => esc_html__( 'Email address', 'jetpack' ),
217-
'emailPlaceholder' => esc_html__( 'Your email address…', 'jetpack' ),
218-
'firstNameLabel' => esc_html__( 'First name', 'jetpack' ),
219-
'firstNamePlaceholder' => esc_html__( 'First name… (Optional)', 'jetpack' ),
214+
'text' => __( 'Subscribe', 'jetpack' ),
215+
'emailLabel' => __( 'Email address', 'jetpack' ),
216+
'emailPlaceholder' => __( 'Your email address…', 'jetpack' ),
217+
'firstNameLabel' => __( 'First name', 'jetpack' ),
218+
'firstNamePlaceholder' => __( 'First name… (Optional)', 'jetpack' ),
220219
'firstNameShow' => true,
221-
'lastNameLabel' => esc_html__( 'Last name', 'jetpack' ),
222-
'lastNamePlaceholder' => esc_html__( 'Last name… (Optional)', 'jetpack' ),
220+
'lastNameLabel' => __( 'Last name', 'jetpack' ),
221+
'lastNamePlaceholder' => __( 'Last name… (Optional)', 'jetpack' ),
223222
'lastNameShow' => true,
224223
);
225224

0 commit comments

Comments
 (0)