From c40802dc5b3e9f4368feb52b35fbfdf0e1908c4c Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 28 Jun 2007 10:02:51 +0000 Subject: [PATCH] Udapted error reporting git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@6727 594d385d-05f5-0310-b6e9-bd551577e9d8 --- include/functions.inc | 7 +++---- include/php_setup.inc | 17 ++++++++++++----- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/include/functions.inc b/include/functions.inc index 94164fbf8..b6e07403a 100644 --- a/include/functions.inc +++ b/include/functions.inc @@ -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 "
".$string."
"; return($string); } diff --git a/include/php_setup.inc b/include/php_setup.inc index f443562eb..36cb482c0 100644 --- a/include/php_setup.inc +++ b/include/php_setup.inc @@ -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= "
"; @@ -91,8 +89,8 @@ function gosaRaiseError($errno, $errstr, $errfile, $errline) - -  "._("Send bugreport")." + +  "._("Send bugreport")." @@ -104,12 +102,20 @@ function gosaRaiseError($errno, $errstr, $errfile, $errline) /* Create error header */ $error_collector.= ""; + $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

"._("PHP error")." \"$errstr\"