PluginProbe
WPVR – 360 Panorama viewer and Virtual Tour Builder for WordPress / 9.2.0
WPVR – 360 Panorama viewer and Virtual Tour Builder for WordPress v9.2.0
9.2.0 9.1.4 9.1.3 9.1.2 9.1.1 9.1.0 9.0.3 9.0.2 9.0.1 9.0.0 8.5.79 8.5.78 8.5.77 8.5.76 8.5.75 8.5.74 8.5.73 8.5.72 8.5.71 8.5.70 8.5.69 8.5.68 8.5.35 8.5.36 8.5.37 All 224 releases
wpvr / src / Content / TextOverlayContent.php

TextOverlayContent.php in WPVR – 360 Panorama viewer and Virtual Tour Builder for WordPress 9.2.0, at src/Content/TextOverlayContent.php

43 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace RexTheme\WPVR\Content;
4
5 /**
6 * Sanitize overlay rich text without stripping the editor's video embeds.
7 */
8 class TextOverlayContent {
9
10 public static function sanitize( string $html ): string {
11 $allowed_html = wp_kses_allowed_html( 'post' );
12
13 // YouTube, Vimeo and other iframe players inserted through Media or HTML.
14 // Keep srcdoc and inline event handlers excluded.
15 $allowed_html['iframe'] = [
16 'src' => true,
17 'width' => true,
18 'height' => true,
19 'title' => true,
20 'class' => true,
21 'style' => true,
22 'frameborder' => true,
23 'allow' => true,
24 'allowfullscreen' => true,
25 'webkitallowfullscreen' => true,
26 'mozallowfullscreen' => true,
27 'referrerpolicy' => true,
28 'loading' => true,
29 'sandbox' => true,
30 ];
31
32 // TinyMCE uses child sources for direct video URLs and alternative formats.
33 $allowed_html['source'] = [
34 'src' => true,
35 'type' => true,
36 'media' => true,
37 ];
38 // Native video/audio tags, playback attributes and caption tracks use
39 // the standard post allowlist above.
40 return wp_kses( $html, $allowed_html );
41 }
42 }
43