Changeset 48429 for trunk/src/wp-includes/feed.php
- Timestamp:
- 07/10/2020 10:21:22 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/feed.php
r48322 r48429 520 520 foreach ( (array) $val as $enc ) { 521 521 $enclosure = explode( "\n", $enc ); 522 523 $url = ''; 524 $type = ''; 525 $length = 0; 526 527 $mimes = get_allowed_mime_types(); 528 529 // Parse url 530 if ( isset( $enclosure[0] ) && is_string( $enclosure[0] ) ) { 531 $url = trim( $enclosure[0] ); 532 } 533 534 // Parse length and type 535 foreach ( range( 1, 2 ) as $i ) { 536 if ( isset( $enclosure[ $i ] ) ) { 537 if ( is_numeric( $enclosure[ $i ] ) ) { 538 $length = trim( $enclosure[ $i ] ); 539 } elseif ( in_array( $enclosure[ $i ], $mimes ) ) { 540 $type = trim( $enclosure[ $i ] ); 541 } 542 } 543 } 544 545 $html_link_tag = sprintf( 546 "<link href=\"%s\" rel=\"enclosure\" length=\"%d\" type=\"%s\" />\n", 547 esc_url( $url ), 548 esc_attr( $length ), 549 esc_attr( $type ) 550 ); 522 551 /** 523 552 * Filters the atom enclosure HTML link tag for the current post. … … 527 556 * @param string $html_link_tag The HTML link tag with a URI and other attributes. 528 557 */ 529 echo apply_filters( 'atom_enclosure', '<link href="' . esc_url( trim( $enclosure[0] ) ) . '" rel="enclosure" length="' . absint( trim( $enclosure[1] ) ) . '" type="' . esc_attr( trim( $enclosure[2] ) ) . '" />' . "\n");558 echo apply_filters( 'atom_enclosure', $html_link_tag ); 530 559 } 531 560 }
Note: See TracChangeset
for help on using the changeset viewer.