Changeset 11450 for trunk/wp-includes/formatting.php
- Timestamp:
- 05/24/2009 11:47:49 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/formatting.php
r11435 r11450 173 173 * Checks to see if a string is utf8 encoded. 174 174 * 175 * NOTE: This function checks for 5-Byte sequences, UTF8 175 * NOTE: This function checks for 5-Byte sequences, UTF8 176 176 * has Bytes Sequences with a maximum length of 4. 177 177 * … … 185 185 $length = strlen($str); 186 186 for ($i=0; $i < $length; $i++) { 187 $c = ord($str[$i]); 187 $c = ord($str[$i]); 188 188 if ($c < 0x80) $n = 0; # 0bbbbbbb 189 189 elseif (($c & 0xE0) == 0xC0) $n=1; # 110bbbbb … … 257 257 $quote_style = ENT_NOQUOTES; 258 258 } 259 259 260 260 // Handle double encoding ourselves 261 261 if ( !$double_encode ) { … … 582 582 * Sanitizes a filename replacing whitespace with dashes 583 583 * 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 587 587 * dashes with a single dash. Trim period, dash and underscore from beginning 588 588 * and end of filename. … … 721 721 /** 722 722 * Santizes a html classname to ensure it only contains valid characters 723 * 723 * 724 724 * Strips the string down to A-Z,a-z,0-9,'-' if this results in an empty 725 725 * string then it will return the alternative value supplied. 726 * 726 * 727 727 * @todo Expand to support the full range of CDATA that a class attribute can contain. 728 * 728 * 729 729 * @since 2.8.0 730 * 730 * 731 731 * @param string $class The classname to be sanitized 732 732 * @param string $fallback The value to return if the sanitization end's up as an empty string. … … 736 736 //Strip out any % encoded octets 737 737 $sanitized = preg_replace('|%[a-fA-F0-9][a-fA-F0-9]|', '', $class); 738 738 739 739 //Limit to A-Z,a-z,0-9,'-' 740 740 $sanitized = preg_replace('/[^A-Za-z0-9-]/', '', $sanitized); 741 741 742 742 if ('' == $sanitized) 743 743 $sanitized = $fallback; 744 745 return apply_filters('sanitize_html_class',$sanitized, $class, $fallback); 744 745 return apply_filters('sanitize_html_class',$sanitized, $class, $fallback); 746 746 } 747 747 … … 2216 2216 * @deprecated 2.8.0 2217 2217 * @see esc_attr() 2218 * 2218 * 2219 2219 * @param string $text 2220 2220 * @return string
Note: See TracChangeset
for help on using the changeset viewer.