Make WordPress Core


Ignore:
Timestamp:
05/24/2009 11:47:49 PM (16 years ago)
Author:
ryan
Message:

Trim tailing whitespace

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/formatting.php

    r11435 r11450  
    173173 * Checks to see if a string is utf8 encoded.
    174174 *
    175  * NOTE: This function checks for 5-Byte sequences, UTF8 
     175 * NOTE: This function checks for 5-Byte sequences, UTF8
    176176 *       has Bytes Sequences with a maximum length of 4.
    177177 *
     
    185185    $length = strlen($str);
    186186    for ($i=0; $i < $length; $i++) {
    187         $c = ord($str[$i]); 
     187        $c = ord($str[$i]);
    188188        if ($c < 0x80) $n = 0; # 0bbbbbbb
    189189        elseif (($c & 0xE0) == 0xC0) $n=1; # 110bbbbb
     
    257257        $quote_style = ENT_NOQUOTES;
    258258    }
    259    
     259
    260260    // Handle double encoding ourselves
    261261    if ( !$double_encode ) {
     
    582582 * Sanitizes a filename replacing whitespace with dashes
    583583 *
    584  * Removes special characters that are illegal in filenames on certain 
    585  * operating systems and special characters requiring special escaping 
    586  * to manipulate at the command line. Replaces spaces and consecutive 
     584 * Removes special characters that are illegal in filenames on certain
     585 * operating systems and special characters requiring special escaping
     586 * to manipulate at the command line. Replaces spaces and consecutive
    587587 * dashes with a single dash. Trim period, dash and underscore from beginning
    588588 * and end of filename.
     
    721721/**
    722722 * Santizes a html classname to ensure it only contains valid characters
    723  * 
     723 *
    724724 * Strips the string down to A-Z,a-z,0-9,'-' if this results in an empty
    725725 * string then it will return the alternative value supplied.
    726  * 
     726 *
    727727 * @todo Expand to support the full range of CDATA that a class attribute can contain.
    728  * 
     728 *
    729729 * @since 2.8.0
    730  * 
     730 *
    731731 * @param string $class The classname to be sanitized
    732732 * @param string $fallback The value to return if the sanitization end's up as an empty string.
     
    736736    //Strip out any % encoded octets
    737737    $sanitized = preg_replace('|%[a-fA-F0-9][a-fA-F0-9]|', '', $class);
    738    
     738
    739739    //Limit to A-Z,a-z,0-9,'-'
    740740    $sanitized = preg_replace('/[^A-Za-z0-9-]/', '', $sanitized);
    741    
     741
    742742    if ('' == $sanitized)
    743743        $sanitized = $fallback;
    744    
    745     return apply_filters('sanitize_html_class',$sanitized, $class, $fallback); 
     744
     745    return apply_filters('sanitize_html_class',$sanitized, $class, $fallback);
    746746}
    747747
     
    22162216 * @deprecated 2.8.0
    22172217 * @see esc_attr()
    2218  * 
     2218 *
    22192219 * @param string $text
    22202220 * @return string
Note: See TracChangeset for help on using the changeset viewer.