PluginProbe
Jetpack – WP Security, Backup, Speed, & Growth / 16.3-a.1
Jetpack – WP Security, Backup, Speed, & Growth v16.3-a.1
16.3-a.3 16.3-a.1 16.2 16.2-beta 12.0.3 12.1.3 12.2.3 12.3.2 12.4.2 12.5.2 12.6.4 12.7.3 12.8.3 12.9.5 13.0.2 13.1.5 13.2.4 13.3.3 13.4.5 13.5.2 13.6.2 13.7.2 13.8.3 13.9.2 14.0.1 All 504 releases
← All changes | modules/shortcodes/vimeo.php +9 -2 13.9.216.3-a.1 View file →
@@ -13,8 +13,12 @@
13 13 *
14 14 * @package automattic/jetpack
15 15 */
16 16
17 +if ( ! defined( 'ABSPATH' ) ) {
18 + exit( 0 );
19 +}
20 +
17 21 /**
18 22 * Extract Vimeo ID from shortcode.
19 23 *
20 24 * @param array $atts Shortcode attributes.
@@ -341,10 +345,13 @@
341 345 }
342 346
343 347 return $content;
344 348 }
345 -add_filter( 'pre_kses', 'vimeo_embed_to_shortcode' );
346 349
350 +if ( jetpack_shortcodes_should_hook_pre_kses() ) {
351 + add_filter( 'pre_kses', 'vimeo_embed_to_shortcode' );
352 +}
353 +
347 354 /**
348 355 * Replaces shortcodes and plain-text URLs to Vimeo videos with Vimeo embeds.
349 356 * Covers shortcode usage [vimeo 1234] | [vimeo https://vimeo.com/1234] | [vimeo http://vimeo.com/1234]
350 357 * Or plain text URLs https://vimeo.com/1234 | vimeo.com/1234 | //vimeo.com/1234
@@ -397,9 +404,9 @@
397 404 * @param array $matches An array containing a Vimeo URL.
398 405 * @return string The Vimeo HTML embed code.
399 406 */
400 407 function vimeo_link_callback( $matches ) {
401 - $id = isset( $matches[2] ) ? $matches[2] : $matches[1];
408 + $id = $matches[2] ?? $matches[1];
402 409 if ( isset( $id ) && ctype_digit( $id ) ) {
403 410 return "\n" . vimeo_shortcode( array( 'id' => $id ) ) . "\n";
404 411 }
405 412 return $matches[0];