← All changes
|
includes/salient-widgets/property-embedded-virtual-tours-html.php
+9
-2
2.2.2
→
2.4.0
View file →
| @@ -21,8 +21,9 @@ | ||
| 21 | 21 | </style> |
| 22 | 22 | <?php |
| 23 | 23 | } |
| 24 | 24 | |
| 25 | +// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- WPBakery html_template local variable; this file is a framework-rendered view receiving $atts/$this, and PrefixAllGlobals sees it outside the framework render scope. | |
| 25 | 26 | $virtual_tours = $property->get_virtual_tours(); |
| 26 | 27 | |
| 27 | 28 | if ( !empty($virtual_tours) ) |
| 28 | 29 | { |
| @@ -27,19 +28,23 @@ | ||
| 27 | 28 | if ( !empty($virtual_tours) ) |
| 28 | 29 | { |
| 29 | 30 | echo '<div class="embedded-virtual-tours">'; |
| 30 | 31 | |
| 31 | - echo '<h4>' . __( 'Virtual Tours', 'propertyhive' ) . '</h4>'; | |
| 32 | + echo '<h4>' . esc_html__( 'Virtual Tours', 'propertyhive' ) . '</h4>'; | |
| 32 | 33 | |
| 34 | + // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- WPBakery html_template local variable; this file is a framework-rendered view receiving $atts/$this, and PrefixAllGlobals sees it outside the framework render scope. | |
| 33 | 35 | foreach ( $virtual_tours as $virtual_tour ) |
| 34 | 36 | { |
| 35 | 37 | if ( isset($settings['oembed']) && $settings['oembed'] == 'yes' ) |
| 36 | 38 | { |
| 39 | + // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- WPBakery html_template local variable; this file is a framework-rendered view receiving $atts/$this, and PrefixAllGlobals sees it outside the framework render scope. | |
| 37 | 40 | $embed_code = wp_oembed_get($virtual_tour['url']); |
| 41 | + // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- wp_oembed_get() uses WordPress provider trust and sanitization; preserve supported provider scripts and trusted PHP filters. | |
| 38 | 42 | echo $embed_code; |
| 39 | 43 | } |
| 40 | 44 | else |
| 41 | 45 | { |
| 46 | + // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- WPBakery html_template local variable; this file is a framework-rendered view receiving $atts/$this, and PrefixAllGlobals sees it outside the framework render scope. | |
| 42 | 47 | $virtual_tour['url'] = preg_replace( |
| 43 | 48 | "/\s*[a-zA-Z\/\/:\.]*youtu(be.com\/watch\?v=|.be\/)([a-zA-Z0-9\-_]+)([a-zA-Z0-9\/\*\-\_\?\&\;\%\=\.]*)/i", |
| 44 | 49 | "//www.youtube.com/embed/$2", |
| 45 | 50 | $virtual_tour['url'] |
| @@ -44,8 +49,9 @@ | ||
| 44 | 49 | "//www.youtube.com/embed/$2", |
| 45 | 50 | $virtual_tour['url'] |
| 46 | 51 | ); |
| 47 | 52 | |
| 53 | + // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- WPBakery html_template local variable; this file is a framework-rendered view receiving $atts/$this, and PrefixAllGlobals sees it outside the framework render scope. | |
| 48 | 54 | $virtual_tour['url'] = preg_replace( |
| 49 | 55 | '#https?://(www\.)?youtube\.com/shorts/([^/?]+)#', |
| 50 | 56 | '//www.youtube.com/embed/$2', |
| 51 | 57 | $virtual_tour['url'] |
| @@ -50,8 +56,9 @@ | ||
| 50 | 56 | '//www.youtube.com/embed/$2', |
| 51 | 57 | $virtual_tour['url'] |
| 52 | 58 | ); |
| 53 | 59 | |
| 60 | + // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- WPBakery html_template local variable; this file is a framework-rendered view receiving $atts/$this, and PrefixAllGlobals sees it outside the framework render scope. | |
| 54 | 61 | $virtual_tour['url'] = preg_replace( |
| 55 | 62 | '/(https?:\/\/)?(www\.)?(player\.)?vimeo\.com\/?(showcase\/)*([0-9))([a-z]*\/)*([0-9]{6,11})[?]?.*/i', |
| 56 | 63 | "//player.vimeo.com/video/$6", |
| 57 | 64 | $virtual_tour['url'] |
| @@ -61,5 +68,5 @@ | ||
| 61 | 68 | } |
| 62 | 69 | } |
| 63 | 70 | |
| 64 | 71 | echo '</div>'; |
| 65 | -} | |
| 72 | +} | |