Make WordPress Core

Ticket #23313: 23313.diff

File 23313.diff, 1.4 KB (added by bananastalktome, 13 years ago)
  • wp-includes/formatting.php

     
    55 * Handles many functions for formatting output.
    66 *
    77 * @package WordPress
    8  **/
     8 */
    99
    1010/**
    1111 * Replaces common plain text characters into formatted entities
     
    947947        return $title;
    948948}
    949949
    950 function sanitize_title_for_query($title) {
    951         return sanitize_title($title, '', 'query');
     950/**
     951 * Sanitizes title for use in a URL.
     952 *
     953 * @uses sanitize_title()
     954 *
     955 * @since 3.1
     956 *
     957 * @param string $title The string to be sanitized.
     958 * @return string The sanitized string.
     959 */
     960function sanitize_title_for_query( $title ) {
     961        return sanitize_title( $title, '', 'query' );
    952962}
    953963
    954964/**
     
    31763186        return '<' . $tag . $link . ' target="' . esc_attr( $_links_add_target ) . '">';
    31773187}
    31783188
    3179 // normalize EOL characters and strip duplicate whitespace
     3189/**
     3190 * Normalize EOL characters and strip duplicate whitespace.
     3191 *
     3192 * @since 2.7
     3193 *
     3194 * @param string $str
     3195 * @return string
     3196 */
    31803197function normalize_whitespace( $str ) {
    3181         $str  = trim($str);
    3182         $str  = str_replace("\r", "\n", $str);
     3198        $str  = trim( $str );
     3199        $str  = str_replace( "\r", "\n", $str );
    31833200        $str  = preg_replace( array( '/\n+/', '/[ \t]+/' ), array( "\n", ' ' ), $str );
    31843201        return $str;
    31853202}