| 505 | | $enclosure = explode("\n", $enc); |
| | 505 | |
| | 506 | /* Since enclosures are passed-in line-delimited, |
| | 507 | * the best we can do is attempt to validate the values |
| | 508 | * before rendering them. |
| | 509 | */ |
| | 510 | $enclosure = explode( "\n", $enc ); |
| | 511 | |
| | 512 | $url = ''; |
| | 513 | $legth = ''; |
| | 514 | $type = ''; |
| | 515 | |
| | 516 | if ( isset( $enclosure[0] ) && is_string( $enclosure[0] ) ) { |
| | 517 | $url = $enclosure[0]; |
| | 518 | } |
| | 519 | |
| | 520 | if ( isset( $enclosure[1] && is_numeric( $enclosure[1] ) ) { |
| | 521 | $length = $enclosure[1]; |
| | 522 | } |
| | 523 | |
| | 524 | if ( isset( $enclosure[2] && in_array( $enclosure[2], get_allowed_mime_types() ) ) { |
| | 525 | $type = $enclosure[2]; |
| | 526 | } |
| | 527 | |
| | 528 | $html_link_tag = '<link href="' . esc_url ( $url ) . '" rel="enclosure" length="' . esc_attr( $length ) . '" type="' . esc_attr( $type ) . '" />' . "\n"; |
| | 529 | |