| 1 |
<?php |
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 20 |
|
|---|
| 21 |
|
|---|
| 22 |
|
|---|
| 23 |
|
|---|
| 24 |
|
|---|
| 25 |
|
|---|
| 26 |
|
|---|
| 27 |
|
|---|
| 28 |
|
|---|
| 29 |
function wptexturize($text) { |
|---|
| 30 |
global $wp_cockneyreplace; |
|---|
| 31 |
$output = ''; |
|---|
| 32 |
$curl = ''; |
|---|
| 33 |
$textarr = preg_split('/(<.*>|\[.*\])/Us', $text, -1, PREG_SPLIT_DELIM_CAPTURE); |
|---|
| 34 |
$stop = count($textarr); |
|---|
| 35 |
|
|---|
| 36 |
|
|---|
| 37 |
$opening_quote = _x('“', 'opening curly quote'); |
|---|
| 38 |
|
|---|
| 39 |
$closing_quote = _x('”', 'closing curly quote'); |
|---|
| 40 |
|
|---|
| 41 |
$no_texturize_tags = apply_filters('no_texturize_tags', array('pre', 'code', 'kbd', 'style', 'script', 'tt')); |
|---|
| 42 |
$no_texturize_shortcodes = apply_filters('no_texturize_shortcodes', array('code')); |
|---|
| 43 |
$no_texturize_tags_stack = array(); |
|---|
| 44 |
$no_texturize_shortcodes_stack = array(); |
|---|
| 45 |
|
|---|
| 46 |
|
|---|
| 47 |
if ( isset($wp_cockneyreplace) ) { |
|---|
| 48 |
$cockney = array_keys($wp_cockneyreplace); |
|---|
| 49 |
$cockneyreplace = array_values($wp_cockneyreplace); |
|---|
| 50 |
} else { |
|---|
| 51 |
$cockney = array("'tain't","'twere","'twas","'tis","'twill","'til","'bout","'nuff","'round","'cause"); |
|---|
| 52 |
$cockneyreplace = array("’tain’t","’twere","’twas","’tis","’twill","’til","’bout","’nuff","’round","’cause"); |
|---|
| 53 |
} |
|---|
| 54 |
|
|---|
| 55 |
$static_characters = array_merge(array('---', ' -- ', '--', ' - ', 'xn–', '...', '``', '\'s', '\'\'', ' (tm)'), $cockney); |
|---|
| 56 |
$static_replacements = array_merge(array('—', ' — ', '–', ' – ', 'xn--', '…', $opening_quote, '’s', $closing_quote, ' ™'), $cockneyreplace); |
|---|
| 57 |
|
|---|
| 58 |
$dynamic_characters = array('/\'(\d\d(?:’|\')?s)/', '/(\s|\A|")\'/', '/(\d+)"/', '/(\d+)\'/', '/(\S)\'([^\'\s])/', '/(\s|\A)"(?!\s)/', '/"(\s|\S|\Z)/', '/\'([\s.]|\Z)/', '/(\d+)x(\d+)/'); |
|---|
| 59 |
$dynamic_replacements = array('’$1','$1‘', '$1″', '$1′', '$1’$2', '$1' . $opening_quote . '$2', $closing_quote . '$1', '’$1', '$1×$2'); |
|---|
| 60 |
|
|---|
| 61 |
for ( $i = 0; $i < $stop; $i++ ) { |
|---|
| 62 |
$curl = $textarr[$i]; |
|---|
| 63 |
|
|---|
| 64 |
if ( !empty($curl) && '<' != $curl{0} && '[' != $curl{0} |
|---|
| 65 |
&& empty($no_texturize_shortcodes_stack) && empty($no_texturize_tags_stack)) { |
|---|
| 66 |
// static strings |
|---|
| 67 |
$curl = str_replace($static_characters, $static_replacements, $curl); |
|---|
| 68 |
|
|---|
| 69 |
$curl = preg_replace($dynamic_characters, $dynamic_replacements, $curl); |
|---|
| 70 |
} else { |
|---|
| 71 |
wptexturize_pushpop_element($curl, $no_texturize_tags_stack, $no_texturize_tags, '<', '>'); |
|---|
| 72 |
wptexturize_pushpop_element($curl, $no_texturize_shortcodes_stack, $no_texturize_shortcodes, '[', ']'); |
|---|
| 73 |
} |
|---|
| 74 |
|
|---|
| 75 |
$curl = preg_replace('/&([^#])(?![a-zA-Z1-4]{1,8};)/', '&$1', $curl); |
|---|
| 76 |
$output .= $curl; |
|---|
| 77 |
} |
|---|
| 78 |
|
|---|
| 79 |
return $output; |
|---|
| 80 |
} |
|---|
| 81 |
|
|---|
| 82 |
function wptexturize_pushpop_element($text, &$stack, $disabled_elements, $opening = '<', $closing = '>') { |
|---|
| 83 |
$o = preg_quote($opening, '/'); |
|---|
| 84 |
$c = preg_quote($closing, '/'); |
|---|
| 85 |
foreach($disabled_elements as $element) { |
|---|
| 86 |
if (preg_match('/^'.$o.$element.'\b/', $text)) array_push($stack, $element); |
|---|
| 87 |
if (preg_match('/^'.$o.'\/'.$element.$c.'/', $text)) { |
|---|
| 88 |
$last = array_pop($stack); |
|---|
| 89 |
|
|---|
| 90 |
// even if there was invalid nesting before that |
|---|
| 91 |
// Example: in the case <pre>sadsadasd</code>"baba"</pre> "baba" won't be texturized |
|---|
| 92 |
if ($last != $element) array_push($stack, $last); |
|---|
| 93 |
} |
|---|
| 94 |
} |
|---|
| 95 |
} |
|---|
| 96 |
|
|---|
| 97 |
|
|---|
| 98 |
|
|---|
| 99 |
|
|---|
| 100 |
|
|---|
| 101 |
|
|---|
| 102 |
|
|---|
| 103 |
|
|---|
| 104 |
|
|---|
| 105 |
|
|---|
| 106 |
|
|---|
| 107 |
|
|---|
| 108 |
function clean_pre($matches) { |
|---|
| 109 |
if ( is_array($matches) ) |
|---|
| 110 |
$text = $matches[1] . $matches[2] . "</pre>"; |
|---|
| 111 |
else |
|---|
| 112 |
$text = $matches; |
|---|
| 113 |
|
|---|
| 114 |
$text = str_replace('<br />', '', $text); |
|---|
| 115 |
$text = str_replace('<p>', "\n", $text); |
|---|
| 116 |
$text = str_replace('</p>', '', $text); |
|---|
| 117 |
|
|---|
| 118 |
return $text; |
|---|
| 119 |
} |
|---|
| 120 |
|
|---|
| 121 |
|
|---|
| 122 |
|
|---|
| 123 |
|
|---|
| 124 |
|
|---|
| 125 |
|
|---|
| 126 |
|
|---|
| 127 |
|
|---|
| 128 |
|
|---|
| 129 |
|
|---|
| 130 |
|
|---|
| 131 |
|
|---|
| 132 |
|
|---|
| 133 |
|
|---|
| 134 |
|
|---|
| 135 |
function wpautop($pee, $br = 1) { |
|---|
| 136 |
if ( trim($pee) === '' ) |
|---|
| 137 |
return ''; |
|---|
| 138 |
$pee = $pee . "\n"; |
|---|
| 139 |
$pee = preg_replace('|<br />\s*<br />|', "\n\n", $pee); |
|---|
| 140 |
|
|---|
| 141 |
$allblocks = '(?:table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|map|area|blockquote|address|math|style|input|p|h[1-6]|hr)'; |
|---|
| 142 |
$pee = preg_replace('!(<' . $allblocks . '[^>]*>)!', "\n$1", $pee); |
|---|
| 143 |
$pee = preg_replace('!(</' . $allblocks . '>)!', "$1\n\n", $pee); |
|---|
| 144 |
$pee = str_replace(array("\r\n", "\r"), "\n", $pee); |
|---|
| 145 |
if ( strpos($pee, '<object') !== false ) { |
|---|
| 146 |
$pee = preg_replace('|\s*<param([^>]*)>\s*|', "<param$1>", $pee); |
|---|
| 147 |
$pee = preg_replace('|\s*</embed>\s*|', '</embed>', $pee); |
|---|
| 148 |
} |
|---|
| 149 |
$pee = preg_replace("/\n\n+/", "\n\n", $pee); |
|---|
| 150 |
// make paragraphs, including one at the end |
|---|
| 151 |
$pees = preg_split('/\n\s*\n/', $pee, -1, PREG_SPLIT_NO_EMPTY); |
|---|
| 152 |
$pee = ''; |
|---|
| 153 |
foreach ( $pees as $tinkle ) |
|---|
| 154 |
$pee .= '<p>' . trim($tinkle, "\n") . "</p>\n"; |
|---|
| 155 |
$pee = preg_replace('|<p>\s*</p>|', '', $pee); |
|---|
| 156 |
$pee = preg_replace('!<p>([^<]+)</(div|address|form)>!', "<p>$1</p></$2>", $pee); |
|---|
| 157 |
$pee = preg_replace('!<p>\s*(</?' . $allblocks . '[^>]*>)\s*</p>!', "$1", $pee); |
|---|
| 158 |
$pee = preg_replace("|<p>(<li.+?)</p>|", "$1", $pee); |
|---|
| 159 |
$pee = preg_replace('|<p><blockquote([^>]*)>|i', "<blockquote$1><p>", $pee); |
|---|
| 160 |
$pee = str_replace('</blockquote></p>', '</p></blockquote>', $pee); |
|---|
| 161 |
$pee = preg_replace('!<p>\s*(</?' . $allblocks . '[^>]*>)!', "$1", $pee); |
|---|
| 162 |
$pee = preg_replace('!(</?' . $allblocks . '[^>]*>)\s*</p>!', "$1", $pee); |
|---|
| 163 |
if ($br) { |
|---|
| 164 |
$pee = preg_replace_callback('/<(script|style).*?<\/\\1>/s', create_function('$matches', 'return str_replace("\n", "<WPPreserveNewline />", $matches[0]);'), $pee); |
|---|
| 165 |
$pee = preg_replace('|(?<!<br />)\s*\n|', "<br />\n", $pee); |
|---|
| 166 |
$pee = str_replace('<WPPreserveNewline />', "\n", $pee); |
|---|
| 167 |
} |
|---|
| 168 |
$pee = preg_replace('!(</?' . $allblocks . '[^>]*>)\s*<br />!', "$1", $pee); |
|---|
| 169 |
$pee = preg_replace('!<br />(\s*</?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)[^>]*>)!', '$1', $pee); |
|---|
| 170 |
if (strpos($pee, '<pre') !== false) |
|---|
| 171 |
$pee = preg_replace_callback('!(<pre[^>]*>)(.*?)</pre>!is', 'clean_pre', $pee ); |
|---|
| 172 |
$pee = preg_replace( "|\n</p>$|", '</p>', $pee ); |
|---|
| 173 |
$pee = preg_replace('/<p>\s*?(' . get_shortcode_regex() . ')\s*<\/p>/s', '$1', $pee); |
|---|
| 174 |
|
|---|
| 175 |
return $pee; |
|---|
| 176 |
} |
|---|
| 177 |
|
|---|
| 178 |
|
|---|
| 179 |
|
|---|
| 180 |
|
|---|
| 181 |
|
|---|
| 182 |
|
|---|
| 183 |
|
|---|
| 184 |
|
|---|
| 185 |
|
|---|
| 186 |
|
|---|
| 187 |
|
|---|
| 188 |
|
|---|
| 189 |
|
|---|
| 190 |
function seems_utf8($str) { |
|---|
| 191 |
$length = strlen($str); |
|---|
| 192 |
for ($i=0; $i < $length; $i++) { |
|---|
| 193 |
$c = ord($str[$i]); |
|---|
| 194 |
if ($c < 0x80) $n = 0; |
|---|
| 195 |
elseif (($c & 0xE0) == 0xC0) $n=1; |
|---|
| 196 |
elseif (($c & 0xF0) == 0xE0) $n=2; |
|---|
| 197 |
elseif (($c & 0xF8) == 0xF0) $n=3; |
|---|
| 198 |
elseif (($c & 0xFC) == 0xF8) $n=4; |
|---|
| 199 |
elseif (($c & 0xFE) == 0xFC) $n=5; |
|---|
| 200 |
else return false; |
|---|
| 201 |
for ($j=0; $j<$n; $j++) { |
|---|
| 202 |
if ((++$i == $length) || ((ord($str[$i]) & 0xC0) != 0x80)) |
|---|
| 203 |
return false; |
|---|
| 204 |
} |
|---|
| 205 |
} |
|---|
| 206 |
return true; |
|---|
| 207 |
} |
|---|
| 208 |
|
|---|
| 209 |
|
|---|
| 210 |
|
|---|
| 211 |
|
|---|
| 212 |
|
|---|
| 213 |
|
|---|
| 214 |
|
|---|
| 215 |
|
|---|
| 216 |
|
|---|
| 217 |
|
|---|
| 218 |
|
|---|
| 219 |
|
|---|
| 220 |
|
|---|
| 221 |
|
|---|
| 222 |
|
|---|
| 223 |
|
|---|
| 224 |
|
|---|
| 225 |
function _wp_specialchars( $string, $quote_style = ENT_NOQUOTES, $charset = false, $double_encode = false ) { |
|---|
| 226 |
$string = (string) $string; |
|---|
| 227 |
|
|---|
| 228 |
if ( 0 === strlen( $string ) ) { |
|---|
| 229 |
return ''; |
|---|
| 230 |
} |
|---|
| 231 |
|
|---|
| 232 |
|
|---|
| 233 |
if ( !preg_match( '/[&<>"\']/', $string ) ) { |
|---|
| 234 |
return $string; |
|---|
| 235 |
} |
|---|
| 236 |
|
|---|
| 237 |
|
|---|
| 238 |
if ( empty( $quote_style ) ) { |
|---|
| 239 |
$quote_style = ENT_NOQUOTES; |
|---|
| 240 |
} elseif ( !in_array( $quote_style, array( 0, 2, 3, 'single', 'double' ), true ) ) { |
|---|
| 241 |
$quote_style = ENT_QUOTES; |
|---|
| 242 |
} |
|---|
| 243 |
|
|---|
| 244 |
|
|---|
| 245 |
if ( !$charset ) { |
|---|
| 246 |
static $_charset; |
|---|
| 247 |
if ( !isset( $_charset ) ) { |
|---|
| 248 |
$alloptions = wp_load_alloptions(); |
|---|
| 249 |
$_charset = isset( $alloptions['blog_charset'] ) ? $alloptions['blog_charset'] : ''; |
|---|
| 250 |
} |
|---|
| 251 |
$charset = $_charset; |
|---|
| 252 |
} |
|---|
| 253 |
if ( in_array( $charset, array( 'utf8', 'utf-8', 'UTF8' ) ) ) { |
|---|
| 254 |
$charset = 'UTF-8'; |
|---|
| 255 |
} |
|---|
| 256 |
|
|---|
| 257 |
$_quote_style = $quote_style; |
|---|
| 258 |
|
|---|
| 259 |
if ( $quote_style === 'double' ) { |
|---|
| 260 |
$quote_style = ENT_COMPAT; |
|---|
| 261 |
$_quote_style = ENT_COMPAT; |
|---|
| 262 |
} elseif ( $quote_style === 'single' ) { |
|---|
| 263 |
$quote_style = ENT_NOQUOTES; |
|---|
| 264 |
} |
|---|
| 265 |
|
|---|
| 266 |
|
|---|
| 267 |
if ( !$double_encode ) { |
|---|
| 268 |
$string = wp_specialchars_decode( $string, $_quote_style ); |
|---|
| 269 |
$string = preg_replace( '/&(#?x?[0-9a-z]+);/i', '|wp_entity|$1|/wp_entity|', $string ); |
|---|
| 270 |
} |
|---|
| 271 |
|
|---|
| 272 |
$string = @htmlspecialchars( $string, $quote_style, $charset ); |
|---|
| 273 |
|
|---|
| 274 |
|
|---|
| 275 |
if ( !$double_encode ) { |
|---|
| 276 |
$string = str_replace( array( '|wp_entity|', '|/wp_entity|' ), array( '&', ';' ), $string ); |
|---|
| 277 |
} |
|---|
| 278 |
|
|---|
| 279 |
|
|---|
| 280 |
if ( 'single' === $_quote_style ) { |
|---|
| 281 |
$string = str_replace( "'", ''', $string ); |
|---|
| 282 |
} |
|---|
| 283 |
|
|---|
| 284 |
return $string; |
|---|
| 285 |
} |
|---|
| 286 |
|
|---|
| 287 |
|
|---|
| 288 |
|
|---|
| 289 |
|
|---|
| 290 |
|
|---|
| 291 |
|
|---|
| 292 |
|
|---|
| 293 |
|
|---|
| 294 |
|
|---|
| 295 |
|
|---|
| 296 |
|
|---|
| 297 |
|
|---|
| 298 |
|
|---|
| 299 |
|
|---|
| 300 |
|
|---|
| 301 |
function wp_specialchars_decode( $string, $quote_style = ENT_NOQUOTES ) { |
|---|
| 302 |
$string = (string) $string; |
|---|
| 303 |
|
|---|
| 304 |
if ( 0 === strlen( $string ) ) { |
|---|
| 305 |
return ''; |
|---|
| 306 |
} |
|---|
| 307 |
|
|---|
| 308 |
|
|---|
| 309 |
if ( strpos( $string, '&' ) === false ) { |
|---|
| 310 |
return $string; |
|---|
| 311 |
} |
|---|
| 312 |
|
|---|
| 313 |
|
|---|
| 314 |
if ( empty( $quote_style ) ) { |
|---|
| 315 |
$quote_style = ENT_NOQUOTES; |
|---|
| 316 |
} elseif ( !in_array( $quote_style, array( 0, 2, 3, 'single', 'double' ), true ) ) { |
|---|
| 317 |
$quote_style = ENT_QUOTES; |
|---|
| 318 |
} |
|---|
| 319 |
|
|---|
| 320 |
|
|---|
| 321 |
$single = array( ''' => '\'', ''' => '\'' ); |
|---|
| 322 |
$single_preg = array( '/�*39;/' => ''', '/�*27;/i' => ''' ); |
|---|
| 323 |
$double = array( '"' => '"', '"' => '"', '"' => '"' ); |
|---|
| 324 |
$double_preg = array( '/�*34;/' => '"', '/�*22;/i' => '"' ); |
|---|
| 325 |
$others = array( '<' => '<', '<' => '<', '>' => '>', '>' => '>', '&' => '&', '&' => '&', '&' => '&' ); |
|---|
| 326 |
$others_preg = array( '/�*60;/' => '<', '/�*62;/' => '>', '/�*38;/' => '&', '/�*26;/i' => '&' ); |
|---|
| 327 |
|
|---|
| 328 |
if ( $quote_style === ENT_QUOTES ) { |
|---|
| 329 |
$translation = array_merge( $single, $double, $others ); |
|---|
| 330 |
$translation_preg = array_merge( $single_preg, $double_preg, $others_preg ); |
|---|
| 331 |
} elseif ( $quote_style === ENT_COMPAT || $quote_style === 'double' ) { |
|---|
| 332 |
$translation = array_merge( $double, $others ); |
|---|
| 333 |
$translation_preg = array_merge( $double_preg, $others_preg ); |
|---|
| 334 |
} elseif ( $quote_style === 'single' ) { |
|---|
| 335 |
$translation = array_merge( $single, $others ); |
|---|
| 336 |
$translation_preg = array_merge( $single_preg, $others_preg ); |
|---|
| 337 |
} elseif ( $quote_style === ENT_NOQUOTES ) { |
|---|
| 338 |
$translation = $others; |
|---|
| 339 |
$translation_preg = $others_preg; |
|---|
| 340 |
} |
|---|
| 341 |
|
|---|
| 342 |
|
|---|
| 343 |
$string = preg_replace( array_keys( $translation_preg ), array_values( $translation_preg ), $string ); |
|---|
| 344 |
|
|---|
| 345 |
|
|---|
| 346 |
return strtr( $string, $translation ); |
|---|
| 347 |
} |
|---|
| 348 |
|
|---|
| 349 |
|
|---|
| 350 |
|
|---|
| 351 |
|
|---|
| 352 |
|
|---|
| 353 |
|
|---|
| 354 |
|
|---|
| 355 |
|
|---|
| 356 |
|
|---|
| 357 |
|
|---|
| 358 |
function wp_check_invalid_utf8( $string, $strip = false ) { |
|---|
| 359 |
$string = (string) $string; |
|---|
| 360 |
|
|---|
| 361 |
if ( 0 === strlen( $string ) ) { |
|---|
| 362 |
return ''; |
|---|
| 363 |
} |
|---|
| 364 |
|
|---|
| 365 |
|
|---|
| 366 |
static $is_utf8; |
|---|
| 367 |
if ( !isset( $is_utf8 ) ) { |
|---|
| 368 |
$is_utf8 = in_array( get_option( 'blog_charset' ), array( 'utf8', 'utf-8', 'UTF8', 'UTF-8' ) ); |
|---|
| 369 |
} |
|---|
| 370 |
if ( !$is_utf8 ) { |
|---|
| 371 |
return $string; |
|---|
| 372 |
} |
|---|
| 373 |
|
|---|
| 374 |
|
|---|
| 375 |
static $utf8_pcre; |
|---|
| 376 |
if ( !isset( $utf8_pcre ) ) { |
|---|
| 377 |
$utf8_pcre = @preg_match( '/^./u', 'a' ); |
|---|
| 378 |
} |
|---|
| 379 |
|
|---|
| 380 |
if ( !$utf8_pcre ) { |
|---|
| 381 |
return $string; |
|---|
| 382 |
} |
|---|
| 383 |
|
|---|
| 384 |
|
|---|
| 385 |
if ( 1 === @preg_match( '/^./us', $string ) ) { |
|---|
| 386 |
return $string; |
|---|
| 387 |
} |
|---|
| 388 |
|
|---|
| 389 |
|
|---|
| 390 |
if ( $strip && function_exists( 'iconv' ) ) { |
|---|
| 391 |
return iconv( 'utf-8', 'utf-8', $string ); |
|---|
| 392 |
} |
|---|
| 393 |
|
|---|
| 394 |
return ''; |
|---|
| 395 |
} |
|---|
| 396 |
|
|---|
| 397 |
|
|---|
| 398 |
|
|---|
| 399 |
|
|---|
| 400 |
|
|---|
| 401 |
|
|---|
| 402 |
|
|---|
| 403 |
|
|---|
| 404 |
|
|---|
| 405 |
|
|---|
| 406 |
function utf8_uri_encode( $utf8_string, $length = 0 ) { |
|---|
| 407 |
$unicode = ''; |
|---|
| 408 |
$values = array(); |
|---|
| 409 |
$num_octets = 1; |
|---|
| 410 |
$unicode_length = 0; |
|---|
| 411 |
|
|---|
| 412 |
$string_length = strlen( $utf8_string ); |
|---|
| 413 |
for ($i = 0; $i < $string_length; $i++ ) { |
|---|
| 414 |
|
|---|
| 415 |
$value = ord( $utf8_string[ $i ] ); |
|---|
| 416 |
|
|---|
| 417 |
if ( $value < 128 ) { |
|---|
| 418 |
if ( $length && ( $unicode_length >= $length ) ) |
|---|
| 419 |
break; |
|---|
| 420 |
$unicode .= chr($value); |
|---|
| 421 |
$unicode_length++; |
|---|
| 422 |
} else { |
|---|
| 423 |
if ( count( $values ) == 0 ) $num_octets = ( $value < 224 ) ? 2 : 3; |
|---|
| 424 |
|
|---|
| 425 |
$values[] = $value; |
|---|
| 426 |
|
|---|
| 427 |
if ( $length && ( $unicode_length + ($num_octets * 3) ) > $length ) |
|---|
| 428 |
break; |
|---|
| 429 |
if ( count( $values ) == $num_octets ) { |
|---|
| 430 |
if ($num_octets == 3) { |
|---|
| 431 |
$unicode .= '%' . dechex($values[0]) . '%' . dechex($values[1]) . '%' . dechex($values[2]); |
|---|
| 432 |
$unicode_length += 9; |
|---|
| 433 |
} else { |
|---|
| 434 |
$unicode .= '%' . dechex($values[0]) . '%' . dechex($values[1]); |
|---|
| 435 |
$unicode_length += 6; |
|---|
| 436 |
} |
|---|
| 437 |
|
|---|
| 438 |
$values = array(); |
|---|
| 439 |
$num_octets = 1; |
|---|
| 440 |
} |
|---|
| 441 |
} |
|---|
| 442 |
} |
|---|
| 443 |
|
|---|
| 444 |
return $unicode; |
|---|
| 445 |
} |
|---|
| 446 |
|
|---|
| 447 |
|
|---|
| 448 |
|
|---|
| 449 |
|
|---|
| 450 |
|
|---|
| 451 |
|
|---|
| 452 |
|
|---|
| 453 |
|
|---|
| 454 |
|
|---|
| 455 |
|
|---|
| 456 |
|
|---|
| 457 |
function remove_accents($string) { |
|---|
| 458 |
if ( !preg_match('/[\x80-\xff]/', $string) ) |
|---|
| 459 |
return $string; |
|---|
| 460 |
|
|---|
| 461 |
if (seems_utf8($string)) { |
|---|
| 462 |
$chars = array( |
|---|
| 463 |
|
|---|
| 464 |
chr(195).chr(128) => 'A', chr(195).chr(129) => 'A', |
|---|
| 465 |
chr(195).chr(130) => 'A', chr(195).chr(131) => 'A', |
|---|
| 466 |
chr(195).chr(132) => 'A', chr(195).chr(133) => 'A', |
|---|
| 467 |
chr(195).chr(135) => 'C', chr(195).chr(136) => 'E', |
|---|
| 468 |
chr(195).chr(137) => 'E', chr(195).chr(138) => 'E', |
|---|
| 469 |
chr(195).chr(139) => 'E', chr(195).chr(140) => 'I', |
|---|
| 470 |
chr(195).chr(141) => 'I', chr(195).chr(142) => 'I', |
|---|
| 471 |
chr(195).chr(143) => 'I', chr(195).chr(145) => 'N', |
|---|
| 472 |
chr(195).chr(146) => 'O', chr(195).chr(147) => 'O', |
|---|
| 473 |
chr(195).chr(148) => 'O', chr(195).chr(149) => 'O', |
|---|
| 474 |
chr(195).chr(150) => 'O', chr(195).chr(153) => 'U', |
|---|
| 475 |
chr(195).chr(154) => 'U', chr(195).chr(155) => 'U', |
|---|
| 476 |
chr(195).chr(156) => 'U', chr(195).chr(157) => 'Y', |
|---|
| 477 |
chr(195).chr(159) => 's', chr(195).chr(160) => 'a', |
|---|
| 478 |
chr(195).chr(161) => 'a', chr(195).chr(162) => 'a', |
|---|
| 479 |
chr(195).chr(163) => 'a', chr(195).chr(164) => 'a', |
|---|
| 480 |
chr(195).chr(165) => 'a', chr(195).chr(167) => 'c', |
|---|
| 481 |
chr(195).chr(168) => 'e', chr(195).chr(169) => 'e', |
|---|
| 482 |
chr(195).chr(170) => 'e', chr(195).chr(171) => 'e', |
|---|
| 483 |
chr(195).chr(172) => 'i', chr(195).chr(173) => 'i', |
|---|
| 484 |
chr(195).chr(174) => 'i', chr(195).chr(175) => 'i', |
|---|
| 485 |
chr(195).chr(177) => 'n', chr(195).chr(178) => 'o', |
|---|
| 486 |
chr(195).chr(179) => 'o', chr(195).chr(180) => 'o', |
|---|
| 487 |
chr(195).chr(181) => 'o', chr(195).chr(182) => 'o', |
|---|
| 488 |
chr(195).chr(182) => 'o', chr(195).chr(185) => 'u', |
|---|
| 489 |
chr(195).chr(186) => 'u', chr(195).chr(187) => 'u', |
|---|
| 490 |
chr(195).chr(188) => 'u', chr(195).chr(189) => 'y', |
|---|
| 491 |
chr(195).chr(191) => 'y', |
|---|
| 492 |
|
|---|
| 493 |
chr(196).chr(128) => 'A', chr(196).chr(129) => 'a', |
|---|
| 494 |
chr(196).chr(130) => 'A', chr(196).chr(131) => 'a', |
|---|
| 495 |
chr(196).chr(132) => 'A', chr(196).chr(133) => 'a', |
|---|
| 496 |
chr(196).chr(134) => 'C', chr(196).chr(135) => 'c', |
|---|
| 497 |
chr(196).chr(136) => 'C', chr(196).chr(137) => 'c', |
|---|
| 498 |
chr(196).chr(138) => 'C', chr(196).chr(139) => 'c', |
|---|
| 499 |
chr(196).chr(140) => 'C', chr(196).chr(141) => 'c', |
|---|
| 500 |
chr(196).chr(142) => 'D', chr(196).chr(143) => 'd', |
|---|
| 501 |
chr(196).chr(144) => 'D', chr(196).chr(145) => 'd', |
|---|
| 502 |
chr(196).chr(146) => 'E', chr(196).chr(147) => 'e', |
|---|
| 503 |
chr(196).chr(148) => 'E', chr(196).chr(149) => 'e', |
|---|
| 504 |
chr(196).chr(150) => 'E', chr(196).chr(151) => 'e', |
|---|
| 505 |
chr(196).chr(152) => 'E', chr(196).chr(153) => 'e', |
|---|
| 506 |
chr(196).chr(154) => 'E', chr(196).chr(155) => 'e', |
|---|
| 507 |
chr(196).chr(156) => 'G', chr(196).chr(157) => 'g', |
|---|
| 508 |
chr(196).chr(158) => 'G', chr(196).chr(159) => 'g', |
|---|
| 509 |
chr(196).chr(160) => 'G', chr(196).chr(161) => 'g', |
|---|
| 510 |
chr(196).chr(162) => 'G', chr(196).chr(163) => 'g', |
|---|
| 511 |
chr(196).chr(164) => 'H', chr(196).chr(165) => 'h', |
|---|
| 512 |
chr(196).chr(166) => 'H', chr(196).chr(167) => 'h', |
|---|
| 513 |
chr(196).chr(168) => 'I', chr(196).chr(169) => 'i', |
|---|
| 514 |
chr(196).chr(170) => 'I', chr(196).chr(171) => 'i', |
|---|
| 515 |
chr(196).chr(172) => 'I', chr(196).chr(173) => 'i', |
|---|
| 516 |
chr(196).chr(174) => 'I', chr(196).chr(175) => 'i', |
|---|
| 517 |
chr(196).chr(176) => 'I', chr(196).chr(177) => 'i', |
|---|
| 518 |
chr(196).chr(178) => 'IJ',chr(196).chr(179) => 'ij', |
|---|
| 519 |
chr(196).chr(180) => 'J', chr(196).chr(181) => 'j', |
|---|
| 520 |
chr(196).chr(182) => 'K', chr(196).chr(183) => 'k', |
|---|
| 521 |
chr(196).chr(184) => 'k', chr(196).chr(185) => 'L', |
|---|
| 522 |
chr(196).chr(186) => 'l', chr(196).chr(187) => 'L', |
|---|
| 523 |
chr(196).chr(188) => 'l', chr(196).chr(189) => 'L', |
|---|
| 524 |
chr(196).chr(190) => 'l', chr(196).chr(191) => 'L', |
|---|
| 525 |
chr(197).chr(128) => 'l', chr(197).chr(129) => 'L', |
|---|
| 526 |
chr(197).chr(130) => 'l', chr(197).chr(131) => 'N', |
|---|
| 527 |
chr(197).chr(132) => 'n', chr(197).chr(133) => 'N', |
|---|
| 528 |
chr(197).chr(134) => 'n', chr(197).chr(135) => 'N', |
|---|
| 529 |
chr(197).chr(136) => 'n', chr(197).chr(137) => 'N', |
|---|
| 530 |
chr(197).chr(138) => 'n', chr(197).chr(139) => 'N', |
|---|
| 531 |
chr(197).chr(140) => 'O', chr(197).chr(141) => 'o', |
|---|
| 532 |
chr(197).chr(142) => 'O', chr(197).chr(143) => 'o', |
|---|
| 533 |
chr(197).chr(144) => 'O', chr(197).chr(145) => 'o', |
|---|
| 534 |
chr(197).chr(146) => 'OE',chr(197).chr(147) => 'oe', |
|---|
| 535 |
chr(197).chr(148) => 'R',chr(197).chr(149) => 'r', |
|---|
| 536 |
chr(197).chr(150) => 'R',chr(197).chr(151) => 'r', |
|---|
| 537 |
chr(197).chr(152) => 'R',chr(197).chr(153) => 'r', |
|---|
| 538 |
chr(197).chr(154) => 'S',chr(197).chr(155) => 's', |
|---|
| 539 |
chr(197).chr(156) => 'S',chr(197).chr(157) => 's', |
|---|
| 540 |
chr(197).chr(158) => 'S',chr(197).chr(159) => 's', |
|---|
| 541 |
chr(197).chr(160) => 'S', chr(197).chr(161) => 's', |
|---|
| 542 |
chr(197).chr(162) => 'T', chr(197).chr(163) => 't', |
|---|
| 543 |
chr(197).chr(164) => 'T', chr(197).chr(165) => 't', |
|---|
| 544 |
chr(197).chr(166) => 'T', chr(197).chr(167) => 't', |
|---|
| 545 |
chr(197).chr(168) => 'U', chr(197).chr(169) => 'u', |
|---|
| 546 |
chr(197).chr(170) => 'U', chr(197).chr(171) => 'u', |
|---|
| 547 |
chr(197).chr(172) => 'U', chr(197).chr(173) => 'u', |
|---|
| 548 |
chr(197).chr(174) => 'U', chr(197).chr(175) => 'u', |
|---|
| 549 |
chr(197).chr(176) => 'U', chr(197).chr(177) => 'u', |
|---|
| 550 |
chr(197).chr(178) => 'U', chr(197).chr(179) => 'u', |
|---|
| 551 |
chr(197).chr(180) => 'W', chr(197).chr(181) => 'w', |
|---|
| 552 |
chr(197).chr(182) => 'Y', chr(197).chr(183) => 'y', |
|---|
| 553 |
chr(197).chr(184) => 'Y', chr(197).chr(185) => 'Z', |
|---|
| 554 |
chr(197).chr(186) => 'z', chr(197).chr(187) => 'Z', |
|---|
| 555 |
chr(197).chr(188) => 'z', chr(197).chr(189) => 'Z', |
|---|
| 556 |
chr(197).chr(190) => 'z', chr(197).chr(191) => 's', |
|---|
| 557 |
|
|---|
| 558 |
chr(226).chr(130).chr(172) => 'E', |
|---|
| 559 |
|
|---|
| 560 |
chr(194).chr(163) => ''); |
|---|
| 561 |
|
|---|
| 562 |
$string = strtr($string, $chars); |
|---|
| 563 |
} else { |
|---|
| 564 |
|
|---|
| 565 |
$chars['in'] = chr(128).chr(131).chr(138).chr(142).chr(154).chr(158) |
|---|
| 566 |
.chr(159).chr(162).chr(165).chr(181).chr(192).chr(193).chr(194) |
|---|
| 567 |
.chr(195).chr(196).chr(197).chr(199).chr(200).chr(201).chr(202) |
|---|
| 568 |
.chr(203).chr(204).chr(205).chr(206).chr(207).chr(209).chr(210) |
|---|
| 569 |
.chr(211).chr(212).chr(213).chr(214).chr(216).chr(217).chr(218) |
|---|
| 570 |
.chr(219).chr(220).chr(221).chr(224).chr(225).chr(226).chr(227) |
|---|
| 571 |
.chr(228).chr(229).chr(231).chr(232).chr(233).chr(234).chr(235) |
|---|
| 572 |
.chr(236).chr(237).chr(238).chr(239).chr(241).chr(242).chr(243) |
|---|
| 573 |
.chr(244).chr(245).chr(246).chr(248).chr(249).chr(250).chr(251) |
|---|
| 574 |
.chr(252).chr(253).chr(255); |
|---|
| 575 |
|
|---|
| 576 |
$chars['out'] = "EfSZszYcYuAAAAAACEEEEIIIINOOOOOOUUUUYaaaaaaceeeeiiiinoooooouuuuyy"; |
|---|
| 577 |
|
|---|
| 578 |
$string = strtr($string, $chars['in'], $chars['out']); |
|---|
| 579 |
$double_chars['in'] = array(chr(140), chr(156), chr(198), chr(208), chr(222), chr(223), chr(230), chr(240), chr(254)); |
|---|
| 580 |
$double_chars['out'] = array('OE', 'oe', 'AE', 'DH', 'TH', 'ss', 'ae', 'dh', 'th'); |
|---|
| 581 |
$string = str_replace($double_chars['in'], $double_chars['out'], $string); |
|---|
| 582 |
} |
|---|
| 583 |
|
|---|
| 584 |
return $string; |
|---|
| 585 |
} |
|---|
| 586 |
|
|---|
| 587 |
|
|---|
| 588 |
|
|---|
| 589 |
|
|---|
| 590 |
|
|---|
| 591 |
|
|---|
| 592 |
|
|---|
| 593 |
|
|---|
| 594 |
|
|---|
| 595 |
|
|---|
| 596 |
|
|---|
| 597 |
|
|---|
| 598 |
|
|---|
| 599 |
|
|---|
| 600 |
|
|---|
| 601 |
function sanitize_file_name( $filename ) { |
|---|
| 602 |
$filename_raw = $filename; |
|---|
| 603 |
$special_chars = array("?", "[", "]", "/", "\\", "=", "<", ">", ":", ";", ",", "'", "\"", "&", "$", "#", "*", "(", ")", "|", "~", "`", "!", "{", "}"); |
|---|
| 604 |
$special_chars = apply_filters('sanitize_file_name_chars', $special_chars, $filename_raw); |
|---|
| 605 |
$filename = str_replace($special_chars, '', $filename); |
|---|
| 606 |
$filename = preg_replace('/[\s-]+/', '-', $filename); |
|---|
| 607 |
$filename = trim($filename, '.-_'); |
|---|
| 608 |
return apply_filters('sanitize_file_name', $filename, $filename_raw); |
|---|
| 609 |
} |
|---|
| 610 |
|
|---|
| 611 |
|
|---|
| 612 |
|
|---|
| 613 |
|
|---|
| 614 |
|
|---|
| 615 |
|
|---|
| 616 |
|
|---|
| 617 |
|
|---|
| 618 |
|
|---|
| 619 |
|
|---|
| 620 |
|
|---|
| 621 |
|
|---|
| 622 |
|
|---|
| 623 |
|
|---|
| 624 |
|
|---|
| 625 |
|
|---|
| 626 |
|
|---|
| 627 |
|
|---|
| 628 |
|
|---|
| 629 |
function sanitize_user( $username, $strict = false ) { |
|---|
| 630 |
$raw_username = $username; |
|---|
| 631 |
$username = strip_tags($username); |
|---|
| 632 |
|
|---|
| 633 |
$username = preg_replace('|%([a-fA-F0-9][a-fA-F0-9])|', '', $username); |
|---|
| 634 |
$username = preg_replace('/&.+?;/', '', $username); |
|---|
| 635 |
|
|---|
| 636 |
// If strict, reduce to ASCII for max portability. |
|---|
| 637 |
if ( $strict ) |
|---|
| 638 |
$username = preg_replace('|[^a-z0-9 _.\-@]|i', '', $username); |
|---|
| 639 |
|
|---|
| 640 |
|
|---|
| 641 |
$username = preg_replace('|\s+|', ' ', $username); |
|---|
| 642 |
|
|---|
| 643 |
return apply_filters('sanitize_user', $username, $raw_username, $strict); |
|---|
| 644 |
} |
|---|
| 645 |
|
|---|
| 646 |
|
|---|
| 647 |
|
|---|
| 648 |
|
|---|
| 649 |
|
|---|
| 650 |
|
|---|
| 651 |
|
|---|
| 652 |
|
|---|
| 653 |
|
|---|
| 654 |
|
|---|
| 655 |
|
|---|
| 656 |
|
|---|
| 657 |
|
|---|
| 658 |
|
|---|
| 659 |
function sanitize_title($title, $fallback_title = '') { |
|---|
| 660 |
$raw_title = $title; |
|---|
| 661 |
$title = strip_tags($title); |
|---|
| 662 |
$title = apply_filters('sanitize_title', $title, $raw_title); |
|---|
| 663 |
|
|---|
| 664 |
if ( '' === $title || false === $title ) |
|---|
| 665 |
$title = $fallback_title; |
|---|
| 666 |
|
|---|
| 667 |
return $title; |
|---|
| 668 |
} |
|---|
| 669 |
|
|---|
| 670 |
|
|---|
| 671 |
|
|---|
| 672 |
|
|---|
| 673 |
|
|---|
| 674 |
|
|---|
| 675 |
|
|---|
| 676 |
|
|---|
| 677 |
|
|---|
| 678 |
|
|---|
| 679 |
|
|---|
| 680 |
|
|---|
| 681 |
function sanitize_title_with_dashes($title) { |
|---|
| 682 |
$title = strip_tags($title); |
|---|
| 683 |
|
|---|
| 684 |
$title = preg_replace('|%([a-fA-F0-9][a-fA-F0-9])|', '---$1---', $title); |
|---|
| 685 |
|
|---|
| 686 |
$title = str_replace('%', '', $title); |
|---|
| 687 |
|
|---|
| 688 |
$title = preg_replace('|---([a-fA-F0-9][a-fA-F0-9])---|', '%$1', $title); |
|---|
| 689 |
|
|---|
| 690 |
$title = remove_accents($title); |
|---|
| 691 |
if (seems_utf8($title)) { |
|---|
| 692 |
if (function_exists('mb_strtolower')) { |
|---|
| 693 |
$title = mb_strtolower($title, 'UTF-8'); |
|---|
| 694 |
} |
|---|
| 695 |
$title = utf8_uri_encode($title, 200); |
|---|
| 696 |
} |
|---|
| 697 |
|
|---|
| 698 |
$title = strtolower($title); |
|---|
| 699 |
$title = preg_replace('/&.+?;/', '', $title); |
|---|
| 700 |
$title = str_replace('.', '-', $title); |
|---|
| 701 |
$title = preg_replace('/[^%a-z0-9 _-]/', '', $title); |
|---|
| 702 |
$title = preg_replace('/\s+/', '-', $title); |
|---|
| 703 |
$title = preg_replace('|-+|', '-', $title); |
|---|
| 704 |
$title = trim($title, '-'); |
|---|
| 705 |
|
|---|
| 706 |
return $title; |
|---|
| 707 |
} |
|---|
| 708 |
|
|---|
| 709 |
|
|---|
| 710 |
|
|---|
| 711 |
|
|---|
| 712 |
|
|---|
| 713 |
|
|---|
| 714 |
|
|---|
| 715 |
|
|---|
| 716 |
|
|---|
| 717 |
|
|---|
| 718 |
|
|---|
| 719 |
|
|---|
| 720 |
function sanitize_sql_orderby( $orderby ){ |
|---|
| 721 |
preg_match('/^\s*([a-z0-9_]+(\s+(ASC|DESC))?(\s*,\s*|\s*$))+|^\s*RAND\(\s*\)\s*$/i', $orderby, $obmatches); |
|---|
| 722 |
if ( !$obmatches ) |
|---|
| 723 |
return false; |
|---|
| 724 |
return $orderby; |
|---|
| 725 |
} |
|---|
| 726 |
|
|---|
| 727 |
|
|---|
| 728 |
|
|---|
| 729 |
|
|---|
| 730 |
|
|---|
| 731 |
|
|---|
| 732 |
|
|---|
| 733 |
|
|---|
| 734 |
|
|---|
| 735 |
|
|---|
| 736 |
|
|---|
| 737 |
|
|---|
| 738 |
|
|---|
| 739 |
|
|---|
| 740 |
|
|---|
| 741 |
function sanitize_html_class($class, $fallback){ |
|---|
| 742 |
|
|---|
| 743 |
$sanitized = preg_replace('|%[a-fA-F0-9][a-fA-F0-9]|', '', $class); |
|---|
| 744 |
|
|---|
| 745 |
|
|---|
| 746 |
$sanitized = preg_replace('/[^A-Za-z0-9-]/', '', $sanitized); |
|---|
| 747 |
|
|---|
| 748 |
if ('' == $sanitized) |
|---|
| 749 |
$sanitized = $fallback; |
|---|
| 750 |
|
|---|
| 751 |
return apply_filters('sanitize_html_class',$sanitized, $class, $fallback); |
|---|
| 752 |
} |
|---|
| 753 |
|
|---|
| 754 |
|
|---|
| 755 |
|
|---|
| 756 |
|
|---|
| 757 |
|
|---|
| 758 |
|
|---|
| 759 |
|
|---|
| 760 |
|
|---|
| 761 |
|
|---|
| 762 |
|
|---|
| 763 |
|
|---|
| 764 |
|
|---|
| 765 |
|
|---|
| 766 |
|
|---|
| 767 |
function convert_chars($content, $deprecated = '') { |
|---|
| 768 |
|
|---|
| 769 |
$wp_htmltranswinuni = array( |
|---|
| 770 |
'€' => '€', |
|---|
| 771 |
'' => '', |
|---|
| 772 |
'‚' => '‚', |
|---|
| 773 |
'ƒ' => 'ƒ', |
|---|
| 774 |
'„' => '„', |
|---|
| 775 |
'…' => '…', |
|---|
| 776 |
'†' => '†', |
|---|
| 777 |
'‡' => '‡', |
|---|
| 778 |
'ˆ' => 'ˆ', |
|---|
| 779 |
'‰' => '‰', |
|---|
| 780 |
'Š' => 'Š', |
|---|
| 781 |
'‹' => '‹', |
|---|
| 782 |
'Œ' => 'Œ', |
|---|
| 783 |
'' => '', |
|---|
| 784 |
'Ž' => 'ž', |
|---|
| 785 |
'' => '', |
|---|
| 786 |
'' => '', |
|---|
| 787 |
'‘' => '‘', |
|---|
| 788 |
'’' => '’', |
|---|
| 789 |
'“' => '“', |
|---|
| 790 |
'”' => '”', |
|---|
| 791 |
'•' => '•', |
|---|
| 792 |
'–' => '–', |
|---|
| 793 |
'—' => '—', |
|---|
| 794 |
'˜' => '˜', |
|---|
| 795 |
'™' => '™', |
|---|
| 796 |
'š' => 'š', |
|---|
| 797 |
'›' => '›', |
|---|
| 798 |
'œ' => 'œ', |
|---|
| 799 |
'' => '', |
|---|
| 800 |
'ž' => '', |
|---|
| 801 |
'Ÿ' => 'Ÿ' |
|---|
| 802 |
); |
|---|
| 803 |
|
|---|
| 804 |
|
|---|
| 805 |
$content = preg_replace('/<title>(.+?)<\/title>/','',$content); |
|---|
| 806 |
$content = preg_replace('/<category>(.+?)<\/category>/','',$content); |
|---|
| 807 |
|
|---|
| 808 |
|
|---|
| 809 |
$content = preg_replace('/&([^#])(?![a-z1-4]{1,8};)/i', '&$1', $content); |
|---|
| 810 |
|
|---|
| 811 |
|
|---|
| 812 |
$content = strtr($content, $wp_htmltranswinuni); |
|---|
| 813 |
|
|---|
| 814 |
|
|---|
| 815 |
$content = str_replace('<br>', '<br />', $content); |
|---|
| 816 |
$content = str_replace('<hr>', '<hr />', $content); |
|---|
| 817 |
|
|---|
| 818 |
return $content; |
|---|
| 819 |
} |
|---|
| 820 |
|
|---|
| 821 |
|
|---|
| 822 |
|
|---|
| 823 |
|
|---|
| 824 |
|
|---|
| 825 |
|
|---|
| 826 |
|
|---|
| 827 |
|
|---|
| 828 |
|
|---|
| 829 |
function funky_javascript_callback($matches) { |
|---|
| 830 |
return "&#".base_convert($matches[1],16,10).";"; |
|---|
| 831 |
} |
|---|
| 832 |
|
|---|
| 833 |
|
|---|
| 834 |
|
|---|
| 835 |
|
|---|
| 836 |
|
|---|
| 837 |
|
|---|
| 838 |
|
|---|
| 839 |
|
|---|
| 840 |
|
|---|
| 841 |
|
|---|
| 842 |
|
|---|
| 843 |
|
|---|
| 844 |
|
|---|
| 845 |
function funky_javascript_fix($text) { |
|---|
| 846 |
|
|---|
| 847 |
global $is_macIE, $is_winIE; |
|---|
| 848 |
|
|---|
| 849 |
if ( $is_winIE || $is_macIE ) |
|---|
| 850 |
$text = preg_replace_callback("/\%u([0-9A-F]{4,4})/", |
|---|
| 851 |
"funky_javascript_callback", |
|---|
| 852 |
$text); |
|---|
| 853 |
|
|---|
| 854 |
return $text; |
|---|
| 855 |
} |
|---|
| 856 |
|
|---|
| 857 |
|
|---|
| 858 |
|
|---|
| 859 |
|
|---|
| 860 |
|
|---|
| 861 |
|
|---|
| 862 |
|
|---|
| 863 |
|
|---|
| 864 |
|
|---|
| 865 |
|
|---|
| 866 |
|
|---|
| 867 |
|
|---|
| 868 |
|
|---|
| 869 |
|
|---|
| 870 |
function balanceTags( $text, $force = false ) { |
|---|
| 871 |
if ( !$force && get_option('use_balanceTags') == 0 ) |
|---|
| 872 |
return $text; |
|---|
| 873 |
return force_balance_tags( $text ); |
|---|
| 874 |
} |
|---|
| 875 |
|
|---|
| 876 |
|
|---|
| 877 |
|
|---|
| 878 |
|
|---|
| 879 |
|
|---|
| 880 |
|
|---|
| 881 |
|
|---|
| 882 |
|
|---|
| 883 |
|
|---|
| 884 |
|
|---|
| 885 |
|
|---|
| 886 |
|
|---|
| 887 |
|
|---|
| 888 |
|
|---|
| 889 |
|
|---|
| 890 |
|
|---|
| 891 |
|
|---|
| 892 |
|
|---|
| 893 |
|
|---|
| 894 |
function force_balance_tags( $text ) { |
|---|
| 895 |
$tagstack = array(); $stacksize = 0; $tagqueue = ''; $newtext = ''; |
|---|
| 896 |
$single_tags = array('br', 'hr', 'img', 'input'); |
|---|
| 897 |
$nestable_tags = array('blockquote', 'div', 'span'); |
|---|
| 898 |
|
|---|
| 899 |
# WP bug fix for comments - in case you REALLY meant to type '< !--' |
|---|
| 900 |
$text = str_replace('< !--', '< !--', $text); |
|---|
| 901 |
|
|---|
| 902 |
$text = preg_replace('#<([0-9]{1})#', '<$1', $text); |
|---|
| 903 |
|
|---|
| 904 |
while (preg_match("/<(\/?\w*)\s*([^>]*)>/",$text,$regex)) { |
|---|
| 905 |
$newtext .= $tagqueue; |
|---|
| 906 |
|
|---|
| 907 |
$i = strpos($text,$regex[0]); |
|---|
| 908 |
$l = strlen($regex[0]); |
|---|
| 909 |
|
|---|
| 910 |
|
|---|
| 911 |
$tagqueue = ''; |
|---|
| 912 |
|
|---|
| 913 |
if ( isset($regex[1][0]) && '/' == $regex[1][0] ) { |
|---|
| 914 |
$tag = strtolower(substr($regex[1],1)); |
|---|
| 915 |
|
|---|
| 916 |
if($stacksize <= 0) { |
|---|
| 917 |
$tag = ''; |
|---|
| 918 |
|
|---|
| 919 |
} |
|---|
| 920 |
|
|---|
| 921 |
else if ($tagstack[$stacksize - 1] == $tag) { |
|---|
| 922 |
$tag = '</' . $tag . '>'; |
|---|
| 923 |
// Pop |
|---|
| 924 |
array_pop ($tagstack); |
|---|
| 925 |
$stacksize--; |
|---|
| 926 |
} else { |
|---|
| 927 |
for ($j=$stacksize-1;$j>=0;$j--) { |
|---|
| 928 |
if ($tagstack[$j] == $tag) { |
|---|
| 929 |
|
|---|
| 930 |
for ($k=$stacksize-1;$k>=$j;$k--){ |
|---|
| 931 |
$tagqueue .= '</' . array_pop ($tagstack) . '>'; |
|---|
| 932 |
$stacksize--; |
|---|
| 933 |
} |
|---|
| 934 |
break; |
|---|
| 935 |
} |
|---|
| 936 |
} |
|---|
| 937 |
$tag = ''; |
|---|
| 938 |
} |
|---|
| 939 |
} else { |
|---|
| 940 |
$tag = strtolower($regex[1]); |
|---|
| 941 |
|
|---|
| 942 |
|
|---|
| 943 |
|
|---|
| 944 |
// If self-closing or '', don't do anything. |
|---|
| 945 |
if((substr($regex[2],-1) == '/') || ($tag == '')) { |
|---|
| 946 |
} |
|---|
| 947 |
|
|---|
| 948 |
elseif ( in_array($tag, $single_tags) ) { |
|---|
| 949 |
$regex[2] .= '/'; |
|---|
| 950 |
} else { |
|---|
| 951 |
// If the top of the stack is the same as the tag we want to push, close previous tag |
|---|
| 952 |
if (($stacksize > 0) && !in_array($tag, $nestable_tags) && ($tagstack[$stacksize - 1] == $tag)) { |
|---|
| 953 |
$tagqueue = '</' . array_pop ($tagstack) . '>'; |
|---|
| 954 |
$stacksize--; |
|---|
| 955 |
} |
|---|
| 956 |
$stacksize = array_push ($tagstack, $tag); |
|---|
| 957 |
} |
|---|
| 958 |
|
|---|
| 959 |
|
|---|
| 960 |
$attributes = $regex[2]; |
|---|
| 961 |
if($attributes) { |
|---|
| 962 |
$attributes = ' '.$attributes; |
|---|
| 963 |
} |
|---|
| 964 |
$tag = '<'.$tag.$attributes.'>'; |
|---|
| 965 |
|
|---|
| 966 |
if ($tagqueue) { |
|---|
| 967 |
$tagqueue .= $tag; |
|---|
| 968 |
$tag = ''; |
|---|
| 969 |
} |
|---|
| 970 |
} |
|---|
| 971 |
$newtext .= substr($text,0,$i) . $tag; |
|---|
| 972 |
$text = substr($text,$i+$l); |
|---|
| 973 |
} |
|---|
| 974 |
|
|---|
| 975 |
|
|---|
| 976 |
$newtext .= $tagqueue; |
|---|
| 977 |
|
|---|
| 978 |
|
|---|
| 979 |
$newtext .= $text; |
|---|
| 980 |
|
|---|
| 981 |
|
|---|
| 982 |
while($x = array_pop($tagstack)) { |
|---|
| 983 |
$newtext .= '</' . $x . '>'; |
|---|
| 984 |
} |
|---|
| 985 |
|
|---|
| 986 |
|
|---|
| 987 |
$newtext = str_replace("< !--","<!--",$newtext); |
|---|
| 988 |
$newtext = str_replace("< !--","< !--",$newtext); |
|---|
| 989 |
|
|---|
| 990 |
return $newtext; |
|---|
| 991 |
} |
|---|
| 992 |
|
|---|
| 993 |
|
|---|
| 994 |
|
|---|
| 995 |
|
|---|
| 996 |
|
|---|
| 997 |
|
|---|
| 998 |
|
|---|
| 999 |
|
|---|
| 1000 |
|
|---|
| 1001 |
|
|---|
| 1002 |
|
|---|
| 1003 |
|
|---|
| 1004 |
|
|---|
| 1005 |
|
|---|
| 1006 |
function format_to_edit($content, $richedit = false) { |
|---|
| 1007 |
$content = apply_filters('format_to_edit', $content); |
|---|
| 1008 |
if (! $richedit ) |
|---|
| 1009 |
$content = htmlspecialchars($content); |
|---|
| 1010 |
return $content; |
|---|
| 1011 |
} |
|---|
| 1012 |
|
|---|
| 1013 |
|
|---|
| 1014 |
|
|---|
| 1015 |
|
|---|
| 1016 |
|
|---|
| 1017 |
|
|---|
| 1018 |
|
|---|
| 1019 |
|
|---|
| 1020 |
|
|---|
| 1021 |
function format_to_post($content) { |
|---|
| 1022 |
$content = apply_filters('format_to_post', $content); |
|---|
| 1023 |
return $content; |
|---|
| 1024 |
} |
|---|
| 1025 |
|
|---|
| 1026 |
|
|---|
| 1027 |
|
|---|
| 1028 |
|
|---|
| 1029 |
|
|---|
| 1030 |
|
|---|
| 1031 |
|
|---|
| 1032 |
|
|---|
| 1033 |
|
|---|
| 1034 |
|
|---|
| 1035 |
|
|---|
| 1036 |
|
|---|
| 1037 |
|
|---|
| 1038 |
|
|---|
| 1039 |
|
|---|
| 1040 |
|
|---|
| 1041 |
|
|---|
| 1042 |
|
|---|
| 1043 |
function zeroise($number, $threshold) { |
|---|
| 1044 |
return sprintf('%0'.$threshold.'s', $number); |
|---|
| 1045 |
} |
|---|
| 1046 |
|
|---|
| 1047 |
|
|---|
| 1048 |
|
|---|
| 1049 |
|
|---|
| 1050 |
|
|---|
| 1051 |
|
|---|
| 1052 |
|
|---|
| 1053 |
|
|---|
| 1054 |
|
|---|
| 1055 |
function backslashit($string) { |
|---|
| 1056 |
$string = preg_replace('/^([0-9])/', '\\\\\\\\\1', $string); |
|---|
| 1057 |
$string = preg_replace('/([a-z])/i', '\\\\\1', $string); |
|---|
| 1058 |
return $string; |
|---|
| 1059 |
} |
|---|
| 1060 |
|
|---|
| 1061 |
|
|---|
| 1062 |
|
|---|
| 1063 |
|
|---|
| 1064 |
|
|---|
| 1065 |
|
|---|
| 1066 |
|
|---|
| 1067 |
|
|---|
| 1068 |
|
|---|
| 1069 |
|
|---|
| 1070 |
|
|---|
| 1071 |
|
|---|
| 1072 |
|
|---|
| 1073 |
|
|---|
| 1074 |
|
|---|
| 1075 |
|
|---|
| 1076 |
function trailingslashit($string) { |
|---|
| 1077 |
return untrailingslashit($string) . '/'; |
|---|
| 1078 |
} |
|---|
| 1079 |
|
|---|
| 1080 |
|
|---|
| 1081 |
|
|---|
| 1082 |
|
|---|
| 1083 |
|
|---|
| 1084 |
|
|---|
| 1085 |
|
|---|
| 1086 |
|
|---|
| 1087 |
|
|---|
| 1088 |
|
|---|
| 1089 |
|
|---|
| 1090 |
|
|---|
| 1091 |
function untrailingslashit($string) { |
|---|
| 1092 |
return rtrim($string, '/'); |
|---|
| 1093 |
} |
|---|
| 1094 |
|
|---|
| 1095 |
|
|---|
| 1096 |
|
|---|
| 1097 |
|
|---|
| 1098 |
|
|---|
| 1099 |
|
|---|
| 1100 |
|
|---|
| 1101 |
|
|---|
| 1102 |
|
|---|
| 1103 |
|
|---|
| 1104 |
|
|---|
| 1105 |
|
|---|
| 1106 |
function addslashes_gpc($gpc) { |
|---|
| 1107 |
global $wpdb; |
|---|
| 1108 |
|
|---|
| 1109 |
if (get_magic_quotes_gpc()) { |
|---|
| 1110 |
$gpc = stripslashes($gpc); |
|---|
| 1111 |
} |
|---|
| 1112 |
|
|---|
| 1113 |
return $wpdb->escape($gpc); |
|---|
| 1114 |
} |
|---|
| 1115 |
|
|---|
| 1116 |
|
|---|
| 1117 |
|
|---|
| 1118 |
|
|---|
| 1119 |
|
|---|
| 1120 |
|
|---|
| 1121 |
|
|---|
| 1122 |
|
|---|
| 1123 |
|
|---|
| 1124 |
|
|---|
| 1125 |
|
|---|
| 1126 |
|
|---|
| 1127 |
function stripslashes_deep($value) { |
|---|
| 1128 |
$value = is_array($value) ? array_map('stripslashes_deep', $value) : stripslashes($value); |
|---|
| 1129 |
return $value; |
|---|
| 1130 |
} |
|---|
| 1131 |
|
|---|
| 1132 |
|
|---|
| 1133 |
|
|---|
| 1134 |
|
|---|
| 1135 |
|
|---|
| 1136 |
|
|---|
| 1137 |
|
|---|
| 1138 |
|
|---|
| 1139 |
|
|---|
| 1140 |
|
|---|
| 1141 |
|
|---|
| 1142 |
|
|---|
| 1143 |
function urlencode_deep($value) { |
|---|
| 1144 |
$value = is_array($value) ? array_map('urlencode_deep', $value) : urlencode($value); |
|---|
| 1145 |
return $value; |
|---|
| 1146 |
} |
|---|
| 1147 |
|
|---|
| 1148 |
|
|---|
| 1149 |
|
|---|
| 1150 |
|
|---|
| 1151 |
|
|---|
| 1152 |
|
|---|
| 1153 |
|
|---|
| 1154 |
|
|---|
| 1155 |
|
|---|
| 1156 |
|
|---|
| 1157 |
function antispambot($emailaddy, $mailto=0) { |
|---|
| 1158 |
$emailNOSPAMaddy = ''; |
|---|
| 1159 |
srand ((float) microtime() * 1000000); |
|---|
| 1160 |
for ($i = 0; $i < strlen($emailaddy); $i = $i + 1) { |
|---|
| 1161 |
$j = floor(rand(0, 1+$mailto)); |
|---|
| 1162 |
if ($j==0) { |
|---|
| 1163 |
$emailNOSPAMaddy .= '&#'.ord(substr($emailaddy,$i,1)).';'; |
|---|
| 1164 |
} elseif ($j==1) { |
|---|
| 1165 |
$emailNOSPAMaddy .= substr($emailaddy,$i,1); |
|---|
| 1166 |
} elseif ($j==2) { |
|---|
| 1167 |
$emailNOSPAMaddy .= '%'.zeroise(dechex(ord(substr($emailaddy, $i, 1))), 2); |
|---|
| 1168 |
} |
|---|
| 1169 |
} |
|---|
| 1170 |
$emailNOSPAMaddy = str_replace('@','@',$emailNOSPAMaddy); |
|---|
| 1171 |
return $emailNOSPAMaddy; |
|---|
| 1172 |
} |
|---|
| 1173 |
|
|---|
| 1174 |
|
|---|
| 1175 |
|
|---|
| 1176 |
|
|---|
| 1177 |
|
|---|
| 1178 |
|
|---|
| 1179 |
|
|---|
| 1180 |
|
|---|
| 1181 |
|
|---|
| 1182 |
|
|---|
| 1183 |
|
|---|
| 1184 |
|
|---|
| 1185 |
|
|---|
| 1186 |
function _make_url_clickable_cb($matches) { |
|---|
| 1187 |
$url = $matches[2]; |
|---|
| 1188 |
$url = esc_url($url); |
|---|
| 1189 |
if ( empty($url) ) |
|---|
| 1190 |
return $matches[0]; |
|---|
| 1191 |
return $matches[1] . "<a href=\"$url\" rel=\"nofollow\">$url</a>"; |
|---|
| 1192 |
} |
|---|
| 1193 |
|
|---|
| 1194 |
|
|---|
| 1195 |
|
|---|
| 1196 |
|
|---|
| 1197 |
|
|---|
| 1198 |
|
|---|
| 1199 |
|
|---|
| 1200 |
|
|---|
| 1201 |
|
|---|
| 1202 |
|
|---|
| 1203 |
|
|---|
| 1204 |
|
|---|
| 1205 |
|
|---|
| 1206 |
function _make_web_ftp_clickable_cb($matches) { |
|---|
| 1207 |
$ret = ''; |
|---|
| 1208 |
$dest = $matches[2]; |
|---|
| 1209 |
$dest = 'http://' . $dest; |
|---|
| 1210 |
$dest = esc_url($dest); |
|---|
| 1211 |
if ( empty($dest) ) |
|---|
| 1212 |
return $matches[0]; |
|---|
| 1213 |
|
|---|
| 1214 |
if ( in_array(substr($dest, -1), array('.', ',', ';', ':')) === true ) { |
|---|
| 1215 |
$ret = substr($dest, -1); |
|---|
| 1216 |
$dest = substr($dest, 0, strlen($dest)-1); |
|---|
| 1217 |
} |
|---|
| 1218 |
return $matches[1] . "<a href=\"$dest\" rel=\"nofollow\">$dest</a>" . $ret; |
|---|
| 1219 |
} |
|---|
| 1220 |
|
|---|
| 1221 |
|
|---|
| 1222 |
|
|---|
| 1223 |
|
|---|
| 1224 |
|
|---|
| 1225 |
|
|---|
| 1226 |
|
|---|
| 1227 |
|
|---|
| 1228 |
|
|---|
| 1229 |
|
|---|
| 1230 |
|
|---|
| 1231 |
|
|---|
| 1232 |
|
|---|
| 1233 |
function _make_email_clickable_cb($matches) { |
|---|
| 1234 |
$email = $matches[2] . '@' . $matches[3]; |
|---|
| 1235 |
return $matches[1] . "<a href=\"mailto:$email\">$email</a>"; |
|---|
| 1236 |
} |
|---|
| 1237 |
|
|---|
| 1238 |
|
|---|
| 1239 |
|
|---|
| 1240 |
|
|---|
| 1241 |
|
|---|
| 1242 |
|
|---|
| 1243 |
|
|---|
| 1244 |
|
|---|
| 1245 |
|
|---|
| 1246 |
|
|---|
| 1247 |
|
|---|
| 1248 |
|
|---|
| 1249 |
function make_clickable($ret) { |
|---|
| 1250 |
$ret = ' ' . $ret; |
|---|
| 1251 |
|
|---|
| 1252 |
$ret = preg_replace_callback('#(?<=[\s>])(\()?([\w]+?://(?:[\w\\x80-\\xff\#$%&~/\-=?@\[\](+]|[.,;:](?![\s<])|(?(1)\)(?![\s<])|\)))+)#is', '_make_url_clickable_cb', $ret); |
|---|
| 1253 |
$ret = preg_replace_callback('#([\s>])((www|ftp)\.[\w\\x80-\\xff\#$%&~/.\-;:=,?@\[\]+]+)#is', '_make_web_ftp_clickable_cb', $ret); |
|---|
| 1254 |
$ret = preg_replace_callback('#([\s>])([.0-9a-z_+-]+)@(([0-9a-z-]+\.)+[0-9a-z]{2,})#i', '_make_email_clickable_cb', $ret); |
|---|
| 1255 |
|
|---|
| 1256 |
$ret = preg_replace("#(<a( [^>]+?>|>))<a [^>]+?>([^>]+?)</a></a>#i", "$1$3</a>", $ret); |
|---|
| 1257 |
$ret = trim($ret); |
|---|
| 1258 |
return $ret; |
|---|
| 1259 |
} |
|---|
| 1260 |
|
|---|
| 1261 |
|
|---|
| 1262 |
|
|---|
| 1263 |
|
|---|
| 1264 |
|
|---|
| 1265 |
|
|---|
| 1266 |
|
|---|
| 1267 |
|
|---|
| 1268 |
|
|---|
| 1269 |
function wp_rel_nofollow( $text ) { |
|---|
| 1270 |
global $wpdb; |
|---|
| 1271 |
|
|---|
| 1272 |
$text = stripslashes($text); |
|---|
| 1273 |
$text = preg_replace_callback('|<a (.+?)>|i', 'wp_rel_nofollow_callback', $text); |
|---|
| 1274 |
$text = $wpdb->escape($text); |
|---|
| 1275 |
return $text; |
|---|
| 1276 |
} |
|---|
| 1277 |
|
|---|
| 1278 |
|
|---|
| 1279 |
|
|---|
| 1280 |
|
|---|
| 1281 |
|
|---|
| 1282 |
|
|---|
| 1283 |
|
|---|
| 1284 |
|
|---|
| 1285 |
|
|---|
| 1286 |
|
|---|
| 1287 |
|
|---|
| 1288 |
|
|---|
| 1289 |
function wp_rel_nofollow_callback( $matches ) { |
|---|
| 1290 |
$text = $matches[1]; |
|---|
| 1291 |
$text = str_replace(array(' rel="nofollow"', " rel='nofollow'"), '', $text); |
|---|
| 1292 |
return "<a $text rel=\"nofollow\">"; |
|---|
| 1293 |
} |
|---|
| 1294 |
|
|---|
| 1295 |
|
|---|
| 1296 |
|
|---|
| 1297 |
|
|---|
| 1298 |
|
|---|
| 1299 |
|
|---|
| 1300 |
|
|---|
| 1301 |
|
|---|
| 1302 |
|
|---|
| 1303 |
|
|---|
| 1304 |
|
|---|
| 1305 |
|
|---|
| 1306 |
|
|---|
| 1307 |
|
|---|
| 1308 |
function translate_smiley($smiley) { |
|---|
| 1309 |
global $wpsmiliestrans; |
|---|
| 1310 |
|
|---|
| 1311 |
if (count($smiley) == 0) { |
|---|
| 1312 |
return ''; |
|---|
| 1313 |
} |
|---|
| 1314 |
|
|---|
| 1315 |
$siteurl = get_option( 'siteurl' ); |
|---|
| 1316 |
|
|---|
| 1317 |
$smiley = trim(reset($smiley)); |
|---|
| 1318 |
$img = $wpsmiliestrans[$smiley]; |
|---|
| 1319 |
$smiley_masked = esc_attr($smiley); |
|---|
| 1320 |
|
|---|
| 1321 |
return " <img src='$siteurl/wp-includes/images/smilies/$img' alt='$smiley_masked' class='wp-smiley' /> "; |
|---|
| 1322 |
} |
|---|
| 1323 |
|
|---|
| 1324 |
|
|---|
| 1325 |
|
|---|
| 1326 |
|
|---|
| 1327 |
|
|---|
| 1328 |
|
|---|
| 1329 |
|
|---|
| 1330 |
|
|---|
| 1331 |
|
|---|
| 1332 |
|
|---|
| 1333 |
|
|---|
| 1334 |
|
|---|
| 1335 |
|
|---|
| 1336 |
|
|---|
| 1337 |
function convert_smilies($text) { |
|---|
| 1338 |
global $wp_smiliessearch; |
|---|
| 1339 |
$output = ''; |
|---|
| 1340 |
if ( get_option('use_smilies') && !empty($wp_smiliessearch) ) { |
|---|
| 1341 |
|
|---|
| 1342 |
$textarr = preg_split("/(<.*>)/U", $text, -1, PREG_SPLIT_DELIM_CAPTURE); |
|---|
| 1343 |
$stop = count($textarr); |
|---|
| 1344 |
for ($i = 0; $i < $stop; $i++) { |
|---|
| 1345 |
$content = $textarr[$i]; |
|---|
| 1346 |
if ((strlen($content) > 0) && ('<' != $content{0})) { |
|---|
| 1347 |
$content = preg_replace_callback($wp_smiliessearch, 'translate_smiley', $content); |
|---|
| 1348 |
} |
|---|
| 1349 |
$output .= $content; |
|---|
| 1350 |
} |
|---|
| 1351 |
} else { |
|---|
| 1352 |
|
|---|
| 1353 |
$output = $text; |
|---|
| 1354 |
} |
|---|
| 1355 |
return $output; |
|---|
| 1356 |
} |
|---|
| 1357 |
|
|---|
| 1358 |
|
|---|
| 1359 |
|
|---|
| 1360 |
|
|---|
| 1361 |
|
|---|
| 1362 |
|
|---|
| 1363 |
|
|---|
| 1364 |
|
|---|
| 1365 |
|
|---|
| 1366 |
|
|---|
| 1367 |
|
|---|
| 1368 |
|
|---|
| 1369 |
function is_email( $email, $check_dns = false ) { |
|---|
| 1370 |
|
|---|
| 1371 |
if ( strlen( $email ) < 3 ) { |
|---|
| 1372 |
return apply_filters( 'is_email', false, $email, 'email_too_short' ); |
|---|
| 1373 |
} |
|---|
| 1374 |
|
|---|
| 1375 |
|
|---|
| 1376 |
if ( strpos( $email, '@', 1 ) === false ) { |
|---|
| 1377 |
return apply_filters( 'is_email', false, $email, 'email_no_at' ); |
|---|
| 1378 |
} |
|---|
| 1379 |
|
|---|
| 1380 |
|
|---|
| 1381 |
list( $local, $domain ) = explode( '@', $email, 2 ); |
|---|
| 1382 |
|
|---|
| 1383 |
|
|---|
| 1384 |
// Test for invalid characters |
|---|
| 1385 |
if ( !preg_match( '/^[a-zA-Z0-9!#$%&\'*+\/=?^_`{|}~\.-]+$/', $local ) ) { |
|---|
| 1386 |
return apply_filters( 'is_email', false, $email, 'local_invalid_chars' ); |
|---|
| 1387 |
} |
|---|
| 1388 |
|
|---|
| 1389 |
|
|---|
| 1390 |
// Test for sequences of periods |
|---|
| 1391 |
if ( preg_match( '/\.{2,}/', $domain ) ) { |
|---|
| 1392 |
return apply_filters( 'is_email', false, $email, 'domain_period_sequence' ); |
|---|
| 1393 |
} |
|---|
| 1394 |
|
|---|
| 1395 |
|
|---|
| 1396 |
if ( trim( $domain, " \t\n\r\0\x0B." ) !== $domain ) { |
|---|
| 1397 |
return apply_filters( 'is_email', false, $email, 'domain_period_limits' ); |
|---|
| 1398 |
} |
|---|
| 1399 |
|
|---|
| 1400 |
|
|---|
| 1401 |
$subs = explode( '.', $domain ); |
|---|
| 1402 |
|
|---|
| 1403 |
|
|---|
| 1404 |
if ( 2 > count( $subs ) ) { |
|---|
| 1405 |
return apply_filters( 'is_email', false, $email, 'domain_no_periods' ); |
|---|
| 1406 |
} |
|---|
| 1407 |
|
|---|
| 1408 |
|
|---|
| 1409 |
foreach ( $subs as $sub ) { |
|---|
| 1410 |
|
|---|
| 1411 |
if ( trim( $sub, " \t\n\r\0\x0B-" ) !== $sub ) { |
|---|
| 1412 |
return apply_filters( 'is_email', false, $email, 'sub_hyphen_limits' ); |
|---|
| 1413 |
} |
|---|
| 1414 |
|
|---|
| 1415 |
|
|---|
| 1416 |
if ( !preg_match('/^[a-z0-9-]+$/i', $sub ) ) { |
|---|
| 1417 |
return apply_filters( 'is_email', false, $email, 'sub_invalid_chars' ); |
|---|
| 1418 |
} |
|---|
| 1419 |
} |
|---|
| 1420 |
|
|---|
| 1421 |
|
|---|
| 1422 |
// Check the domain has a valid MX and A resource record |
|---|
| 1423 |
if ( $check_dns && function_exists( 'checkdnsrr' ) && !( checkdnsrr( $domain . '.', 'MX' ) || checkdnsrr( $domain . '.', 'A' ) ) ) { |
|---|
| 1424 |
return apply_filters( 'is_email', false, $email, 'dns_no_rr' ); |
|---|
| 1425 |
} |
|---|
| 1426 |
|
|---|
| 1427 |
|
|---|
| 1428 |
return apply_filters( 'is_email', $email, $email, null ); |
|---|
| 1429 |
} |
|---|
| 1430 |
|
|---|
| 1431 |
|
|---|
| 1432 |
|
|---|
| 1433 |
|
|---|
| 1434 |
|
|---|
| 1435 |
|
|---|
| 1436 |
|
|---|
| 1437 |
|
|---|
| 1438 |
|
|---|
| 1439 |
|
|---|
| 1440 |
function wp_iso_descrambler($string) { |
|---|
| 1441 |
|
|---|
| 1442 |
if (!preg_match('#\=\?(.+)\?Q\?(.+)\?\=#i', $string, $matches)) { |
|---|
| 1443 |
return $string; |
|---|
| 1444 |
} else { |
|---|
| 1445 |
$subject = str_replace('_', ' ', $matches[2]); |
|---|
| 1446 |
$subject = preg_replace_callback('#\=([0-9a-f]{2})#i', create_function('$match', 'return chr(hexdec(strtolower($match[1])));'), $subject); |
|---|
| 1447 |
return $subject; |
|---|
| 1448 |
} |
|---|
| 1449 |
} |
|---|
| 1450 |
|
|---|
| 1451 |
|
|---|
| 1452 |
|
|---|
| 1453 |
|
|---|
| 1454 |
|
|---|
| 1455 |
|
|---|
| 1456 |
|
|---|
| 1457 |
|
|---|
| 1458 |
|
|---|
| 1459 |
|
|---|
| 1460 |
|
|---|
| 1461 |
|
|---|
| 1462 |
|
|---|
| 1463 |
function get_gmt_from_date($string) { |
|---|
| 1464 |
preg_match('#([0-9]{1,4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})#', $string, $matches); |
|---|
| 1465 |
$string_time = gmmktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]); |
|---|
| 1466 |
$string_gmt = gmdate('Y-m-d H:i:s', $string_time - get_option('gmt_offset') * 3600); |
|---|
| 1467 |
return $string_gmt; |
|---|
| 1468 |
} |
|---|
| 1469 |
|
|---|
| 1470 |
|
|---|
| 1471 |
|
|---|
| 1472 |
|
|---|
| 1473 |
|
|---|
| 1474 |
|
|---|
| 1475 |
|
|---|
| 1476 |
|
|---|
| 1477 |
|
|---|
| 1478 |
|
|---|
| 1479 |
|
|---|
| 1480 |
|
|---|
| 1481 |
function get_date_from_gmt($string) { |
|---|
| 1482 |
preg_match('#([0-9]{1,4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})#', $string, $matches); |
|---|
| 1483 |
$string_time = gmmktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]); |
|---|
| 1484 |
$string_localtime = gmdate('Y-m-d H:i:s', $string_time + get_option('gmt_offset')*3600); |
|---|
| 1485 |
return $string_localtime; |
|---|
| 1486 |
} |
|---|
| 1487 |
|
|---|
| 1488 |
|
|---|
| 1489 |
|
|---|
| 1490 |
|
|---|
| 1491 |
|
|---|
| 1492 |
|
|---|
| 1493 |
|
|---|
| 1494 |
|
|---|
| 1495 |
|
|---|
| 1496 |
function iso8601_timezone_to_offset($timezone) { |
|---|
| 1497 |
|
|---|
| 1498 |
if ($timezone == 'Z') { |
|---|
| 1499 |
$offset = 0; |
|---|
| 1500 |
} else { |
|---|
| 1501 |
$sign = (substr($timezone, 0, 1) == '+') ? 1 : -1; |
|---|
| 1502 |
$hours = intval(substr($timezone, 1, 2)); |
|---|
| 1503 |
$minutes = intval(substr($timezone, 3, 4)) / 60; |
|---|
| 1504 |
$offset = $sign * 3600 * ($hours + $minutes); |
|---|
| 1505 |
} |
|---|
| 1506 |
return $offset; |
|---|
| 1507 |
} |
|---|
| 1508 |
|
|---|
| 1509 |
|
|---|
| 1510 |
|
|---|
| 1511 |
|
|---|
| 1512 |
|
|---|
| 1513 |
|
|---|
| 1514 |
|
|---|
| 1515 |
|
|---|
| 1516 |
|
|---|
| 1517 |
|
|---|
| 1518 |
function iso8601_to_datetime($date_string, $timezone = 'user') { |
|---|
| 1519 |
$timezone = strtolower($timezone); |
|---|
| 1520 |
|
|---|
| 1521 |
if ($timezone == 'gmt') { |
|---|
| 1522 |
|
|---|
| 1523 |
preg_match('#([0-9]{4})([0-9]{2})([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(Z|[\+|\-][0-9]{2,4}){0,1}#', $date_string, $date_bits); |
|---|
| 1524 |
|
|---|
| 1525 |
if (!empty($date_bits[7])) { |
|---|
| 1526 |
$offset = iso8601_timezone_to_offset($date_bits[7]); |
|---|
| 1527 |
} else { |
|---|
| 1528 |
$offset = 3600 * get_option('gmt_offset'); |
|---|
| 1529 |
} |
|---|
| 1530 |
|
|---|
| 1531 |
$timestamp = gmmktime($date_bits[4], $date_bits[5], $date_bits[6], $date_bits[2], $date_bits[3], $date_bits[1]); |
|---|
| 1532 |
$timestamp -= $offset; |
|---|
| 1533 |
|
|---|
| 1534 |
return gmdate('Y-m-d H:i:s', $timestamp); |
|---|
| 1535 |
|
|---|
| 1536 |
} else if ($timezone == 'user') { |
|---|
| 1537 |
return preg_replace('#([0-9]{4})([0-9]{2})([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(Z|[\+|\-][0-9]{2,4}){0,1}#', '$1-$2-$3 $4:$5:$6', $date_string); |
|---|
| 1538 |
} |
|---|
| 1539 |
} |
|---|
| 1540 |
|
|---|
| 1541 |
|
|---|
| 1542 |
|
|---|
| 1543 |
|
|---|
| 1544 |
|
|---|
| 1545 |
|
|---|
| 1546 |
|
|---|
| 1547 |
|
|---|
| 1548 |
|
|---|
| 1549 |
|
|---|
| 1550 |
|
|---|
| 1551 |
|
|---|
| 1552 |
|
|---|
| 1553 |
function popuplinks($text) { |
|---|
| 1554 |
$text = preg_replace('/<a (.+?)>/i', "<a $1 target='_blank' rel='external'>", $text); |
|---|
| 1555 |
return $text; |
|---|
| 1556 |
} |
|---|
| 1557 |
|
|---|
| 1558 |
|
|---|
| 1559 |
|
|---|
| 1560 |
|
|---|
| 1561 |
|
|---|
| 1562 |
|
|---|
| 1563 |
|
|---|
| 1564 |
|
|---|
| 1565 |
|
|---|
| 1566 |
function sanitize_email( $email ) { |
|---|
| 1567 |
|
|---|
| 1568 |
if ( strlen( $email ) < 3 ) { |
|---|
| 1569 |
return apply_filters( 'sanitize_email', '', $email, 'email_too_short' ); |
|---|
| 1570 |
} |
|---|
| 1571 |
|
|---|
| 1572 |
|
|---|
| 1573 |
if ( strpos( $email, '@', 1 ) === false ) { |
|---|
| 1574 |
return apply_filters( 'sanitize_email', '', $email, 'email_no_at' ); |
|---|
| 1575 |
} |
|---|
| 1576 |
|
|---|
| 1577 |
|
|---|
| 1578 |
list( $local, $domain ) = explode( '@', $email, 2 ); |
|---|
| 1579 |
|
|---|
| 1580 |
|
|---|
| 1581 |
// Test for invalid characters |
|---|
| 1582 |
$local = preg_replace( '/[^a-zA-Z0-9!#$%&\'*+\/=?^_`{|}~\.-]/', '', $local ); |
|---|
| 1583 |
if ( '' === $local ) { |
|---|
| 1584 |
return apply_filters( 'sanitize_email', '', $email, 'local_invalid_chars' ); |
|---|
| 1585 |
} |
|---|
| 1586 |
|
|---|
| 1587 |
|
|---|
| 1588 |
// Test for sequences of periods |
|---|
| 1589 |
$domain = preg_replace( '/\.{2,}/', '', $domain ); |
|---|
| 1590 |
if ( '' === $domain ) { |
|---|
| 1591 |
return apply_filters( 'sanitize_email', '', $email, 'domain_period_sequence' ); |
|---|
| 1592 |
} |
|---|
| 1593 |
|
|---|
| 1594 |
|
|---|
| 1595 |
$domain = trim( $domain, " \t\n\r\0\x0B." ); |
|---|
| 1596 |
if ( '' === $domain ) { |
|---|
| 1597 |
return apply_filters( 'sanitize_email', '', $email, 'domain_period_limits' ); |
|---|
| 1598 |
} |
|---|
| 1599 |
|
|---|
| 1600 |
|
|---|
| 1601 |
$subs = explode( '.', $domain ); |
|---|
| 1602 |
|
|---|
| 1603 |
|
|---|
| 1604 |
if ( 2 > count( $subs ) ) { |
|---|
| 1605 |
return apply_filters( 'sanitize_email', '', $email, 'domain_no_periods' ); |
|---|
| 1606 |
} |
|---|
| 1607 |
|
|---|
| 1608 |
|
|---|
| 1609 |
$new_subs = array(); |
|---|
| 1610 |
|
|---|
| 1611 |
|
|---|
| 1612 |
foreach ( $subs as $sub ) { |
|---|
| 1613 |
|
|---|
| 1614 |
$sub = trim( $sub, " \t\n\r\0\x0B-" ); |
|---|
| 1615 |
|
|---|
| 1616 |
|
|---|
| 1617 |
$sub = preg_replace( '/^[^a-z0-9-]+$/i', '', $sub ); |
|---|
| 1618 |
|
|---|
| 1619 |
|
|---|
| 1620 |
if ( '' !== $sub ) { |
|---|
| 1621 |
$new_subs[] = $sub; |
|---|
| 1622 |
} |
|---|
| 1623 |
} |
|---|
| 1624 |
|
|---|
| 1625 |
|
|---|
| 1626 |
if ( 2 > count( $new_subs ) ) { |
|---|
| 1627 |
return apply_filters( 'sanitize_email', '', $email, 'domain_no_valid_subs' ); |
|---|
| 1628 |
} |
|---|
| 1629 |
|
|---|
| 1630 |
|
|---|
| 1631 |
$domain = join( '.', $new_subs ); |
|---|
| 1632 |
|
|---|
| 1633 |
|
|---|
| 1634 |
$email = $local . '@' . $domain; |
|---|
| 1635 |
|
|---|
| 1636 |
|
|---|
| 1637 |
return apply_filters( 'sanitize_email', $email, $email, null ); |
|---|
| 1638 |
} |
|---|
| 1639 |
|
|---|
| 1640 |
|
|---|
| 1641 |
|
|---|
| 1642 |
|
|---|
| 1643 |
|
|---|
| 1644 |
|
|---|
| 1645 |
|
|---|
| 1646 |
|
|---|
| 1647 |
|
|---|
| 1648 |
|
|---|
| 1649 |
|
|---|
| 1650 |
|
|---|
| 1651 |
|
|---|
| 1652 |
function human_time_diff( $from, $to = '' ) { |
|---|
| 1653 |
if ( empty($to) ) |
|---|
| 1654 |
$to = time(); |
|---|
| 1655 |
$diff = (int) abs($to - $from); |
|---|
| 1656 |
if ($diff <= 3600) { |
|---|
| 1657 |
$mins = round($diff / 60); |
|---|
| 1658 |
if ($mins <= 1) { |
|---|
| 1659 |
$mins = 1; |
|---|
| 1660 |
} |
|---|
| 1661 |
$since = sprintf(_n('%s min', '%s mins', $mins), $mins); |
|---|
| 1662 |
} else if (($diff <= 86400) && ($diff > 3600)) { |
|---|
| 1663 |
$hours = round($diff / 3600); |
|---|
| 1664 |
if ($hours <= 1) { |
|---|
| 1665 |
$hours = 1; |
|---|
| 1666 |
} |
|---|
| 1667 |
$since = sprintf(_n('%s hour', '%s hours', $hours), $hours); |
|---|
| 1668 |
} elseif ($diff >= 86400) { |
|---|
| 1669 |
$days = round($diff / 86400); |
|---|
| 1670 |
if ($days <= 1) { |
|---|
| 1671 |
$days = 1; |
|---|
| 1672 |
} |
|---|
| 1673 |
$since = sprintf(_n('%s day', '%s days', $days), $days); |
|---|
| 1674 |
} |
|---|
| 1675 |
return $since; |
|---|
| 1676 |
} |
|---|
| 1677 |
|
|---|
| 1678 |
|
|---|
| 1679 |
|
|---|
| 1680 |
|
|---|
| 1681 |
|
|---|
| 1682 |
|
|---|
| 1683 |
|
|---|
| 1684 |
|
|---|
| 1685 |
|
|---|
| 1686 |
|
|---|
| 1687 |
|
|---|
| 1688 |
|
|---|
| 1689 |
|
|---|
| 1690 |
function wp_trim_excerpt($text) { |
|---|
| 1691 |
$raw_excerpt = $text; |
|---|
| 1692 |
if ( '' == $text ) { |
|---|
| 1693 |
$text = get_the_content(''); |
|---|
| 1694 |
|
|---|
| 1695 |
$text = strip_shortcodes( $text ); |
|---|
| 1696 |
|
|---|
| 1697 |
$text = apply_filters('the_content', $text); |
|---|
| 1698 |
$text = str_replace(']]>', ']]>', $text); |
|---|
| 1699 |
$text = strip_tags($text); |
|---|
| 1700 |
$excerpt_length = apply_filters('excerpt_length', 55); |
|---|
| 1701 |
$words = explode(' ', $text, $excerpt_length + 1); |
|---|
| 1702 |
if (count($words) > $excerpt_length) { |
|---|
| 1703 |
array_pop($words); |
|---|
| 1704 |
array_push($words, '[...]'); |
|---|
| 1705 |
$text = implode(' ', $words); |
|---|
| 1706 |
} |
|---|
| 1707 |
} |
|---|
| 1708 |
return apply_filters('wp_trim_excerpt', $text, $raw_excerpt); |
|---|
| 1709 |
} |
|---|
| 1710 |
|
|---|
| 1711 |
|
|---|
| 1712 |
|
|---|
| 1713 |
|
|---|
| 1714 |
|
|---|
| 1715 |
|
|---|
| 1716 |
|
|---|
| 1717 |
|
|---|
| 1718 |
|
|---|
| 1719 |
function ent2ncr($text) { |
|---|
| 1720 |
$to_ncr = array( |
|---|
| 1721 |
'"' => '"', |
|---|
| 1722 |
'&' => '&', |
|---|
| 1723 |
'⁄' => '/', |
|---|
| 1724 |
'<' => '<', |
|---|
| 1725 |
'>' => '>', |
|---|
| 1726 |
'|' => '|', |
|---|
| 1727 |
' ' => ' ', |
|---|
| 1728 |
'¡' => '¡', |
|---|
| 1729 |
'¢' => '¢', |
|---|
| 1730 |
'£' => '£', |
|---|
| 1731 |
'¤' => '¤', |
|---|
| 1732 |
'¥' => '¥', |
|---|
| 1733 |
'¦' => '¦', |
|---|
| 1734 |
'&brkbar;' => '¦', |
|---|
| 1735 |
'§' => '§', |
|---|
| 1736 |
'¨' => '¨', |
|---|
| 1737 |
'¨' => '¨', |
|---|
| 1738 |
'©' => '©', |
|---|
| 1739 |
'ª' => 'ª', |
|---|
| 1740 |
'«' => '«', |
|---|
| 1741 |
'¬' => '¬', |
|---|
| 1742 |
'­' => '­', |
|---|
| 1743 |
'®' => '®', |
|---|
| 1744 |
'¯' => '¯', |
|---|
| 1745 |
'&hibar;' => '¯', |
|---|
| 1746 |
'°' => '°', |
|---|
| 1747 |
'±' => '±', |
|---|
| 1748 |
'²' => '²', |
|---|
| 1749 |
'³' => '³', |
|---|
| 1750 |
'´' => '´', |
|---|
| 1751 |
'µ' => 'µ', |
|---|
| 1752 |
'¶' => '¶', |
|---|
| 1753 |
'·' => '·', |
|---|
| 1754 |
'¸' => '¸', |
|---|
| 1755 |
'¹' => '¹', |
|---|
| 1756 |
'º' => 'º', |
|---|
| 1757 |
'»' => '»', |
|---|
| 1758 |
'¼' => '¼', |
|---|
| 1759 |
'½' => '½', |
|---|
| 1760 |
'¾' => '¾', |
|---|
| 1761 |
'¿' => '¿', |
|---|
| 1762 |
'À' => 'À', |
|---|
| 1763 |
'Á' => 'Á', |
|---|
| 1764 |
'Â' => 'Â', |
|---|
| 1765 |
'Ã' => 'Ã', |
|---|
| 1766 |
'Ä' => 'Ä', |
|---|
| 1767 |
'Å' => 'Å', |
|---|
| 1768 |
'Æ' => 'Æ', |
|---|
| 1769 |
'Ç' => 'Ç', |
|---|
| 1770 |
'È' => 'È', |
|---|
| 1771 |
'É' => 'É', |
|---|
| 1772 |
'Ê' => 'Ê', |
|---|
| 1773 |
'Ë' => 'Ë', |
|---|
| 1774 |
'Ì' => 'Ì', |
|---|
| 1775 |
'Í' => 'Í', |
|---|
| 1776 |
'Î' => 'Î', |
|---|
| 1777 |
'Ï' => 'Ï', |
|---|
| 1778 |
'Ð' => 'Ð', |
|---|
| 1779 |
'Ñ' => 'Ñ', |
|---|
| 1780 |
'Ò' => 'Ò', |
|---|
| 1781 |
'Ó' => 'Ó', |
|---|
| 1782 |
'Ô' => 'Ô', |
|---|
| 1783 |
'Õ' => 'Õ', |
|---|
| 1784 |
'Ö' => 'Ö', |
|---|
| 1785 |
'×' => '×', |
|---|
| 1786 |
'Ø' => 'Ø', |
|---|
| 1787 |
'Ù' => 'Ù', |
|---|
| 1788 |
'Ú' => 'Ú', |
|---|
| 1789 |
'Û' => 'Û', |
|---|
| 1790 |
'Ü' => 'Ü', |
|---|
| 1791 |
'Ý' => 'Ý', |
|---|
| 1792 |
'Þ' => 'Þ', |
|---|
| 1793 |
'ß' => 'ß', |
|---|
| 1794 |
'à' => 'à', |
|---|
| 1795 |
'á' => 'á', |
|---|
| 1796 |
'â' => 'â', |
|---|
| 1797 |
'ã' => 'ã', |
|---|
| 1798 |
'ä' => 'ä', |
|---|
| 1799 |
'å' => 'å', |
|---|
| 1800 |
'æ' => 'æ', |
|---|
| 1801 |
'ç' => 'ç', |
|---|
| 1802 |
'è' => 'è', |
|---|
| 1803 |
'é' => 'é', |
|---|
| 1804 |
'ê' => 'ê', |
|---|
| 1805 |
'ë' => 'ë', |
|---|
| 1806 |
'ì' => 'ì', |
|---|
| 1807 |
'í' => 'í', |
|---|
| 1808 |
'î' => 'î', |
|---|
| 1809 |
'ï' => 'ï', |
|---|
| 1810 |
'ð' => 'ð', |
|---|
| 1811 |
'ñ' => 'ñ', |
|---|
| 1812 |
'ò' => 'ò', |
|---|
| 1813 |
'ó' => 'ó', |
|---|
| 1814 |
'ô' => 'ô', |
|---|
| 1815 |
'õ' => 'õ', |
|---|
| 1816 |
'ö' => 'ö', |
|---|
| 1817 |
'÷' => '÷', |
|---|
| 1818 |
'ø' => 'ø', |
|---|
| 1819 |
'ù' => 'ù', |
|---|
| 1820 |
'ú' => 'ú', |
|---|
| 1821 |
'û' => 'û', |
|---|
| 1822 |
'ü' => 'ü', |
|---|
| 1823 |
'ý' => 'ý', |
|---|
| 1824 |
'þ' => 'þ', |
|---|
| 1825 |
'ÿ' => 'ÿ', |
|---|
| 1826 |
'Œ' => 'Œ', |
|---|
| 1827 |
'œ' => 'œ', |
|---|
| 1828 |
'Š' => 'Š', |
|---|
| 1829 |
'š' => 'š', |
|---|
| 1830 |
'Ÿ' => 'Ÿ', |
|---|
| 1831 |
'ƒ' => 'ƒ', |
|---|
| 1832 |
'ˆ' => 'ˆ', |
|---|
| 1833 |
'˜' => '˜', |
|---|
| 1834 |
'Α' => 'Α', |
|---|
| 1835 |
'Β' => 'Β', |
|---|
| 1836 |
'Γ' => 'Γ', |
|---|
| 1837 |
'Δ' => 'Δ', |
|---|
| 1838 |
'Ε' => 'Ε', |
|---|
| 1839 |
'Ζ' => 'Ζ', |
|---|
| 1840 |
'Η' => 'Η', |
|---|
| 1841 |
'Θ' => 'Θ', |
|---|
| 1842 |
'Ι' => 'Ι', |
|---|
| 1843 |
'Κ' => 'Κ', |
|---|
| 1844 |
'Λ' => 'Λ', |
|---|
| 1845 |
'Μ' => 'Μ', |
|---|
| 1846 |
'Ν' => 'Ν', |
|---|
| 1847 |
'Ξ' => 'Ξ', |
|---|
| 1848 |
'Ο' => 'Ο', |
|---|
| 1849 |
'Π' => 'Π', |
|---|
| 1850 |
'Ρ' => 'Ρ', |
|---|
| 1851 |
'Σ' => 'Σ', |
|---|
| 1852 |
'Τ' => 'Τ', |
|---|
| 1853 |
'Υ' => 'Υ', |
|---|
| 1854 |
'Φ' => 'Φ', |
|---|
| 1855 |
'Χ' => 'Χ', |
|---|
| 1856 |
'Ψ' => 'Ψ', |
|---|
| 1857 |
'Ω' => 'Ω', |
|---|
| 1858 |
'α' => 'α', |
|---|
| 1859 |
'β' => 'β', |
|---|
| 1860 |
'γ' => 'γ', |
|---|
| 1861 |
'δ' => 'δ', |
|---|
| 1862 |
'ε' => 'ε', |
|---|
| 1863 |
'ζ' => 'ζ', |
|---|
| 1864 |
'η' => 'η', |
|---|
| 1865 |
'θ' => 'θ', |
|---|
| 1866 |
'ι' => 'ι', |
|---|
| 1867 |
'κ' => 'κ', |
|---|
| 1868 |
'λ' => 'λ', |
|---|
| 1869 |
'μ' => 'μ', |
|---|
| 1870 |
'ν' => 'ν', |
|---|
| 1871 |
'ξ' => 'ξ', |
|---|
| 1872 |
'ο' => 'ο', |
|---|
| 1873 |
'π' => 'π', |
|---|
| 1874 |
'ρ' => 'ρ', |
|---|
| 1875 |
'ς' => 'ς', |
|---|
| 1876 |
'σ' => 'σ', |
|---|
| 1877 |
'τ' => 'τ', |
|---|
| 1878 |
'υ' => 'υ', |
|---|
| 1879 |
'φ' => 'φ', |
|---|
| 1880 |
'χ' => 'χ', |
|---|
| 1881 |
'ψ' => 'ψ', |
|---|
| 1882 |
'ω' => 'ω', |
|---|
| 1883 |
'ϑ' => 'ϑ', |
|---|
| 1884 |
'ϒ' |
|---|