Ticket #5638: 5638.r8783.diff
File 5638.r8783.diff, 6.1 KB (added by , 16 years ago) |
---|
-
formatting.php
154 154 /** 155 155 * Checks to see if a string is utf8 encoded. 156 156 * 157 * @author bmorel at ssi dot fr 158 * 157 159 * @since 1.2.1 158 160 * 159 161 * @param string $Str The string to be checked … … 211 213 } 212 214 213 215 /** 214 * {@internal Missing Short Description}}216 * Encode the Unicode values to be used in the URI. 215 217 * 216 * {@internal Missing Long Description}}217 *218 218 * @since 1.5.0 219 219 * 220 * @param unknown_type$utf8_string221 * @param unknown_type $length222 * @return unknown220 * @param string $utf8_string 221 * @param int $length Max length of the string 222 * @return string String with Unicode encoded for URI. 223 223 */ 224 224 function utf8_uri_encode( $utf8_string, $length = 0 ) { 225 225 $unicode = ''; … … 263 263 } 264 264 265 265 /** 266 * Replaces accents in a string.266 * Converts all accent characters to ASCII characters. 267 267 * 268 * If there are no accent characters, then the string given is just returned. 269 * 268 270 * @since 1.2.1 269 271 * 270 * @param string $string T he text to be filtered.272 * @param string $string Text that might have accent characters 271 273 * @return string Filtered string with replaced "nice" characters. 272 274 */ 273 275 function remove_accents($string) { … … 403 405 /** 404 406 * Filters certain characters from the file name. 405 407 * 406 * {@internal Missing Long Description}} 408 * Turns all strings to lowercase removing most characters except alphanumeric 409 * with spaces, dashes and periods. All spaces and underscores are converted to 410 * dashes. Multiple dashes are converted to a single dash. Finally, if the file 411 * name ends with a dash, it is removed. 407 412 * 408 413 * @since 2.1.0 409 414 * 410 * @param string $name The string to be sanitized.411 * @return string Sanitized string.415 * @param string $name The file name 416 * @return string Sanitized file name 412 417 */ 413 418 function sanitize_file_name( $name ) { // Like sanitize_title, but with periods 414 419 $name = strtolower( $name ); … … 426 431 * 427 432 * If $strict is true, only alphanumeric characters (as well as _, space, ., -, 428 433 * @) are returned. 434 * Removes tags, octets, entities, and if strict is enabled, will remove all 435 * non-ASCII characters. After sanitizing, it passes the username, raw username 436 * (the username in the parameter), and the strict parameter as parameters for 437 * the filter. 429 438 * 430 439 * @since 2.0.0 440 * @uses apply_filters() Calls 'sanitize_user' hook on username, raw username, 441 * and $strict parameter. 431 442 * 432 443 * @param string $username The username to be sanitized. 433 444 * @param bool $strict If set limits $username to specific characters. Default false. … … 795 806 * back '0010'. If you set the number to '4' and the number is '5000', then you 796 807 * will get back '5000'. 797 808 * 809 * Uses sprintf to append the amount of zeros based on the $threshold parameter 810 * and the size of the number. If the number is large enough, then no zeros will 811 * be appended. 812 * 798 813 * @since 0.71 799 814 * 800 * @param mixed $number Will convert to string and add zeros801 * @param int $threshold Amount of digits802 * @return string Adds leading zeros to number if needed 815 * @param mixed $number Number to append zeros to if not greater than threshold. 816 * @param int $threshold Digit places number needs to be to not have zeros added. 817 * @return string Adds leading zeros to number if needed. 803 818 */ 804 819 function zeroise($number, $threshold) { 805 820 return sprintf('%0'.$threshold.'s', $number); … … 907 922 } 908 923 909 924 /** 910 * antispambot() - {@internal Missing Short Description}}925 * Converts email addresses characters to HTML entities to block spam bots. 911 926 * 912 * {@internal Missing Long Description}}913 *914 927 * @since 0.71 915 928 * 916 * @param unknown_type $emailaddy917 * @param unknown_type $mailto918 * @return unknown929 * @param string $emailaddy Email address. 930 * @param int $mailto Optional. Range from 0 to 1. Used for encoding. 931 * @return string Converted email address. 919 932 */ 920 933 function antispambot($emailaddy, $mailto=0) { 921 934 $emailNOSPAMaddy = ''; … … 1028 1041 } 1029 1042 1030 1043 /** 1031 * wp_rel_nofollow() - {@internal Missing Short Description}}1044 * Adds rel nofollow string to all HTML A elements in content. 1032 1045 * 1033 * {@internal Missing Long Description}}1034 *1035 1046 * @since 1.5.0 1036 1047 * 1037 * @param unknown_type $text1038 * @return unknown1048 * @param string $text Content that may contain HTML A elements. 1049 * @return string Converted content. 1039 1050 */ 1040 1051 function wp_rel_nofollow( $text ) { 1041 1052 global $wpdb; … … 1047 1058 } 1048 1059 1049 1060 /** 1050 * wp_rel_nofollow_callback() - {@internal Missing Short Description}}1061 * Callback to used to add rel=nofollow string to HTML A element. 1051 1062 * 1052 * {@internal Missing Long Description}} 1063 * Will remove already existing rel="nofollow" and rel='nofollow' from the 1064 * string to prevent from invalidating (X)HTML. 1053 1065 * 1054 1066 * @since 2.3.0 1055 1067 * 1056 * @param unknown_type $matches1057 * @return unknown1068 * @param array $matches Single Match 1069 * @return string HTML A Element with rel nofollow. 1058 1070 */ 1059 1071 function wp_rel_nofollow_callback( $matches ) { 1060 1072 $text = $matches[1]; … … 1063 1075 } 1064 1076 1065 1077 /** 1066 * convert_smilies() - {@internal Missing Short Description}}1078 * Convert text equivalent of smilies to images. 1067 1079 * 1068 * {@internal Missing Long Description}} 1080 * Will only convert smilies if the option 'use_smilies' is true and the globals 1081 * used in the function aren't empty. 1069 1082 * 1070 1083 * @since 0.71 1084 * @uses $wp_smiliessearch, $wp_smiliesreplace Smiley replacement arrays. 1071 1085 * 1072 * @param string $text 1073 * @return string 1086 * @param string $text Content to convert smilies from text. 1087 * @return string Converted content with text smilies replaced with images. 1074 1088 */ 1075 1089 function convert_smilies($text) { 1076 1090 global $wp_smiliessearch, $wp_smiliesreplace; … … 1115 1129 } 1116 1130 1117 1131 /** 1118 * {@internal Missing Short Description}}1132 * Convert to ASCII from email subjects. 1119 1133 * 1120 * {@internal Missing Long Description}}1121 *1122 1134 * @since 1.2.0 1123 1135 * @usedby wp_mail() handles charsets in email subjects 1124 1136 * 1125 * @param string $string 1126 * @return string 1137 * @param string $string Subject line 1138 * @return string Converted string to ASCII 1127 1139 */ 1128 1140 function wp_iso_descrambler($string) { 1129 1141 /* this may only work with iso-8859-1, I'm afraid */