Use only one enclosure type. Props hailin. fixes #8017

git-svn-id: https://develop.svn.wordpress.org/trunk@9501 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2008-11-03 20:19:38 +00:00
parent 8c0707aaec
commit 9db325beab
1 changed files with 6 additions and 1 deletions

View File

@ -401,7 +401,12 @@ function rss_enclosure() {
if ($key == 'enclosure') {
foreach ( (array) $val as $enc ) {
$enclosure = split("\n", $enc);
echo apply_filters('rss_enclosure', '<enclosure url="' . trim(htmlspecialchars($enclosure[0])) . '" length="' . trim($enclosure[1]) . '" type="' . trim($enclosure[2]) . '" />' . "\n");
//only get the the first element eg, audio/mpeg from 'audio/mpeg mpga mp2 mp3'
$t = split('[ \t]', trim($enclosure[2]) );
$type = $t[0];
echo apply_filters('rss_enclosure', '<enclosure url="' . trim(htmlspecialchars($enclosure[0])) . '" length="' . trim($enclosure[1]) . '" type="' . $type . '" />' . "\n");
}
}
}