Fix regex in function rss_enclosure(), fixes #9192

git-svn-id: https://develop.svn.wordpress.org/trunk@10615 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz 2009-02-21 06:14:52 +00:00
parent c4e96ccd38
commit b5e8ea9436
1 changed files with 2 additions and 2 deletions

View File

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