@@ -34,30 +34,29 @@ function jetpack_render_revue_block( $attributes ) {
34
34
$ last_name_label = jetpack_get_revue_attribute ( 'lastNameLabel ' , $ attributes );
35
35
$ last_name_placeholder = jetpack_get_revue_attribute ( 'lastNamePlaceholder ' , $ attributes );
36
36
$ 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 ' ] );
38
38
39
39
Jetpack_Gutenberg::load_assets_as_required ( 'revue ' );
40
40
41
41
ob_start ();
42
- // phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped -- output escaped in the get functions
43
42
?>
44
43
45
44
<div class="wp-block-jetpack-revue">
46
45
<form
47
- action="<?php echo $ url ; ?> "
46
+ action="<?php echo esc_url ( $ url ) ; ?> "
48
47
class="wp-block-jetpack-revue__form is-visible"
49
48
method="post"
50
49
name="revue-form"
51
50
target="_blank"
52
51
>
53
52
<div>
54
53
<label>
55
- <?php echo $ email_label ; ?>
54
+ <?php echo esc_html ( $ email_label ) ; ?>
56
55
<span class="required"><?php esc_html_e ( '(required) ' , 'jetpack ' ); ?> </span>
57
56
<input
58
57
class="wp-block-jetpack-revue__email"
59
58
name="member[email]"
60
- placeholder="<?php echo $ email_placeholder ; ?> "
59
+ placeholder="<?php echo esc_attr ( $ email_placeholder ) ; ?> "
61
60
required
62
61
type="email"
63
62
/>
@@ -66,11 +65,11 @@ class="wp-block-jetpack-revue__email"
66
65
<?php if ( $ first_name_show ) : ?>
67
66
<div>
68
67
<label>
69
- <?php echo $ first_name_label ; ?>
68
+ <?php echo esc_html ( $ first_name_label ) ; ?>
70
69
<input
71
70
class="wp-block-jetpack-revue__first-name"
72
71
name="member[first_name]"
73
- placeholder="<?php echo $ first_name_placeholder ; ?> "
72
+ placeholder="<?php echo esc_attr ( $ first_name_placeholder ) ; ?> "
74
73
type="text"
75
74
/>
76
75
</label>
@@ -81,17 +80,18 @@ class="wp-block-jetpack-revue__first-name"
81
80
?>
82
81
<div>
83
82
<label>
84
- <?php echo $ last_name_label ; ?>
83
+ <?php echo esc_html ( $ last_name_label ) ; ?>
85
84
<input
86
85
class="wp-block-jetpack-revue__last-name"
87
86
name="member[last_name]"
88
- placeholder="<?php echo $ last_name_placeholder ; ?> "
87
+ placeholder="<?php echo esc_attr ( $ last_name_placeholder ) ; ?> "
89
88
type="text"
90
89
/>
91
90
</label>
92
91
</div>
93
92
<?php
94
93
endif ;
94
+ // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
95
95
echo jetpack_get_revue_button ( $ attributes );
96
96
?>
97
97
</form>
@@ -106,7 +106,6 @@ class="wp-block-jetpack-revue__last-name"
106
106
</div>
107
107
108
108
<?php
109
- // phpcs:enable WordPress.Security.EscapeOutput.OutputNotEscaped
110
109
return ob_get_clean ();
111
110
}
112
111
@@ -212,14 +211,14 @@ function jetpack_get_revue_attribute( $attribute, $attributes ) {
212
211
}
213
212
214
213
$ 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 ' ),
220
219
'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 ' ),
223
222
'lastNameShow ' => true ,
224
223
);
225
224
0 commit comments