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

git-svn-id: http://svn.automattic.com/wordpress/trunk@9501 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2008-11-03 20:19:38 +00:00
parent 1e3183ac77
commit 851e47cb22
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");
}
}
}