Ticket #23313: 23313.2.diff
| File 23313.2.diff, 3.6 KB (added by , 14 years ago) |
|---|
-
wp-includes/formatting.php
5 5 * Handles many functions for formatting output. 6 6 * 7 7 * @package WordPress 8 * */8 */ 9 9 10 10 /** 11 11 * Replaces common plain text characters into formatted entities … … 134 134 * Search for disabled element tags. Push element to stack on tag open and pop 135 135 * on tag close. Assumes first character of $text is tag opening. 136 136 * 137 * @since 2.9.0 137 138 * @access private 138 * @since 2.9.0139 139 * 140 140 * @param string $text Text to check. First character is assumed to be $opening 141 141 * @param array $stack Array used as stack of opened tag elements … … 262 262 * 263 263 * @since 3.1.0 264 264 * @access private 265 * 265 266 * @param array $matches preg_replace_callback matches array 266 267 * @return string 267 268 */ … … 363 364 * ", or ENT_QUOTES to do both. Default is ENT_NOQUOTES where no quotes are encoded. 364 365 * 365 366 * @since 1.2.2 367 * @access private 366 368 * 367 369 * @param string $string The text which is to be encoded. 368 370 * @param mixed $quote_style Optional. Converts double quotes if set to ENT_COMPAT, both single and double if set to ENT_QUOTES or none if set to ENT_NOQUOTES. Also compatible with old values; converting single quotes if set to 'single', double if set to 'double' or both if otherwise set. Default is ENT_NOQUOTES. … … 442 444 * $quote_style can be set to ENT_COMPAT to decode " entities, 443 445 * or ENT_QUOTES to do both " and '. Default is ENT_NOQUOTES where no quotes are decoded. 444 446 * 445 * @since 2.8 447 * @since 2.8.0 446 448 * 447 449 * @param string $string The text which is to be decoded. 448 450 * @param mixed $quote_style Optional. Converts double quotes if set to ENT_COMPAT, both single and double if set to ENT_QUOTES or none if set to ENT_NOQUOTES. Also compatible with old _wp_specialchars() values; converting single quotes if set to 'single', double if set to 'double' or both if otherwise set. Default is ENT_NOQUOTES. … … 499 501 /** 500 502 * Checks for invalid UTF8 in a string. 501 503 * 502 * @since 2.8 504 * @since 2.8.0 503 505 * 504 506 * @param string $string The text which is to be checked. 505 507 * @param boolean $strip Optional. Whether to attempt to strip out invalid UTF8. Default is false. … … 947 949 return $title; 948 950 } 949 951 950 function sanitize_title_for_query($title) { 951 return sanitize_title($title, '', 'query'); 952 /** 953 * Sanitizes title for use in a URL. 954 * 955 * @uses sanitize_title() 956 * 957 * @since 3.1.0 958 * 959 * @param string $title The string to be sanitized. 960 * @return string The sanitized string. 961 */ 962 function sanitize_title_for_query( $title ) { 963 return sanitize_title( $title, '', 'query' ); 952 964 } 953 965 954 966 /** … … 1870 1882 * 1871 1883 * @since 3.1.0 1872 1884 * @access private 1885 * 1873 1886 * @param array $match The preg_replace_callback matches array 1874 1887 * @return array Converted chars 1875 1888 */ … … 2692 2705 /** 2693 2706 * Escaping for textarea values. 2694 2707 * 2695 * @since 3.1 2708 * @since 3.1.0 2696 2709 * 2697 2710 * @param string $text 2698 2711 * @return string … … 3176 3189 return '<' . $tag . $link . ' target="' . esc_attr( $_links_add_target ) . '">'; 3177 3190 } 3178 3191 3179 // normalize EOL characters and strip duplicate whitespace 3192 /** 3193 * Normalize EOL characters and strip duplicate whitespace. 3194 * 3195 * @since 2.7.0 3196 * 3197 * @param string $str The string to normalize. 3198 * @return string The normalized string. 3199 */ 3180 3200 function normalize_whitespace( $str ) { 3181 $str = trim( $str);3182 $str = str_replace( "\r", "\n", $str);3201 $str = trim( $str ); 3202 $str = str_replace( "\r", "\n", $str ); 3183 3203 $str = preg_replace( array( '/\n+/', '/[ \t]+/' ), array( "\n", ' ' ), $str ); 3184 3204 return $str; 3185 3205 }
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)