Make WordPress Core

Changeset 39148


Ignore:
Timestamp:
11/05/2016 06:31:06 PM (8 years ago)
Author:
joemcgill
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-customize-manager.php

    r39140 r39148  
    37693769     */
    37703770    public function _validate_external_header_video( $validity, $value ) {
    3771         $video = esc_url( $value );
     3771        $video = esc_url_raw( $value );
    37723772        if ( $video ) {
    3773             if ( ! preg_match( '#^https?://(?:www\.)?(?:youtube\.com/watch|youtu\.be/)#', $video )
    3774                  && ! preg_match( '#^https?://(.+\.)?vimeo\.com/.*#', $video ) ) {
    3775                 $validity->add( 'invalid_url', __( 'Please enter a valid YouTube or Vimeo video URL.' ) );
     3773            if ( ! preg_match( '#^https?://(?:www\.)?(?:youtube\.com/watch|youtu\.be/)#', $video ) ) {
     3774                $validity->add( 'invalid_url', __( 'Please enter a valid YouTube URL.' ) );
    37763775            }
    37773776        }
Note: See TracChangeset for help on using the changeset viewer.