htmlspecialchars_decode() for php versions less than 5.1, props sivel, fixes #8679

git-svn-id: https://develop.svn.wordpress.org/trunk@10236 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz 2008-12-21 09:03:23 +00:00
parent 9f66fcd434
commit 64f41a22fb
1 changed files with 7 additions and 0 deletions

View File

@ -96,4 +96,11 @@ function _mb_strcut( $str, $start, $length=null, $encoding=null ) {
return implode( '', $chars );
}
// from php.net
if ( !function_exists('htmlspecialchars_decode') ) {
function htmlspecialchars_decode( $str, $quote_style = ENT_COMPAT ) {
return strtr( $str, array_flip( get_html_translation_table(HTML_SPECIALCHARS, $quote_style) ) );
}
}
?>