Make WordPress Core

Ticket #33591: 33591.diff

File 33591.diff, 1.1 KB (added by vtieu, 9 years ago)
  • feed.php

     
    502502                if ($key == 'enclosure') {
    503503                        foreach ( (array) $val as $enc ) {
    504504                                $enclosure = explode("\n", $enc);
     505                                $new_enclosure = array( 'href' => trim( htmlspecialchars( $enclosure[0] ) ), 'length' => trim( $enclosure[1] ), 'type' => trim( htmlspecialchars( $enclosure[2] ) ) );
     506                                $new_enclosure = array_merge($new_enclosure, array_slice($enclosure, 3));
    505507                                /**
    506508                                 * Filter the atom enclosure HTML link tag for the current post.
    507509                                 *
     
    509511                                 *
    510512                                 * @param string $html_link_tag The HTML link tag with a URI and other attributes.
    511513                                 */
    512                                 echo apply_filters( 'atom_enclosure', '<link href="' . trim( htmlspecialchars( $enclosure[0] ) ) . '" rel="enclosure" length="' . trim( $enclosure[1] ) . '" type="' . trim( $enclosure[2] ) . '" />' . "\n" );
     514                                echo apply_filters( 'atom_enclosure', '<link href="' . $new_enclosure['href'] . '" rel="enclosure" length="' . $new_enclosure['length'] . '" type="' . $new_enclosure['type'] . '" />' . "\n" );
    513515                        }
    514516                }
    515517        }