From 8e7ab859fd49560fd68851536bee4f26b6800dc4 Mon Sep 17 00:00:00 2001 From: Joe McGill Date: Sat, 5 Nov 2016 18:31:06 +0000 Subject: [PATCH] Customize: Remove Vimeo validation for external videos. Following [39128], this removes the validation logic for Vimeo URLs from `_validate_external_header_video()` since WP does not support the display of videos from Vimeo by default. This also includes a change to using `esc_url_raw()` instead of `esc_url()` on the URL value to avoid unexpected behavior from the inclusion of HTML entities. Props peterwilsoncc, westonruter. Fixes #38544. git-svn-id: https://develop.svn.wordpress.org/trunk@39148 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/class-wp-customize-manager.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/wp-includes/class-wp-customize-manager.php b/src/wp-includes/class-wp-customize-manager.php index 30581388d9..7b3235fc9a 100644 --- a/src/wp-includes/class-wp-customize-manager.php +++ b/src/wp-includes/class-wp-customize-manager.php @@ -3768,11 +3768,10 @@ final class WP_Customize_Manager { * @return mixed */ public function _validate_external_header_video( $validity, $value ) { - $video = esc_url( $value ); + $video = esc_url_raw( $value ); if ( $video ) { - if ( ! preg_match( '#^https?://(?:www\.)?(?:youtube\.com/watch|youtu\.be/)#', $video ) - && ! preg_match( '#^https?://(.+\.)?vimeo\.com/.*#', $video ) ) { - $validity->add( 'invalid_url', __( 'Please enter a valid YouTube or Vimeo video URL.' ) ); + if ( ! preg_match( '#^https?://(?:www\.)?(?:youtube\.com/watch|youtu\.be/)#', $video ) ) { + $validity->add( 'invalid_url', __( 'Please enter a valid YouTube URL.' ) ); } } return $validity;