Changeset 44207
- Timestamp:
- 12/15/2018 01:07:06 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/5.0 merged: 44014,44017
- Property svn:mergeinfo changed
-
trunk/src/wp-includes/kses.php
r44156 r44207 760 760 */ 761 761 function wp_kses_one_attr( $string, $element ) { 762 $uris = array( 'xmlns', 'profile', 'href', 'src', 'cite', 'classid', 'codebase', 'data', 'usemap', 'longdesc', 'action');762 $uris = wp_kses_uri_attributes(); 763 763 $allowed_html = wp_kses_allowed_html( 'post' ); 764 764 $allowed_protocols = wp_allowed_protocols(); … … 934 934 $pass_allowed_protocols = $allowed_protocols; 935 935 return preg_replace_callback( '%(<!--.*?(-->|$))|(<[^>]*(>|$)|>)%', '_wp_kses_split_callback', $string ); 936 } 937 938 /** 939 * Helper function listing HTML attributes containing a URL. 940 * 941 * This function returns a list of all HTML attributes that must contain 942 * a URL according to the HTML specification. 943 * 944 * This list includes URI attributes both allowed and disallowed by KSES. 945 * 946 * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes 947 * 948 * @since 5.0.1 949 * 950 * @return array HTML attributes that must include a URL. 951 */ 952 function wp_kses_uri_attributes() { 953 $uri_attributes = array( 954 'action', 955 'archive', 956 'background', 957 'cite', 958 'classid', 959 'codebase', 960 'data', 961 'formaction', 962 'href', 963 'icon', 964 'longdesc', 965 'manifest', 966 'poster', 967 'profile', 968 'src', 969 'usemap', 970 'xmlns', 971 ); 972 973 /** 974 * Filters the list of attributes that are required to contain a URL. 975 * 976 * Use this filter to add any `data-` attributes that are required to be 977 * validated as a URL. 978 * 979 * @since 5.0.1 980 * 981 * @param array $uri_attributes HTML attributes requiring validation as a URL. 982 */ 983 $uri_attributes = apply_filters( 'wp_kses_uri_attributes', $uri_attributes ); 984 985 return $uri_attributes; 936 986 } 937 987 … … 1163 1213 $mode = 0; 1164 1214 $attrname = ''; 1165 $uris = array( 'xmlns', 'profile', 'href', 'src', 'cite', 'classid', 'codebase', 'data', 'usemap', 'longdesc', 'action');1215 $uris = wp_kses_uri_attributes(); 1166 1216 1167 1217 // Loop through the whole attribute list
Note: See TracChangeset
for help on using the changeset viewer.