This commit has been accessed 556 times via Git panel.
commit 36612ea51e4e7c823b0e3bcfd771df9d1fa5d521
tree 9086094ba175c2554ae6eb15af25e2086d865092
parent 9a29f73f2de3c4e63e9b27e62de171066c4ec06e
author Engels Antonio <engels@majcms.org> 1347821113 +0800
committer Engels Antonio <engels@majcms.org> 1347821113 +0800
Add Date: header check
diff --git a/inbox.php b/inbox.php
index 0eb0535..65403c5 100644
--- a/inbox.php
+++ b/inbox.php
@@ -132,10 +132,16 @@ foreach ($mbox_sort as $mbox_num => $mbox_row) {
}
$date = $val[0]->date;
- $date = preg_replace("/\([^\)]+\)/","",$date);
- $date = trim($date);
- $date = strtotime($date);
- $date = time_elapsed_string($date);
+
+ if (strlen($date) > 0) {
+ $date = preg_replace("/\([^\)]+\)/","",$date);
+ $date = trim($date);
+ $date = strtotime($date);
+ $date = time_elapsed_string($date) . " ago";
+ }
+ else {
+ $date = "no date";
+ }
$size = HumanReadableFilesize($size);
@@ -212,7 +218,7 @@ foreach ($mbox_sort as $mbox_num => $mbox_row) {
echo "<td>$subj</td>";
- echo "<td align=\"center\"><nobr>$date ago</nobr></td>";
+ echo "<td align=\"center\"><nobr>$date</nobr></td>";
echo "<td align=\"right\"><nobr>$size</nobr></td>";
echo "<form method=\"post\"><td align=\"center\">";
diff --git a/read.php b/read.php
index a316948..1076511 100644
--- a/read.php
+++ b/read.php
@@ -145,7 +145,12 @@ if (isset($_POST['msg']) and !empty($_POST['msg']) and is_numeric($_POST['msg'])
echo "<br>Bcc: $header_bccaddress";
}
- echo "<br>Date: $header_date ($header_date_age ago)";
+ if (strlen($header_date) > 0) {
+ echo "<br>Date: $header_date ($header_date_age ago)";
+ }
+ else {
+ echo "<br>Date: <font color=\"red\">Missing! Sender is non-standards compliant or message is probably spam.</font>";
+ }
if ($header_mailer != "") {
echo "<br>$header_mailer";
tree 9086094ba175c2554ae6eb15af25e2086d865092
parent 9a29f73f2de3c4e63e9b27e62de171066c4ec06e
author Engels Antonio <engels@majcms.org> 1347821113 +0800
committer Engels Antonio <engels@majcms.org> 1347821113 +0800
Add Date: header check
diff --git a/inbox.php b/inbox.php
index 0eb0535..65403c5 100644
--- a/inbox.php
+++ b/inbox.php
@@ -132,10 +132,16 @@ foreach ($mbox_sort as $mbox_num => $mbox_row) {
}
$date = $val[0]->date;
- $date = preg_replace("/\([^\)]+\)/","",$date);
- $date = trim($date);
- $date = strtotime($date);
- $date = time_elapsed_string($date);
+
+ if (strlen($date) > 0) {
+ $date = preg_replace("/\([^\)]+\)/","",$date);
+ $date = trim($date);
+ $date = strtotime($date);
+ $date = time_elapsed_string($date) . " ago";
+ }
+ else {
+ $date = "no date";
+ }
$size = HumanReadableFilesize($size);
@@ -212,7 +218,7 @@ foreach ($mbox_sort as $mbox_num => $mbox_row) {
echo "<td>$subj</td>";
- echo "<td align=\"center\"><nobr>$date ago</nobr></td>";
+ echo "<td align=\"center\"><nobr>$date</nobr></td>";
echo "<td align=\"right\"><nobr>$size</nobr></td>";
echo "<form method=\"post\"><td align=\"center\">";
diff --git a/read.php b/read.php
index a316948..1076511 100644
--- a/read.php
+++ b/read.php
@@ -145,7 +145,12 @@ if (isset($_POST['msg']) and !empty($_POST['msg']) and is_numeric($_POST['msg'])
echo "<br>Bcc: $header_bccaddress";
}
- echo "<br>Date: $header_date ($header_date_age ago)";
+ if (strlen($header_date) > 0) {
+ echo "<br>Date: $header_date ($header_date_age ago)";
+ }
+ else {
+ echo "<br>Date: <font color=\"red\">Missing! Sender is non-standards compliant or message is probably spam.</font>";
+ }
if ($header_mailer != "") {
echo "<br>$header_mailer";