Code

Udapted error reporting
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 28 Jun 2007 10:02:51 +0000 (10:02 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 28 Jun 2007 10:02:51 +0000 (10:02 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@6727 594d385d-05f5-0310-b6e9-bd551577e9d8

include/functions.inc
include/php_setup.inc

index 94164fbf81b40cbe1100dfb4786a2f5ef7ec507f..b6e07403a92ded65d5e59c297a95b0f6d9fb972b 100644 (file)
@@ -2454,14 +2454,13 @@ function get_base_from_hook($dn, $attrib)
 
 function prepare4mailbody($string)
 {
-  $string = html_entity_decode($string);
+  $string = urlencode(html_entity_decode($string));
 
-  $from = array("/\n/" , "/&/" ,"/(\'|\")/");
-  $to   = array("%0A"  , "%26" ,"%22");
+  $from = array("/\#/" , "/&/" ,"/(\'|\")/" ,"/\+/");
+  $to   = array("::"  , "%26" ,"%22" ," ");
 
   $string = preg_replace($from,$to,$string);
 
-  echo "<pre>".$string."</pre>";
   return($string);
 }
 
index f443562eb5378ada1172bbbf02ee2783e7f0f8ff..36cb482c08076fe1ead285e170c4a6ed265158e5 100644 (file)
@@ -71,9 +71,7 @@ function gosaRaiseError($errno, $errstr, $errfile, $errline)
                                 "GOsa bug report".
                                 "\nGOsa Version : ".get_gosa_version().
                                 "\nDate : ".date("H:i:s d.m.Y").
-                                "\n".
-                                "\nTrace : ".
-                                "\n");
+                                "\n\n");
 
     if (isset($_SESSION['js']) && $_SESSION['js']==FALSE){
       $error_collector= "<div>";
@@ -91,8 +89,8 @@ function gosaRaiseError($errno, $errstr, $errfile, $errline)
               <button onClick='toggle(\"errorbox\")'>".
                 _("Toggle information")."
               </button>
-              <a href=\"mailto:gosa-bugs@oss.gonicus.de?subject=GOsa%20bugreport&body=%BUGBODY%\">
-                <img src='images/mailto.png' title='"._("Send bug report to the GOsa Team")."' class='center'>&nbsp;"._("Send bugreport")."
+              <a href=\"mailto:gosa-bugs@oss.gonicus.de?subject=GOsa%20bugreport&amp;body=%BUGBODY%\">
+                <img src='images/mailto.png' title='"._("Send bug report to the GOsa Team")."' class='center' alt=''>&nbsp;"._("Send bugreport")."
               </a>
             </td>
           </tr>
@@ -104,12 +102,20 @@ function gosaRaiseError($errno, $errstr, $errfile, $errline)
   /* Create error header */
   $error_collector.= "<table summary=\"\" width=\"100%\" cellspacing=0 style='background-color:#402005;color:white;border:2px solid red'><tr><td colspan=3><h1 style='color:white'>"._("PHP error")." \"$errstr\"</h1></td></tr>";
   
+  $error_collector_mailto .= prepare4mailbody("=== Error === \n");
+  $error_collector_mailto .= prepare4mailbody("PHP error: $errstr ($errfile, line $errline)\n");
+  $error_collector_mailto .= prepare4mailbody("=== /Error === \n\n");
+
   /* Extract traceback data - if available */
   if (function_exists('debug_backtrace')){
     $trace= debug_backtrace();
 
+    $error_collector_mailto .= prepare4mailbody("=== Trace ===");
+
     /* Generate trace history */
     for ($index= 0; $index<count($trace); $index++){
+
+
       $ct= $trace[$index];
       $loc= "";
       if (isset($ct['class'])){
@@ -175,6 +181,7 @@ function gosaRaiseError($errno, $errstr, $errfile, $errline)
                                    "\n");
       }
   }
+  $error_collector_mailto .= prepare4mailbody("=== /Trace === \n");
 
   /* Close error table */
   $error_collector.= "</table>";