summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 54c3f50)
raw | patch | inline | side by side (parent: 54c3f50)
author | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 10 Mar 2008 16:47:59 +0000 (16:47 +0000) | ||
committer | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 10 Mar 2008 16:47:59 +0000 (16:47 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9623 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-core/include/functions.inc | patch | blob | history |
index d9f4661eb94d7314d154a77f9dd3bdb94e268cea..f37347fd32f96a7756442d1dd8e51b9b4381b429 100644 (file)
exit();
}
+
+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;
+}
+
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
?>