summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0862b77)
raw | patch | inline | side by side (parent: 0862b77)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 11 Mar 2008 06:49:27 +0000 (06:49 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 11 Mar 2008 06:49:27 +0000 (06:49 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9627 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-core/include/functions.inc | patch | blob | history |
index f37347fd32f96a7756442d1dd8e51b9b4381b429..a8e8c29f05774f2ee21af840c47a2c6793baf3a7 100644 (file)
@@ -2703,25 +2703,14 @@ function send_binary_content($data,$name,$type = "application/octet-stream")
}
+/*! \brief Encode special string characters so we can use the string in \
+ HTML output, without breaking quotes.
+ @param The String we want to encode.
+ @return The encoded String
+*/
function xmlentities($str)
{
- static $asc2uni= array();
-
- if (!count($asc2uni)){
- for($i=128;$i<256;$i++){
- $asc2uni[chr($i)] = "&#x".dechex($i).";";
- }
- }
-
- $str = str_replace("&", "&", $str);
- $str = str_replace("<", "<", $str);
- $str = str_replace(">", ">", $str);
- $str = str_replace("'", "'", $str);
- $str = str_replace("\"", """, $str);
- $str = str_replace("\r", "", $str);
- $str = strtr($str,$asc2uni);
-
- return $str;
+ return (htmlentities($str,ENT_QUOTES));
}
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: