|
From: Bill S. <bi...@Sh...> - 2021-08-10 05:15:41
|
You were right. I commented out my two line patch in date.php getTimeStamp (so the errors would resume) and
added the preg_replace statements in imap_messages.php:
--- imap_messages.php.orig 2021-02-05 16:49:08.000000000 -0800
+++ imap_messages.php 2021-08-09 22:06:09.000000000 -0700
@@ -910,7 +910,8 @@
}
if (isset($date) || isset($internal_date)) {
if (isset($internal_date)) {
- $internal_date = str_replace(' ', ' ', $internal_date);
+ // $internal_date = str_replace(' ', ' ', $internal_date);
+ $internal_date = preg_replace('/\s+/', ' ', $internal_date);
$tmpinternal_date = explode(' ', trim($internal_date));
if (!isset($date)) {
$date = $internal_date;
@@ -918,7 +919,8 @@
}
}
if (isset($date)) {
- $date = str_replace(' ', ' ', $date);
+ // $date = str_replace(' ', ' ', $date);
+ $date = preg_replace('/\s+/', ' ', $date);
$tmpdate = explode(' ', trim($date));
if (!isset($internal_date)) {
$internal_date = $date;
@@ -928,6 +930,7 @@
} else {
$internal_date = $tmpinternal_date = $tmpdate = $date = array();
}
+// if ($username == 'kermit') sm_print_r($internal_date, $date, '==========');
if ($uid_support) {
$msgi ="$unique_id";
$messages[$msgi]['ID'] = $unique_id;
Some of the strings did have multiple spaces between words. No errors now.
Bill
On 8/9/2021 6:33 PM, Paul Lesniewski wrote:
> Bill,
>
> We need to see the origin of the problem, which in this case might be a
> strange date string from the IMAP server and/or in a date header. Your
> best place to debug is in functions/imap_messages.php around line 911.
> Can try doing:
> sm_print_r($internal_date, $date, '==========');
> And you can make it conditional on the username if you know who is having
> the trouble.
>
> There are two lines with str_replace(' ', ' ', $internal_date); just
> below that which may need to be changed to use a regex:
> preg_replace('/\s+/', ' ', $internal_date);
>
> You can also use the info plugin and test some of your IMAP server responses.
>
|