From 64f41a22fb29d417b86491dcca43776f7e039781 Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Sun, 21 Dec 2008 09:03:23 +0000 Subject: [PATCH] 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 --- wp-includes/compat.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/wp-includes/compat.php b/wp-includes/compat.php index 9eb18d4db9..aa5ab941aa 100644 --- a/wp-includes/compat.php +++ b/wp-includes/compat.php @@ -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) ) ); + } +} + ?>