Code

Synced strings
[gosa.git] / gosa-core / include / php_setup.inc
index 2901f8d2a6675e6a9109bcd967bc43111b21ddc3..f50097ec8c81ca59108e7cd5cc5f747edaf566db 100644 (file)
@@ -79,7 +79,7 @@ function gosaRaiseError($errno, $errstr, $errfile, $errline)
                                 "*** PHP error information ***\n\n");
       }
     
-    if (isset($_SESSION['js']) && $_SESSION['js']==FALSE){
+    if (session::is_set('js') && session::get('js')==FALSE){
       $error_collector= "<div>";
     } else {
       $error_collector= "
@@ -205,6 +205,44 @@ function gosaRaiseError($errno, $errstr, $errfile, $errline)
 }
 
 
+function prepare4mailbody($string)
+{
+  $string = html_entity_decode($string);
+
+  $from = array(
+                "/%/",
+                "/ /",
+                "/\n/",
+                "/\r/",
+                "/!/",
+                "/#/",
+                "/\*/",
+                "/\//",
+                "/</",
+                "/>/",
+                "/\?/",
+                "/\"/");
+
+  $to = array(
+                "%25",
+                "%20",
+                "%0A",
+                "%0D",
+                "%21",
+                "%23",
+                "%2A",
+                "%2F",
+                "%3C",
+                "%3E",
+                "%3F",
+                "%22");
+
+  $string = preg_replace($from,$to,$string);
+
+  return($string);
+}
+
+
 function dummy_error_handler()
 {
 }