From 88888d3dc836d44ef3c32a8ba2ba44c5582741da Mon Sep 17 00:00:00 2001 From: Andre Lorbach Date: Mon, 28 Apr 2008 15:43:06 +0200 Subject: [PATCH] Special characters like german "umlaute" are now proberly replaced MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This means characters like ä will be replaced with ä for example. This works for the detail page and the index page --- src/details.php | 6 ++++-- src/include/functions_common.php | 6 ++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/details.php b/src/details.php index e51a45b..71261bb 100644 --- a/src/details.php +++ b/src/details.php @@ -247,8 +247,10 @@ if ( isset($content['Sources'][$currentSourceID]) ) // && $content['uid_current' } else if ( $content['fields'][$mycolkey]['FieldType'] == FILTER_TYPE_STRING ) { - // kindly copy! - $content['fields'][$mycolkey]['fieldvalue'] = $logArray[$mycolkey]; + if ( $mycolkey == SYSLOG_MESSAGE ) + $content['fields'][$mycolkey]['fieldvalue'] = GetStringWithHTMLCodes($logArray[$mycolkey]); + else // kindly copy! + $content['fields'][$mycolkey]['fieldvalue'] = $logArray[$mycolkey]; } // Increment helpcounter diff --git a/src/include/functions_common.php b/src/include/functions_common.php index 9df8945..136d249 100644 --- a/src/include/functions_common.php +++ b/src/include/functions_common.php @@ -519,10 +519,8 @@ function DieWithFriendlyErrorMsg( $szerrmsg ) function GetStringWithHTMLCodes($myStr) { - // First of all replace special characters with valid HTML representations! - $searchfor = array( "&", "<", ">" ); - $replacewith = array( "&", "<", ">" ); - return str_replace ( $searchfor, $replacewith, $myStr); + // Replace all special characters with valid html representations + return htmlentities($myStr); } function InitTemplateParser()