Skip to content

Commit 70aead9

Browse files
author
Smart Cloud Solutions Inc.
committed
Fix Flow output escaping for plugin checks
1 parent 16ba2d1 commit 70aead9

7 files changed

Lines changed: 31 additions & 9 deletions

File tree

admin/php/admin.php

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,21 @@ public function renderShortcodeColumn($column, $post_id)
259259

260260
$copy_label = esc_html__('Copy', 'smartcloud-flow');
261261
$rows = array();
262+
$allowed_html = array(
263+
'div' => array(
264+
'class' => true,
265+
),
266+
'span' => array(
267+
'class' => true,
268+
'id' => true,
269+
),
270+
'code' => array(),
271+
'a' => array(
272+
'href' => true,
273+
'class' => true,
274+
'data-target' => true,
275+
),
276+
);
262277

263278
foreach ($shortcodes as $index => $shortcode) {
264279
$target_id = sprintf('wpc-sc-%1$d-%2$d', (int) $post_id, (int) $index);
@@ -271,7 +286,7 @@ public function renderShortcodeColumn($column, $post_id)
271286
);
272287
}
273288

274-
echo implode('', $rows);
289+
echo wp_kses(implode('', $rows), $allowed_html);
275290
}
276291

277292
public function copyShortcode($hook)

blocks/dist/modal/render.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@
102102
</button>
103103
<?php endif; ?>
104104
<div class="wps-flow-modal__content">
105-
<?php echo $content; ?>
105+
<?php echo wp_kses_post($content); ?>
106106
</div>
107107
</div>
108108
</dialog>

blocks/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@smart-cloud/flow-blocks",
33
"private": true,
4-
"version": "1.1.6",
4+
"version": "1.1.7",
55
"type": "module",
66
"license": "ISC",
77
"scripts": {

blocks/src/modal/block.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"$schema": "https://schemas.wp.org/trunk/block.json",
33
"apiVersion": 3,
44
"name": "smartcloud-flow/modal",
5-
"version": "1.0.2",
5+
"version": "1.0.3",
66
"title": "Flow Modal",
77
"category": "smartcloud-flow",
88
"icon": "feedback",

blocks/src/modal/render.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@
102102
</button>
103103
<?php endif; ?>
104104
<div class="wps-flow-modal__content">
105-
<?php echo $content; ?>
105+
<?php echo wp_kses_post($content); ?>
106106
</div>
107107
</div>
108108
</dialog>

readme.txt

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Tags: forms, workflows, gutenberg, aws, automation
55
Requires at least: 6.2
66
Tested up to: 7.0
77
Requires PHP: 8.1
8-
Stable tag: 1.1.7
8+
Stable tag: 1.1.8
99
License: MIT
1010
License URI: https://mit-license.org/
1111
Text Domain: smartcloud-flow
@@ -217,6 +217,10 @@ Flow Pro includes additional functionality such as backend-powered submissions m
217217

218218
== Changelog ==
219219

220+
= 1.1.8 =
221+
* Fix: Added explicit escaped output handling for the modal block rendered content template to satisfy WordPress plugin security checks.
222+
* Fix: Added explicit escaped output handling for the Flow Patterns shortcode column markup in wp-admin to satisfy WordPress plugin security checks.
223+
220224
= 1.1.7 =
221225
* Fix: Async modal actions now expose a generic pending state on the active trigger while awaited handlers are running.
222226
* Fix: Modal header spacing now only reserves room for the built-in close button when that button is actually rendered.
@@ -277,14 +281,17 @@ Flow Pro includes additional functionality such as backend-powered submissions m
277281

278282
== Upgrade Notice ==
279283

284+
= 1.1.8 =
285+
Recommended maintenance update if you run WordPress plugin checks or package Flow for release; this version adds explicit escaped output handling in the modal render template and Flow Patterns shortcode admin column.
286+
280287
= 1.1.7 =
281288
Recommended update if you use Flow modals with async actions or custom modal headers; this release adds generic pending-state hooks for running action triggers, removes unnecessary header spacing when the built-in close button is hidden, and expands the modal API docs.
282289

283290
= 1.1.6 =
284291
Recommended update if you use Flow modals; this release improves Gutenberg button triggers, dismiss/default action handling, full-height layout stability, background scroll locking, and the modal editor toolbar for header, body, and actions sections.
285292

286293
= 1.1.5 =
287-
Recommended update if you use modal presentations, custom submit or API-backed option endpoints, or older saved Flow blocks; this release adds the modal block/runtime, expands endpoint interpolation and request options, improves API error handling, and restores Gutenberg compatibility for legacy serialized content.
294+
Recommended update if you use modal presentations, custom submit or API-backed option endpoints; this release adds the modal block/runtime, expands endpoint interpolation and request options, improves API error handling, and restores Gutenberg compatibility for legacy serialized content.
288295

289296
= 1.1.4 =
290297
Recommended update if you reuse Flow patterns outside Gutenberg; this release adds content-root patterns to the admin list and exposes the matching copy-ready shortcode targets.

smartcloud-flow.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Requires at least: 6.2
77
* Tested up to: 7.0
88
* Requires PHP: 8.1
9-
* Version: 1.1.7
9+
* Version: 1.1.8
1010
* Author: Smart Cloud Solutions Inc.
1111
* Author URI: https://smart-cloud-solutions.com
1212
* License: MIT
@@ -18,7 +18,7 @@
1818

1919
namespace SmartCloud\WPSuite\Flow;
2020

21-
const VERSION = '1.1.7';
21+
const VERSION = '1.1.8';
2222

2323
if (!defined('ABSPATH')) {
2424
exit;

0 commit comments

Comments
 (0)