Changeset 44014
- Timestamp:
- 12/12/2018 11:52:05 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/5.0/src/wp-includes/kses.php
r43994 r44014 540 540 */ 541 541 function wp_kses_one_attr( $string, $element ) { 542 $uris = array('xmlns', 'profile', 'href', 'src', 'cite', 'classid', 'codebase', 'data', 'usemap', 'longdesc', 'action');542 $uris = wp_kses_uri_attributes(); 543 543 $allowed_html = wp_kses_allowed_html( 'post' ); 544 544 $allowed_protocols = wp_allowed_protocols(); … … 735 735 $pass_allowed_protocols = $allowed_protocols; 736 736 return preg_replace_callback( '%(<!--.*?(-->|$))|(<[^>]*(>|$)|>)%', '_wp_kses_split_callback', $string ); 737 } 738 739 /** 740 * Helper function listing HTML attributes containing a URL. 741 * 742 * This function returns a list of all HTML attributes that must contain 743 * a URL according to the HTML specification. 744 * 745 * This list includes URI attributes both allowed and disallowed by KSES. 746 * 747 * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes 748 * 749 * @since 4.9.9 750 * 751 * @return array HTML attributes that must include a URL. 752 */ 753 function wp_kses_uri_attributes() { 754 $uri_attributes = array( 755 'action', 756 'archive', 757 'background', 758 'cite', 759 'classid', 760 'codebase', 761 'data', 762 'formaction', 763 'href', 764 'icon', 765 'longdesc', 766 'manifest', 767 'poster', 768 'profile', 769 'src', 770 'usemap', 771 'xmlns', 772 ); 773 774 /** 775 * Filters the list of attributes that are required to contain a URL. 776 * 777 * Use this filter to add any `data-` attributes that are required to be 778 * validated as a URL. 779 * 780 * @since 4.9.9 781 * 782 * @param array $uri_attributes HTML attributes requiring validation as a URL. 783 */ 784 $uri_attributes = apply_filters( 'wp_kses_uri_attributes', $uri_attributes ); 785 786 return $uri_attributes; 737 787 } 738 788 … … 954 1004 $mode = 0; 955 1005 $attrname = ''; 956 $uris = array('xmlns', 'profile', 'href', 'src', 'cite', 'classid', 'codebase', 'data', 'usemap', 'longdesc', 'action');1006 $uris = wp_kses_uri_attributes(); 957 1007 958 1008 // Loop through the whole attribute list
Note: See TracChangeset
for help on using the changeset viewer.