Changeset 45016 for trunk/src/wp-includes/load.php
- Timestamp:
- 03/26/2019 11:10:21 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/load.php
r45015 r45016 1530 1530 1531 1531 } 1532 1533 /** 1534 * 1535 * Checks whether current request is a XML request, or is expecting a XML response. 1536 * 1537 * @since 5.2.0 1538 * 1539 * @return bool True if Accepts or Content-Type headers contain xml, false otherwise. 1540 */ 1541 function wp_is_xml_request() { 1542 $accepted = array( 1543 'text/xml', 1544 'application/rss+xml', 1545 'application/atom+xml', 1546 'application/rdf+xml', 1547 'text/xml+oembed', 1548 'application/xml+oembed', 1549 ); 1550 1551 if ( isset( $_SERVER['HTTP_ACCEPT'] ) ) { 1552 foreach ( $accepted as $type ) { 1553 if ( false !== strpos( $_SERVER['HTTP_ACCEPT'], $type ) ) { 1554 return true; 1555 } 1556 } 1557 } 1558 1559 if ( isset( $_SERVER['CONTENT_TYPE'] ) && in_array( $_SERVER['CONTENT_TYPE'], $accepted, true ) ) { 1560 return true; 1561 } 1562 1563 return false; 1564 }
Note: See TracChangeset
for help on using the changeset viewer.