| 1 |
<?php |
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
if (!defined('CUSTOM_TAGS')) |
|---|
| 13 |
define('CUSTOM_TAGS', false); |
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
if (!CUSTOM_TAGS) { |
|---|
| 17 |
$allowedtags = array( |
|---|
| 18 |
'a' => array( |
|---|
| 19 |
'href' => array(), |
|---|
| 20 |
'title' => array() |
|---|
| 21 |
), |
|---|
| 22 |
'abbr' => array('title' => array()), |
|---|
| 23 |
'acronym' => array('title' => array()), |
|---|
| 24 |
'b' => array(), |
|---|
| 25 |
'blockquote' => array('cite' => array()), |
|---|
| 26 |
|
|---|
| 27 |
'code' => array(), |
|---|
| 28 |
|
|---|
| 29 |
|
|---|
| 30 |
|
|---|
| 31 |
|
|---|
| 32 |
'em' => array(), |
|---|
| 33 |
'i' => array(), |
|---|
| 34 |
|
|---|
| 35 |
|
|---|
| 36 |
|
|---|
| 37 |
|
|---|
| 38 |
|
|---|
| 39 |
'strike' => array(), |
|---|
| 40 |
'strong' => array(), |
|---|
| 41 |
|
|---|
| 42 |
|
|---|
| 43 |
|
|---|
| 44 |
|
|---|
| 45 |
); |
|---|
| 46 |
|
|---|
| 47 |
wp_kses($string, $allowed_html, $allowed_protocols = |
|---|
| 48 |
'http', 'https', 'ftp', 'news', 'nntp', 'feed', 'gopher', 'mailto')) |
|---|
| 49 |
|
|---|
| 50 |
|
|---|
| 51 |
|
|---|
| 52 |
|
|---|
| 53 |
|
|---|
| 54 |
|
|---|
| 55 |
{ |
|---|
| 56 |
$string = wp_kses_no_null($string); |
|---|
| 57 |
$string = wp_kses_js_entities($string); |
|---|
| 58 |
$string = wp_kses_normalize_entities($string); |
|---|
| 59 |
$string = wp_kses_hook($string); |
|---|
| 60 |
$allowed_html_fixed = wp_kses_array_lc($allowed_html); |
|---|
| 61 |
return wp_kses_split($string, $allowed_html_fixed, $allowed_protocols); |
|---|
| 62 |
} |
|---|
| 63 |
|
|---|
| 64 |
|
|---|
| 65 |
function wp_kses_hook($string) |
|---|
| 66 |
|
|---|
| 67 |
|
|---|
| 68 |
|
|---|
| 69 |
{ |
|---|
| 70 |
return $string; |
|---|
| 71 |
} |
|---|
| 72 |
|
|---|
| 73 |
|
|---|
| 74 |
function wp_kses_version() |
|---|
| 75 |
|
|---|
| 76 |
|
|---|
| 77 |
|
|---|
| 78 |
{ |
|---|
| 79 |
return '0.2.1'; |
|---|
| 80 |
} |
|---|
| 81 |
|
|---|
| 82 |
|
|---|
| 83 |
function wp_kses_split($string, $allowed_html, $allowed_protocols) |
|---|
| 84 |
|
|---|
| 85 |
|
|---|
| 86 |
|
|---|
| 87 |
|
|---|
| 88 |
{ |
|---|
| 89 |
return preg_replace('%(<'. |
|---|
| 90 |
'[^>]*'. |
|---|
| 91 |
'(>|$)'. |
|---|
| 92 |
'|>)%e', |
|---|
| 93 |
"wp_kses_split2('\\1', \$allowed_html, ". |
|---|
| 94 |
'$allowed_protocols)', |
|---|
| 95 |
$string); |
|---|
| 96 |
} |
|---|
| 97 |
|
|---|
| 98 |
|
|---|
| 99 |
function wp_kses_split2($string, $allowed_html, $allowed_protocols) |
|---|
| 100 |
|
|---|
| 101 |
|
|---|
| 102 |
|
|---|
| 103 |
|
|---|
| 104 |
|
|---|
| 105 |
|
|---|
| 106 |
{ |
|---|
| 107 |
$string = wp_kses_stripslashes($string); |
|---|
| 108 |
|
|---|
| 109 |
if (substr($string, 0, 1) != '<') |
|---|
| 110 |
return '>'; |
|---|
| 111 |
|
|---|
| 112 |
|
|---|
| 113 |
if (!preg_match('%^<\s*(/\s*)?([a-zA-Z0-9]+)([^>]*)>?$%', $string, $matches)) |
|---|
| 114 |
return ''; |
|---|
| 115 |
|
|---|
| 116 |
|
|---|
| 117 |
$slash = trim($matches[1]); |
|---|
| 118 |
$elem = $matches[2]; |
|---|
| 119 |
$attrlist = $matches[3]; |
|---|
| 120 |
|
|---|
| 121 |
if (!is_array($allowed_html[strtolower($elem)])) |
|---|
| 122 |
return ''; |
|---|
| 123 |
|
|---|
| 124 |
|
|---|
| 125 |
return wp_kses_attr("$slash$elem", $attrlist, $allowed_html, |
|---|
| 126 |
$allowed_protocols); |
|---|
| 127 |
} |
|---|
| 128 |
|
|---|
| 129 |
|
|---|
| 130 |
function wp_kses_attr($element, $attr, $allowed_html, $allowed_protocols) |
|---|
| 131 |
|
|---|
| 132 |
|
|---|
| 133 |
|
|---|
| 134 |
|
|---|
| 135 |
|
|---|
| 136 |
|
|---|
| 137 |
|
|---|
| 138 |
|
|---|
| 139 |
{ |
|---|
| 140 |
|
|---|
| 141 |
|
|---|
| 142 |
$xhtml_slash = ''; |
|---|
| 143 |
preg_match('%\s/\s*$%', $attr)) |
|---|
| 144 |
$xhtml_slash = ' /'; |
|---|
| 145 |
|
|---|
| 146 |
|
|---|
| 147 |
|
|---|
| 148 |
if (count($allowed_html[strtolower($element)]) == 0) |
|---|
| 149 |
"<$element$xhtml_slash>"; |
|---|
| 150 |
|
|---|
| 151 |
|
|---|
| 152 |
|
|---|
| 153 |
$attrarr = wp_kses_hair($attr, $allowed_protocols); |
|---|
| 154 |
|
|---|
| 155 |
|
|---|
| 156 |
|
|---|
| 157 |
|
|---|
| 158 |
$attr2 = ''; |
|---|
| 159 |
|
|---|
| 160 |
$attrarr as $arreach) |
|---|
| 161 |
|
|---|
| 162 |
$current = $allowed_html[strtolower($element)] |
|---|
| 163 |
strtolower($arreach['name'])]; |
|---|
| 164 |
$current == '') |
|---|
| 165 |
|
|---|
| 166 |
|
|---|
| 167 |
if (!is_array($current)) |
|---|
| 168 |
$attr2 .= ' '.$arreach['whole']; |
|---|
| 169 |
|
|---|
| 170 |
|
|---|
| 171 |
else |
|---|
| 172 |
|
|---|
| 173 |
|
|---|
| 174 |
$ok = true; |
|---|
| 175 |
$current as $currkey => $currval) |
|---|
| 176 |
wp_kses_check_attr_val($arreach['value'], $arreach['vless'], |
|---|
| 177 |
$currkey, $currval)) |
|---|
| 178 |
$ok = false; break; } |
|---|
| 179 |
|
|---|
| 180 |
$ok) |
|---|
| 181 |
$attr2 .= ' '.$arreach['whole']; |
|---|
| 182 |
} |
|---|
| 183 |
} |
|---|
| 184 |
|
|---|
| 185 |
|
|---|
| 186 |
|
|---|
| 187 |
$attr2 = preg_replace('/[<>]/', '', $attr2); |
|---|
| 188 |
|
|---|
| 189 |
"<$element$attr2$xhtml_slash>"; |
|---|
| 190 |
|
|---|
| 191 |
|
|---|
| 192 |
|
|---|
| 193 |
function wp_kses_hair($attr, $allowed_protocols) |
|---|
| 194 |
|
|---|
| 195 |
|
|---|
| 196 |
|
|---|
| 197 |
|
|---|
| 198 |
|
|---|
| 199 |
|
|---|
| 200 |
|
|---|
| 201 |
|
|---|
| 202 |
{ |
|---|
| 203 |
$attrarr = array(); |
|---|
| 204 |
$mode = 0; |
|---|
| 205 |
$attrname = ''; |
|---|
| 206 |
|
|---|
| 207 |
|
|---|
| 208 |
|
|---|
| 209 |
while (strlen($attr) != 0) |
|---|
| 210 |
|
|---|
| 211 |
$working = 0; |
|---|
| 212 |
|
|---|
| 213 |
switch ($mode) |
|---|
| 214 |
|
|---|
| 215 |
0: |
|---|
| 216 |
|
|---|
| 217 |
if (preg_match('/^([-a-zA-Z]+)/', $attr, $match)) |
|---|
| 218 |
|
|---|
| 219 |
$attrname = $match[1]; |
|---|
| 220 |
$working = $mode = 1; |
|---|
| 221 |
$attr = preg_replace('/^[-a-zA-Z]+/', '', $attr); |
|---|
| 222 |
|
|---|
| 223 |
|
|---|
| 224 |
|
|---|
| 225 |
|
|---|
| 226 |
1: |
|---|
| 227 |
|
|---|
| 228 |
if (preg_match('/^\s*=\s*/', $attr)) |
|---|
| 229 |
{ |
|---|
| 230 |
$working = 1; $mode = 2; |
|---|
| 231 |
$attr = preg_replace('/^\s*=\s*/', '', $attr); |
|---|
| 232 |
|
|---|
| 233 |
|
|---|
| 234 |
|
|---|
| 235 |
preg_match('/^\s+/', $attr)) |
|---|
| 236 |
{ |
|---|
| 237 |
$working = 1; $mode = 0; |
|---|
| 238 |
$attrarr[] = array |
|---|
| 239 |
'name' => $attrname, |
|---|
| 240 |
'value' => '', |
|---|
| 241 |
'whole' => $attrname, |
|---|
| 242 |
'vless' => 'y'); |
|---|
| 243 |
$attr = preg_replace('/^\s+/', '', $attr); |
|---|
| 244 |
|
|---|
| 245 |
|
|---|
| 246 |
|
|---|
| 247 |
|
|---|
| 248 |
2: |
|---|
| 249 |
|
|---|
| 250 |
if (preg_match('/^"([^"]*)"(\s+|$)/', $attr, $match)) |
|---|
| 251 |
|
|---|
| 252 |
{ |
|---|
| 253 |
$thisval = wp_kses_bad_protocol($match[1], $allowed_protocols); |
|---|
| 254 |
|
|---|
| 255 |
$attrarr[] = array |
|---|
| 256 |
'name' => $attrname, |
|---|
| 257 |
'value' => $thisval, |
|---|
| 258 |
'whole' => "$attrname=\"$thisval\"", |
|---|
| 259 |
'vless' => 'n'); |
|---|
| 260 |
$working = 1; $mode = 0; |
|---|
| 261 |
$attr = preg_replace('/^"[^"]*"(\s+|$)/', '', $attr); |
|---|
| 262 |
|
|---|
| 263 |
|
|---|
| 264 |
|
|---|
| 265 |
preg_match("/^'([^']*)'(\s+|$)/", $attr, $match)) |
|---|
| 266 |
|
|---|
| 267 |
{ |
|---|
| 268 |
$thisval = wp_kses_bad_protocol($match[1], $allowed_protocols); |
|---|
| 269 |
|
|---|
| 270 |
$attrarr[] = array |
|---|
| 271 |
'name' => $attrname, |
|---|
| 272 |
'value' => $thisval, |
|---|
| 273 |
'whole' => "$attrname='$thisval'", |
|---|
| 274 |
'vless' => 'n'); |
|---|
| 275 |
$working = 1; $mode = 0; |
|---|
| 276 |
$attr = preg_replace("/^'[^']*'(\s+|$)/", '', $attr); |
|---|
| 277 |
|
|---|
| 278 |
|
|---|
| 279 |
|
|---|
| 280 |
preg_match("%^([^\s\"']+)(\s+|$)%", $attr, $match)) |
|---|
| 281 |
|
|---|
| 282 |
{ |
|---|
| 283 |
$thisval = wp_kses_bad_protocol($match[1], $allowed_protocols); |
|---|
| 284 |
|
|---|
| 285 |
$attrarr[] = array |
|---|
| 286 |
'name' => $attrname, |
|---|
| 287 |
'value' => $thisval, |
|---|
| 288 |
'whole' => "$attrname=\"$thisval\"", |
|---|
| 289 |
'vless' => 'n'); |
|---|
| 290 |
|
|---|
| 291 |
$working = 1; $mode = 0; |
|---|
| 292 |
$attr = preg_replace("%^[^\s\"']+(\s+|$)%", '', $attr); |
|---|
| 293 |
|
|---|
| 294 |
|
|---|
| 295 |
|
|---|
| 296 |
|
|---|
| 297 |
|
|---|
| 298 |
if ($working == 0) |
|---|
| 299 |
{ |
|---|
| 300 |
$attr = wp_kses_html_error($attr); |
|---|
| 301 |
$mode = 0; |
|---|
| 302 |
|
|---|
| 303 |
|
|---|
| 304 |
|
|---|
| 305 |
if ($mode == 1) |
|---|
| 306 |
|
|---|
| 307 |
|
|---|
| 308 |
$attrarr[] = array |
|---|
| 309 |
'name' => $attrname, |
|---|
| 310 |
'value' => '', |
|---|
| 311 |
'whole' => $attrname, |
|---|
| 312 |
'vless' => 'y'); |
|---|
| 313 |
|
|---|
| 314 |
$attrarr; |
|---|
| 315 |
|
|---|
| 316 |
|
|---|
| 317 |
|
|---|
| 318 |
function wp_kses_check_attr_val($value, $vless, $checkname, $checkvalue) |
|---|
| 319 |
|
|---|
| 320 |
|
|---|
| 321 |
|
|---|
| 322 |
|
|---|
| 323 |
|
|---|
| 324 |
{ |
|---|
| 325 |
$ok = true; |
|---|
| 326 |
|
|---|
| 327 |
switch (strtolower($checkname)) |
|---|
| 328 |
{ |
|---|
| 329 |
case 'maxlen': |
|---|
| 330 |
|
|---|
| 331 |
# greater than the given value. This can be used to avoid Buffer Overflows |
|---|
| 332 |
# in WWW clients and various Internet servers. |
|---|
| 333 |
|
|---|
| 334 |
if (strlen($value) > $checkvalue) |
|---|
| 335 |
$ok = false; |
|---|
| 336 |
break; |
|---|
| 337 |
|
|---|
| 338 |
case 'minlen': |
|---|
| 339 |
|
|---|
| 340 |
# smaller than the given value. |
|---|
| 341 |
|
|---|
| 342 |
if (strlen($value) < $checkvalue) |
|---|
| 343 |
$ok = false; |
|---|
| 344 |
break; |
|---|
| 345 |
|
|---|
| 346 |
case 'maxval': |
|---|
| 347 |
|
|---|
| 348 |
# an integer from 0 and up, without an excessive amount of zeroes or |
|---|
| 349 |
# whitespace (to avoid Buffer Overflows). It also checks that the attribute |
|---|
| 350 |
# value is not greater than the given value. |
|---|
| 351 |
# This check can be used to avoid Denial of Service attacks. |
|---|
| 352 |
|
|---|
| 353 |
if (!preg_match('/^\s{0,6}[0-9]{1,6}\s{0,6}$/', $value)) |
|---|
| 354 |
$ok = false; |
|---|
| 355 |
if ($value > $checkvalue) |
|---|
| 356 |
$ok = false; |
|---|
| 357 |
break; |
|---|
| 358 |
|
|---|
| 359 |
case 'minval': |
|---|
| 360 |
|
|---|
| 361 |
# and that it is not smaller than the given value. |
|---|
| 362 |
|
|---|
| 363 |
if (!preg_match('/^\s{0,6}[0-9]{1,6}\s{0,6}$/', $value)) |
|---|
| 364 |
$ok = false; |
|---|
| 365 |
if ($value < $checkvalue) |
|---|
| 366 |
$ok = false; |
|---|
| 367 |
break; |
|---|
| 368 |
|
|---|
| 369 |
case 'valueless': |
|---|
| 370 |
|
|---|
| 371 |
# (like <a href="blah">) or not (<option selected>). If the given value |
|---|
| 372 |
# is a "y" or a "Y", the attribute must not have a value. |
|---|
| 373 |
# If the given value is an "n" or an "N", the attribute must have one. |
|---|
| 374 |
|
|---|
| 375 |
if (strtolower($checkvalue) != $vless) |
|---|
| 376 |
$ok = false; |
|---|
| 377 |
break; |
|---|
| 378 |
} |
|---|
| 379 |
|
|---|
| 380 |
return $ok; |
|---|
| 381 |
} |
|---|
| 382 |
|
|---|
| 383 |
|
|---|
| 384 |
function wp_kses_bad_protocol($string, $allowed_protocols) |
|---|
| 385 |
|
|---|
| 386 |
|
|---|
| 387 |
|
|---|
| 388 |
|
|---|
| 389 |
|
|---|
| 390 |
|
|---|
| 391 |
{ |
|---|
| 392 |
$string = wp_kses_no_null($string); |
|---|
| 393 |
$string2 = $string.'a'; |
|---|
| 394 |
|
|---|
| 395 |
while ($string != $string2) |
|---|
| 396 |
{ |
|---|
| 397 |
$string2 = $string; |
|---|
| 398 |
$string = wp_kses_bad_protocol_once($string, $allowed_protocols); |
|---|
| 399 |
} |
|---|
| 400 |
|
|---|
| 401 |
return $string; |
|---|
| 402 |
} |
|---|
| 403 |
|
|---|
| 404 |
|
|---|
| 405 |
function wp_kses_no_null($string) |
|---|
| 406 |
|
|---|
| 407 |
|
|---|
| 408 |
|
|---|
| 409 |
{ |
|---|
| 410 |
$string = preg_replace('/\0+/', '', $string); |
|---|
| 411 |
$string = preg_replace('/(\\\\0)+/', '', $string); |
|---|
| 412 |
|
|---|
| 413 |
return $string; |
|---|
| 414 |
} |
|---|
| 415 |
|
|---|
| 416 |
|
|---|
| 417 |
function wp_kses_stripslashes($string) |
|---|
| 418 |
|
|---|
| 419 |
|
|---|
| 420 |
|
|---|
| 421 |
|
|---|
| 422 |
|
|---|
| 423 |
{ |
|---|
| 424 |
return preg_replace('%\\\\"%', '"', $string); |
|---|
| 425 |
} |
|---|
| 426 |
|
|---|
| 427 |
|
|---|
| 428 |
function wp_kses_array_lc($inarray) |
|---|
| 429 |
|
|---|
| 430 |
|
|---|
| 431 |
|
|---|
| 432 |
{ |
|---|
| 433 |
$outarray = array(); |
|---|
| 434 |
|
|---|
| 435 |
foreach ($inarray as $inkey => $inval) |
|---|
| 436 |
{ |
|---|
| 437 |
$outkey = strtolower($inkey); |
|---|
| 438 |
$outarray[$outkey] = array(); |
|---|
| 439 |
|
|---|
| 440 |
foreach ($inval as $inkey2 => $inval2) |
|---|
| 441 |
{ |
|---|
| 442 |
$outkey2 = strtolower($inkey2); |
|---|
| 443 |
$outarray[$outkey][$outkey2] = $inval2; |
|---|
| 444 |
} |
|---|
| 445 |
} |
|---|
| 446 |
|
|---|
| 447 |
return $outarray; |
|---|
| 448 |
} |
|---|
| 449 |
|
|---|
| 450 |
|
|---|
| 451 |
function wp_kses_js_entities($string) |
|---|
| 452 |
|
|---|
| 453 |
|
|---|
| 454 |
|
|---|
| 455 |
|
|---|
| 456 |
{ |
|---|
| 457 |
return preg_replace('%&\s*\{[^}]*(\}\s*;?|$)%', '', $string); |
|---|
| 458 |
} |
|---|
| 459 |
|
|---|
| 460 |
|
|---|
| 461 |
function wp_kses_html_error($string) |
|---|
| 462 |
|
|---|
| 463 |
|
|---|
| 464 |
|
|---|
| 465 |
|
|---|
| 466 |
|
|---|
| 467 |
{ |
|---|
| 468 |
return preg_replace('/^("[^"]*("|$)|\'[^\']*(\'|$)|\S)*\s*/', '', $string); |
|---|
| 469 |
} |
|---|
| 470 |
|
|---|
| 471 |
|
|---|
| 472 |
function wp_kses_bad_protocol_once($string, $allowed_protocols) |
|---|
| 473 |
|
|---|
| 474 |
|
|---|
| 475 |
|
|---|
| 476 |
|
|---|
| 477 |
{ |
|---|
| 478 |
return preg_replace('/^((&[^;]*;|[\sA-Za-z0-9])*)'. |
|---|
| 479 |
'(:|:|&#[Xx]3[Aa];)\s*/e', |
|---|
| 480 |
'wp_kses_bad_protocol_once2("\\1", $allowed_protocols)', |
|---|
| 481 |
$string); |
|---|
| 482 |
} |
|---|
| 483 |
|
|---|
| 484 |
|
|---|
| 485 |
function wp_kses_bad_protocol_once2($string, $allowed_protocols) |
|---|
| 486 |
|
|---|
| 487 |
|
|---|
| 488 |
|
|---|
| 489 |
|
|---|
| 490 |
{ |
|---|
| 491 |
$string2 = wp_kses_decode_entities($string); |
|---|
| 492 |
$string2 = preg_replace('/\s/', '', $string2); |
|---|
| 493 |
$string2 = wp_kses_no_null($string2); |
|---|
| 494 |
$string2 = strtolower($string2); |
|---|
| 495 |
|
|---|
| 496 |
$allowed = false; |
|---|
| 497 |
foreach ($allowed_protocols as $one_protocol) |
|---|
| 498 |
if (strtolower($one_protocol) == $string2) |
|---|
| 499 |
{ |
|---|
| 500 |
$allowed = true; |
|---|
| 501 |
break; |
|---|
| 502 |
} |
|---|
| 503 |
|
|---|
| 504 |
if ($allowed) |
|---|
| 505 |
return "$string2:"; |
|---|
| 506 |
else |
|---|
| 507 |
return ''; |
|---|
| 508 |
} |
|---|
| 509 |
|
|---|
| 510 |
|
|---|
| 511 |
function wp_kses_normalize_entities($string) |
|---|
| 512 |
|
|---|
| 513 |
|
|---|
| 514 |
|
|---|
| 515 |
|
|---|
| 516 |
{ |
|---|
| 517 |
|
|---|
| 518 |
|
|---|
| 519 |
$string = str_replace('&', '&', $string); |
|---|
| 520 |
|
|---|
| 521 |
|
|---|
| 522 |
|
|---|
| 523 |
$string = preg_replace('/&([A-Za-z][A-Za-z0-9]{0,19});/', |
|---|
| 524 |
'&\\1;', $string); |
|---|
| 525 |
$string = preg_replace('/&#0*([0-9]{1,5});/e', |
|---|
| 526 |
'wp_kses_normalize_entities2("\\1")', $string); |
|---|
| 527 |
$string = preg_replace('/&#([Xx])0*(([0-9A-Fa-f]{2}){1,2});/', |
|---|
| 528 |
'&#\\1\\2;', $string); |
|---|
| 529 |
|
|---|
| 530 |
$string; |
|---|
| 531 |
|
|---|
| 532 |
|
|---|
| 533 |
|
|---|
| 534 |
function wp_kses_normalize_entities2($i) |
|---|
| 535 |
|
|---|
| 536 |
|
|---|
| 537 |
|
|---|
| 538 |
|
|---|
| 539 |
{ |
|---|
| 540 |
return (($i > 65535) ? "&#$i;" : "&#$i;"); |
|---|
| 541 |
} |
|---|
| 542 |
|
|---|
| 543 |
|
|---|
| 544 |
function wp_kses_decode_entities($string) |
|---|
| 545 |
|
|---|
| 546 |
|
|---|
| 547 |
|
|---|
| 548 |
|
|---|
| 549 |
|
|---|
| 550 |
{ |
|---|
| 551 |
$string = preg_replace('/&#([0-9]+);/e', 'chr("\\1")', $string); |
|---|
| 552 |
$string = preg_replace('/&#[Xx]([0-9A-Fa-f]+);/e', 'chr(hexdec("\\1"))', |
|---|
| 553 |
$string); |
|---|
| 554 |
|
|---|
| 555 |
return $string; |
|---|
| 556 |
} |
|---|
| 557 |
|
|---|
| 558 |
function wp_filter_kses( $string ) { |
|---|
| 559 |
global $allowedtags; |
|---|
| 560 |
return wp_kses($string, $allowedtags); |
|---|
| 561 |
} |
|---|
| 562 |
|
|---|
| 563 |
?> |
|---|