| 1 | Index: wp-includes/formatting.php |
|---|
| 2 | =================================================================== |
|---|
| 3 | --- wp-includes/formatting.php (revision 23355) |
|---|
| 4 | +++ wp-includes/formatting.php (working copy) |
|---|
| 5 | @@ -5,7 +5,7 @@ |
|---|
| 6 | * Handles many functions for formatting output. |
|---|
| 7 | * |
|---|
| 8 | * @package WordPress |
|---|
| 9 | - **/ |
|---|
| 10 | + */ |
|---|
| 11 | |
|---|
| 12 | /** |
|---|
| 13 | * Replaces common plain text characters into formatted entities |
|---|
| 14 | @@ -947,8 +947,18 @@ |
|---|
| 15 | return $title; |
|---|
| 16 | } |
|---|
| 17 | |
|---|
| 18 | -function sanitize_title_for_query($title) { |
|---|
| 19 | - return sanitize_title($title, '', 'query'); |
|---|
| 20 | +/** |
|---|
| 21 | + * Sanitizes title for use in a URL. |
|---|
| 22 | + * |
|---|
| 23 | + * @uses sanitize_title() |
|---|
| 24 | + * |
|---|
| 25 | + * @since 3.1 |
|---|
| 26 | + * |
|---|
| 27 | + * @param string $title The string to be sanitized. |
|---|
| 28 | + * @return string The sanitized string. |
|---|
| 29 | + */ |
|---|
| 30 | +function sanitize_title_for_query( $title ) { |
|---|
| 31 | + return sanitize_title( $title, '', 'query' ); |
|---|
| 32 | } |
|---|
| 33 | |
|---|
| 34 | /** |
|---|
| 35 | @@ -3176,10 +3186,17 @@ |
|---|
| 36 | return '<' . $tag . $link . ' target="' . esc_attr( $_links_add_target ) . '">'; |
|---|
| 37 | } |
|---|
| 38 | |
|---|
| 39 | -// normalize EOL characters and strip duplicate whitespace |
|---|
| 40 | +/** |
|---|
| 41 | + * Normalize EOL characters and strip duplicate whitespace. |
|---|
| 42 | + * |
|---|
| 43 | + * @since 2.7 |
|---|
| 44 | + * |
|---|
| 45 | + * @param string $str |
|---|
| 46 | + * @return string |
|---|
| 47 | + */ |
|---|
| 48 | function normalize_whitespace( $str ) { |
|---|
| 49 | - $str = trim($str); |
|---|
| 50 | - $str = str_replace("\r", "\n", $str); |
|---|
| 51 | + $str = trim( $str ); |
|---|
| 52 | + $str = str_replace( "\r", "\n", $str ); |
|---|
| 53 | $str = preg_replace( array( '/\n+/', '/[ \t]+/' ), array( "\n", ' ' ), $str ); |
|---|
| 54 | return $str; |
|---|
| 55 | } |
|---|