From 6e9c073b9082d6b9d96e1ef7aedecefc33b02eee Mon Sep 17 00:00:00 2001
From: ftimme <ft@falkotimme.com>
Date: Mon, 10 Oct 2011 06:14:12 -0400
Subject: [PATCH] - Fixed #1776.
---
interface/lib/classes/listform.inc.php | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/interface/lib/classes/listform.inc.php b/interface/lib/classes/listform.inc.php
index ffa37c1..a5843d6 100644
--- a/interface/lib/classes/listform.inc.php
+++ b/interface/lib/classes/listform.inc.php
@@ -282,7 +282,7 @@
public function decode($record)
{
global $conf, $app;
- if(is_array($record)) {
+ 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]));
--
Gitblit v1.9.1