From eb0e12027eecd83c7f573b19cd7b4204ffa208ce Mon Sep 17 00:00:00 2001
From: latham <latham@ispconfig3>
Date: Fri, 04 Nov 2011 09:52:57 -0400
Subject: [PATCH] Special Char issues with logs.  I really think I have submitted this one fix several times.

---
 interface/lib/classes/listform.inc.php |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/interface/lib/classes/listform.inc.php b/interface/lib/classes/listform.inc.php
index 66b952e..a5843d6 100644
--- a/interface/lib/classes/listform.inc.php
+++ b/interface/lib/classes/listform.inc.php
@@ -281,8 +281,8 @@
 
     public function decode($record) 
     {
-        global $conf;
-        if(is_array($record)) {
+        global $conf, $app;
+        if(is_array($record) && count($record) > 0) {
             foreach($this->listDef['item'] as $field){
                 $key = $field['field'];
 				if(isset($record[$key])) {
@@ -295,7 +295,7 @@
                     case 'DATETSTAMP':
                         if ($record[$key] > 0) {
 							// is value int?
-							if (ereg("^[0-9]+[.]?[0-9]*$", $record[$key], $p)) {
+							if (preg_match("/^[0-9]+[.]?[0-9]*$/", $record[$key], $p)) {
 	                        	$record[$key] = date($this->lng('conf_format_dateshort'), $record[$key]);
 							} else {
 	                        	$record[$key] = date($this->lng('conf_format_dateshort'), strtotime($record[$key]));
@@ -305,7 +305,7 @@
 					case 'DATE':
                         if ($record[$key] > 0) {
 							// is value int?
-							if (ereg("^[0-9]+[.]?[0-9]*$", $record[$key], $p)) {
+							if (preg_match("/^[0-9]+[.]?[0-9]*$/", $record[$key], $p)) {
 	                        	$record[$key] = date($this->lng('conf_format_dateshort'), $record[$key]);
 							} else {
 	                        	$record[$key] = date($this->lng('conf_format_dateshort'), strtotime($record[$key]));
@@ -316,7 +316,7 @@
                     case 'DATETIME':
                         if ($record[$key] > 0) {
 							// is value int?
-							if (ereg("^[0-9]+[.]?[0-9]*$", $record[$key], $p)) {
+							if (preg_match("/^[0-9]+[.]?[0-9]*$/", $record[$key], $p)) {
 	                        	$record[$key] = date($this->lng('conf_format_datetime'), $record[$key]);
 							} else {
 	                        	$record[$key] = date($this->lng('conf_format_datetime'), strtotime($record[$key]));
@@ -333,7 +333,7 @@
                         break;
 
                     case 'CURRENCY':
-                        $record[$key] = number_format($record[$key], 2, ',', '');
+                        $record[$key] = $app->functions->currency_format($record[$key]);
                         break;
 
                     default:

--
Gitblit v1.9.1