mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-21 22:15:28 +00:00
Feeds: Validate enclosures prior to generating tags.
Prevent possible PHP warnings caused by malformed enclosure meta data. This change ensures the enclosure meta data has at least three lines of text before generating the tag in `rss_enclosure()`. Props arypneta, johnjamesjacoby, nihar007, rahmohn, rghedin, zahardoc. Fixes #58798. Built from https://develop.svn.wordpress.org/trunk@59241 git-svn-id: http://core.svn.wordpress.org/trunk@58633 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
0d6d21f9a9
commit
d30cc780fd
@ -482,6 +482,10 @@ function rss_enclosure() {
|
||||
foreach ( (array) $val as $enc ) {
|
||||
$enclosure = explode( "\n", $enc );
|
||||
|
||||
if ( count( $enclosure ) < 3 ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Only get the first element, e.g. 'audio/mpeg' from 'audio/mpeg mpga mp2 mp3'.
|
||||
$t = preg_split( '/[ \t]/', trim( $enclosure[2] ) );
|
||||
$type = $t[0];
|
||||
|
@ -16,7 +16,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '6.7-beta3-59240';
|
||||
$wp_version = '6.7-beta3-59241';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
Loading…
x
Reference in New Issue
Block a user