Code

Moved function "prepare4mailbody" from 'functions.inc'
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 19 Dec 2007 13:37:38 +0000 (13:37 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 19 Dec 2007 13:37:38 +0000 (13:37 +0000)
to  'php_setup'  to avoid, messages like that 'Fatal error: Call to undefined function prepare4mailbody() in  /usr/share/gosa/include/php_setup.inc on line 132'

git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@8150 594d385d-05f5-0310-b6e9-bd551577e9d8

include/functions.inc
include/php_setup.inc

index e46df87dc7a07c11b7368d555570b5ee383e7344..e83805413ea93da35bb4f1171bef0653a685d113 100644 (file)
@@ -2480,48 +2480,6 @@ function get_base_from_hook($dn, $attrib)
   }
 
 
-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",
-                "%38",
-                "%28",
-                "%29",
-                "%22");
-
-  $string = preg_replace($from,$to,$string);
-
-  return($string);
-}
 
 
 function mac2company($mac)
index 3ad89e47e3a41a94f2f5930a668f0869771284b7..8260e9593c8f680621dc26a0e333be6c6b6c03b2 100644 (file)
@@ -222,6 +222,50 @@ 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",
+                "%38",
+                "%28",
+                "%29",
+                "%22");
+
+  $string = preg_replace($from,$to,$string);
+
+  return($string);
+}
+
+
 function dummy_error_handler()
 {
 }