Changeset 48478
- Timestamp:
- 07/14/2020 12:39:16 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/kses.php
r48199 r48478 737 737 * 738 738 * @param string $string Text content to filter. 739 * @param array[]|string $allowed_html An array of allowed HTML elements and attributes, or a 740 * context name such as 'post'. 739 * @param array[]|string $allowed_html An array of allowed HTML elements and attributes, 740 * or a context name such as 'post'. See wp_kses_allowed_html() 741 * for the list of accepted context names. 741 742 * @param string[] $allowed_protocols Array of allowed URL protocols. 742 743 * @return string Filtered content containing only the allowed HTML. … … 746 747 $allowed_protocols = wp_allowed_protocols(); 747 748 } 749 748 750 $string = wp_kses_no_null( $string, array( 'slash_zero' => 'keep' ) ); 749 751 $string = wp_kses_normalize_entities( $string ); 750 752 $string = wp_kses_hook( $string, $allowed_html, $allowed_protocols ); 753 751 754 return wp_kses_split( $string, $allowed_html, $allowed_protocols ); 752 755 } … … 910 913 * @since 1.0.0 911 914 * 912 * @param string $string Content to filter through KSES. 913 * @param array[]|string $allowed_html List of allowed HTML elements. 914 * @param string[] $allowed_protocols Array of allowed URL protocols. 915 * @param string $string Content to filter through KSES. 916 * @param array[]|string $allowed_html An array of allowed HTML elements and attributes, 917 * or a context name such as 'post'. See wp_kses_allowed_html() 918 * for the list of accepted context names. 919 * @param string[] $allowed_protocols Array of allowed URL protocols. 915 920 * @return string Filtered content through {@see 'pre_kses'} hook. 916 921 */ 917 922 function wp_kses_hook( $string, $allowed_html, $allowed_protocols ) { 918 923 /** 919 * Filters content to be run through kses.924 * Filters content to be run through KSES. 920 925 * 921 926 * @since 2.3.0 922 927 * 923 * @param string $string Content to run through KSES. 924 * @param array[]|string $allowed_html Allowed HTML elements. 925 * @param string[] $allowed_protocols Array of allowed URL protocols. 928 * @param string $string Content to filter through KSES. 929 * @param array[]|string $allowed_html An array of allowed HTML elements and attributes, 930 * or a context name such as 'post'. See wp_kses_allowed_html() 931 * for the list of accepted context names. 932 * @param string[] $allowed_protocols Array of allowed URL protocols. 926 933 */ 927 934 return apply_filters( 'pre_kses', $string, $allowed_html, $allowed_protocols ); … … 946 953 * @since 1.0.0 947 954 * 948 * @global array $pass_allowed_html 949 * @global array $pass_allowed_protocols 950 * 951 * @param string $string Content to filter. 952 * @param array $allowed_html Allowed HTML elements. 953 * @param string[] $allowed_protocols Array of allowed URL protocols. 955 * @global array[]|string $pass_allowed_html An array of allowed HTML elements and attributes, 956 * or a context name such as 'post'. 957 * @global string[] $pass_allowed_protocols Array of allowed URL protocols. 958 * 959 * @param string $string Content to filter. 960 * @param array[]|string $allowed_html An array of allowed HTML elements and attributes, 961 * or a context name such as 'post'. See wp_kses_allowed_html() 962 * for the list of accepted context names. 963 * @param string[] $allowed_protocols Array of allowed URL protocols. 954 964 * @return string Content with fixed HTML tags 955 965 */ 956 966 function wp_kses_split( $string, $allowed_html, $allowed_protocols ) { 957 967 global $pass_allowed_html, $pass_allowed_protocols; 968 958 969 $pass_allowed_html = $allowed_html; 959 970 $pass_allowed_protocols = $allowed_protocols; 971 960 972 return preg_replace_callback( '%(<!--.*?(-->|$))|(<[^>]*(>|$)|>)%', '_wp_kses_split_callback', $string ); 961 973 } … … 1018 1030 * @ignore 1019 1031 * 1020 * @global array $pass_allowed_html 1021 * @global array $pass_allowed_protocols 1032 * @global array[]|string $pass_allowed_html An array of allowed HTML elements and attributes, 1033 * or a context name such as 'post'. 1034 * @global string[] $pass_allowed_protocols Array of allowed URL protocols. 1022 1035 * 1023 1036 * @return string … … 1025 1038 function _wp_kses_split_callback( $match ) { 1026 1039 global $pass_allowed_html, $pass_allowed_protocols; 1040 1027 1041 return wp_kses_split2( $match[0], $pass_allowed_html, $pass_allowed_protocols ); 1028 1042 } … … 1044 1058 * @since 1.0.0 1045 1059 * 1046 * @param string $string Content to filter. 1047 * @param array $allowed_html Allowed HTML elements. 1048 * @param string[] $allowed_protocols Array of allowed URL protocols. 1060 * @param string $string Content to filter. 1061 * @param array[]|string $allowed_html An array of allowed HTML elements and attributes, 1062 * or a context name such as 'post'. See wp_kses_allowed_html() 1063 * for the list of accepted context names. 1064 * @param string[] $allowed_protocols Array of allowed URL protocols. 1049 1065 * @return string Fixed HTML element 1050 1066 */ … … 1110 1126 * @since 1.0.0 1111 1127 * 1112 * @param string $element HTML element/tag. 1113 * @param string $attr HTML attributes from HTML element to closing HTML element tag. 1114 * @param array $allowed_html Allowed HTML elements. 1115 * @param string[] $allowed_protocols Array of allowed URL protocols. 1128 * @param string $element HTML element/tag. 1129 * @param string $attr HTML attributes from HTML element to closing HTML element tag. 1130 * @param array[]|string $allowed_html An array of allowed HTML elements and attributes, 1131 * or a context name such as 'post'. See wp_kses_allowed_html() 1132 * for the list of accepted context names. 1133 * @param string[] $allowed_protocols Array of allowed URL protocols. 1116 1134 * @return string Sanitized HTML element. 1117 1135 */
Note: See TracChangeset
for help on using the changeset viewer.