[wp-trac] [WordPress Trac] #44610: Update regex used for YouTube videos in class-wp-customize-manager.php::_validate_external_header_video()
WordPress Trac
noreply at wordpress.org
Thu Jul 19 07:59:59 UTC 2018
#44610: Update regex used for YouTube videos in class-wp-customize-
manager.php::_validate_external_header_video()
-------------------------+-----------------------------
Reporter: jepperask | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Customize | Version: 4.9.7
Severity: normal | Keywords:
Focuses: |
-------------------------+-----------------------------
The file "wp-includes/class-wp-customize-manager.php" includes a function
"_validate_external_header_video( $validity, $value )". The regex used in
this function is incomplete, as some urls are invalidated in the
customizer. What is interesting is that the regex used in "wp-includes/js
/wp-custom-header.js" (which actually sets the youtube video), is
different and validates e.g the youtube-nocookie.com URLs, that I think
more people will need due to GDPR.
In the javascript file, it actually quotes a stackoverflow regex found at:
http://stackoverflow.com/a/27728417
**Proposal:**
Update the regex in "wp-includes/class-wp-customize-manager.php" (line
5664) to match the one used in "wp-includes/js/wp-custom-header.js" (line
379).
--
Ticket URL: <https://core.trac.wordpress.org/ticket/44610>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list