Make WordPress Core

Ticket #8017: 8017_feed.diff

File 8017_feed.diff, 952 bytes (added by hailin, 18 years ago)

patch

  • C:/xampp/htdocs/wordpress_trunk/wp-includes/feed.php

     
    401401                if ($key == 'enclosure') {
    402402                        foreach ( (array) $val as $enc ) {
    403403                                $enclosure = split("\n", $enc);
    404                                 echo apply_filters('rss_enclosure', '<enclosure url="' . trim(htmlspecialchars($enclosure[0])) . '" length="' . trim($enclosure[1]) . '" type="' . trim($enclosure[2]) . '" />' . "\n");
     404                               
     405                                //only get the the first element eg, audio/mpeg from 'audio/mpeg mpga mp2 mp3'
     406                                $t = split('[ \t]', trim($enclosure[2]) );
     407                                $type = $t[0];
     408                               
     409                                echo apply_filters('rss_enclosure', '<enclosure url="' . trim(htmlspecialchars($enclosure[0])) . '" length="' . trim($enclosure[1]) . '" type="' . $type . '" />' . "\n");
    405410                        }
    406411                }
    407412        }