diff --git a/CHANGELOG.md b/CHANGELOG.md index 034e1717..f2ce3338 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -78,7 +78,7 @@ ### Security - BBCode plugin: update to version 2.0.4 - - An XSS vulnerability in the BBCode plugin has been fixed. ([#941](https://github.com/flatpressblog/flatpress/pull/941)) + - An XSS vulnerability in the BBCode plugin has been fixed. ([#941](https://github.com/flatpressblog/flatpress/pull/941), [#945](https://github.com/flatpressblog/flatpress/pull/945)) ## Themes ### Changes diff --git a/fp-plugins/bbcode/plugin.bbcode.php b/fp-plugins/bbcode/plugin.bbcode.php index 85d727c3..0df9db9b 100644 --- a/fp-plugins/bbcode/plugin.bbcode.php +++ b/fp-plugins/bbcode/plugin.bbcode.php @@ -525,9 +525,11 @@ function do_bbcode_img($action, $attributes, $content, $params, $node_object) { } } - // Calculating the "loading" attribute of the image. - // For details, see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#attr-loading - // -> "lazy" is default (see https://developer.mozilla.org/en-US/docs/Web/Performance/Lazy_loading) + /** + * Calculating the "loading" attribute of the image. + * For details, see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#attr-loading + * -> "lazy" is default (see https://developer.mozilla.org/en-US/docs/Web/Performance/Lazy_loading) + */ $loadingValue = 'lazy'; // Use img attribute value if explicitly set if (isset($attributes ['loading'])) { @@ -808,7 +810,8 @@ function do_bbcode_color($action, $attributes, $content, $params, $node_object) if ($action == 'validate') { return true; } - return '' . $content . ''; + $color = isset($attributes ['default']) ? $attributes ['default'] : ''; + return '' . $content . ''; } /** @@ -871,7 +874,8 @@ function do_bbcode_size($action, $attributes, $content, $params, $node_object) { if ($action == 'validate') { return true; } - return '' . $content . ''; + $size = isset($attributes ['default']) ? $attributes ['default'] : ''; + return '' . $content . ''; } /** @@ -887,7 +891,8 @@ function do_bbcode_size($action, $attributes, $content, $params, $node_object) { * @return string */ function do_bbcode_align($action, $attr, $content, $params, $node_object) { - return '