From dc0389bb93081b0a4fd738aa6a323aeb136dbab4 Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 18 Jun 2008 09:43:59 +0000 Subject: [PATCH] Added recursive htmlentities. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11356 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/include/functions.inc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/gosa-core/include/functions.inc b/gosa-core/include/functions.inc index ab153dd0a..102bc4f65 100644 --- a/gosa-core/include/functions.inc +++ b/gosa-core/include/functions.inc @@ -2707,6 +2707,19 @@ function send_binary_content($data,$name,$type = "application/octet-stream") } +function reverse_html_entities($str,$type = ENT_QUOTES , $charset = "UTF-8") +{ + if(is_string($str)){ + return(htmlentities($str,$type,$charset)); + }elseif(is_array($str)){ + foreach($str as $name => $value){ + $str[$name] = reverse_html_entities($value,$type,$charset); + } + } + return($str); +} + + /*! \brief Encode special string characters so we can use the string in \ HTML output, without breaking quotes. @param The String we want to encode. -- 2.30.2