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

git-svn-id: http://svn.automattic.com/wordpress/trunk@10236 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
azaozz 2008-12-21 09:03:23 +00:00
parent 199e79af54
commit 79eab52909
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) ) );
}
}
?>