Skip to content

Commit 10787b2

Browse files
committed
Potential XSS in shortcode extension.
Signed-off-by: Kev Provance <[email protected]>
1 parent 01c53cb commit 10787b2

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

redux-core/inc/extensions/shortcodes/class-redux-shortcodes.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,9 @@ public function blog_info( $atts = array(), ?string $content = null ) {
9797
$atts = array();
9898
}
9999

100+
$content = sanitize_text_field( $content );
101+
$atts = array_map( 'sanitize_text_field', wp_unslash( $atts ) );
102+
100103
if ( ! empty( $content ) && ! isset( $atts['data'] ) ) {
101104
$atts['data'] = $content;
102105
}
@@ -151,6 +154,9 @@ public function theme_info( array $atts = array(), ?string $content = null ) {
151154
$atts = array();
152155
}
153156

157+
$content = sanitize_text_field( $content );
158+
$atts = array_map( 'sanitize_text_field', wp_unslash( $atts ) );
159+
154160
if ( ! empty( $content ) && ! isset( $atts['data'] ) ) {
155161
$atts['data'] = $content;
156162
}
@@ -207,6 +213,9 @@ public function date( $atts = array(), ?string $content = null ) {
207213
$atts = array();
208214
}
209215

216+
$content = sanitize_text_field( $content );
217+
$atts = array_map( 'sanitize_text_field', wp_unslash( $atts ) );
218+
210219
if ( ! empty( $content ) && ! isset( $atts['data'] ) ) {
211220
$atts['data'] = $content;
212221
}

0 commit comments

Comments
 (0)