Make WordPress Core

Changeset 9501


Ignore:
Timestamp:
11/03/2008 08:19:38 PM (17 years ago)
Author:
ryan
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/feed.php

    r9148 r9501  
    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        }
Note: See TracChangeset for help on using the changeset viewer.