Skip to content

Commit 184cfff

Browse files
authored
[not verified] Fix/wufoo attribute return (#14865) (#14870)
* Update wufoo shortcode attributes and early return * changelog for wufoo shortcode changes.
1 parent 18c2367 commit 184cfff

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

modules/shortcodes/wufoo.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ function wufoo_shortcode( $atts ) {
5151
'https://help.wufoo.com/articles/en_US/kb/Embed'
5252
);
5353
}
54+
55+
return;
5456
}
5557

5658
/**
@@ -66,12 +68,12 @@ function wufoo_shortcode( $atts ) {
6668
* An error will be returned inside the form if they are invalid.
6769
*/
6870
$js_embed = sprintf(
69-
'(function(){try{var wufoo_%1$s = new WufooForm();wufoo_%1$s.initialize({"userName":"%2$s","formHash":"%1$s","autoResize":"%3$s","height":"%4$d","header":"%5$s","ssl":true,"async":true});wufoo_%1$s.display();}catch(e){}})();',
71+
'(function(){try{var wufoo_%1$s = new WufooForm();wufoo_%1$s.initialize({"userName":"%2$s","formHash":"%1$s","autoResize":%3$s,"height":"%4$d","header":"%5$s","ssl":true,"async":true});wufoo_%1$s.display();}catch(e){}})();',
7072
esc_attr( $attr['formhash'] ),
7173
esc_attr( $attr['username'] ),
72-
esc_attr( $attr['autoresize'] ),
74+
'true' == $attr['autoresize'] ? 'true' : 'false', // phpcs:ignore WordPress.PHP.StrictComparisons.LooseComparison
7375
absint( $attr['height'] ),
74-
esc_js( $attr['header'] )
76+
'show' === $attr['header'] ? 'show' : 'hide'
7577
);
7678

7779
// Embed URL.

readme.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ There are opportunities for developers at all levels to contribute. [Learn more
155155
* Secure Sign On: do not display feature message when logging in to WordPress.com's central dashboard.
156156
* Stats: hide Stats smiley in post embeds.
157157
* WooCommerce Analytics: improve product checks to avoid errors on order pages.
158+
* Wufoo shortcode: Security fix return early when invalid parameters.
158159

159160
--------
160161

0 commit comments

Comments
 (0)