From 255dcdb94ece8f37df700b8a144bcd4ff1194815 Mon Sep 17 00:00:00 2001
From: tbrehm <t.brehm@ispconfig.org>
Date: Thu, 20 Oct 2011 07:47:29 -0400
Subject: [PATCH] Fixed: FS#1777 - AWStats: In months with two digits (10, 11, 12) order is broken => 1,10,11,12,2,3...9
---
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