PluginProbe
TableKit – WordPress Table Builder for Data Tables, WooCommerce Product Tables & Post Tables / 2.3.0
TableKit – WordPress Table Builder for Data Tables, WooCommerce Product Tables & Post Tables v2.3.0
2.3.0 2.2.14 2.2.13 2.2.12 2.2.11 2.2.10 2.2.9 2.2.8 2.2.7 2.2.6 2.2.5 2.2.4 2.2.3 trunk 1.0.0 1.0.1 2.0.0 2.0.1 2.1.0 2.1.1 2.1.2 2.2.0 2.2.1 2.2.2
← All changes | includes/Shortcode/ShortcodeUtils.php +12 -1 2.2.10 → 2.3.0 View file →
@@ -266,8 +266,10 @@
266 266 if ( '' === $css ) {
267 267 continue;
268 268 }
269 269
270 + $css = self::sanitize_css( $css );
271 +
270 272 if ( 'base' === ( $device['value'] ?? '' ) ) {
271 273 $output .= $css;
272 274 } else {
273 275 $output .= "@media ({$device['direction']}-width:{$device['value']}px){{$css}}";
@@ -274,10 +276,19 @@
274 276 }
275 277 }
276 278
277 279 if ( ! empty( $css_map['customStyles'] ) ) {
278 - $output .= $css_map['customStyles'];
280 + $output .= self::sanitize_css( $css_map['customStyles'] );
279 281 }
280 282
281 283 return $output;
284 + }
285 +
286 + /**
287 + * Strips any HTML-tag-like sequences from a stored CSS string before it's
288 + * @param string $css Raw CSS string from a block attribute.
289 + * @return string Sanitized CSS string.
290 + */
291 + private static function sanitize_css( string $css ): string {
292 + return preg_replace( '/<[^>]*>?/', '', $css );
282 293 }
283 294 }