Code

Removed class_location.inc
[gosa.git] / gosa-core / include / php_setup.inc
index 2901f8d2a6675e6a9109bcd967bc43111b21ddc3..62ffba9bd6f30715b5c3a73dd193c6a3cd7d8c76 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()
 {
 }
@@ -228,7 +266,7 @@ ini_set("register_globals",0);
 ini_set("track_vars",1);
 ini_set("display_errors",1);
 ini_set("report_memleaks",1);
-ini_set("include_path",".:$BASE_DIR/include:$BASE_DIR/include/php_writeexcel");
+ini_set("include_path",".:$BASE_DIR/include:$BASE_DIR/include/utils/excel");
 
 /* Do smarty setup */
 require("smarty/Smarty.class.php");