Skip to content

Commit

Permalink
Allow to disable quotes around SINCE date in IMAP search query via AP…
Browse files Browse the repository at this point in the history
…P_SINCE_WITHOUT_QUOTES_ON_FETCHING env parameter - closes #4175
  • Loading branch information
freescout-help-desk committed Aug 16, 2024
1 parent b33fb5e commit dff234f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
9 changes: 9 additions & 0 deletions config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,15 @@
*/
'use_mail_date_on_fetching' => env('APP_USE_MAIL_DATE_ON_FETCHING', false),

/*
|--------------------------------------------------------------------------
| Don't add quotes around date in the SINCE IMAP instruction on fetching.
| https://github.com/freescout-help-desk/freescout/issues/4175
|
|-------------------------------------------------------------------------
*/
'since_without_quotes_on_fetching' => env('APP_SINCE_WITHOUT_QUOTES_ON_FETCHING', false),

/*
|--------------------------------------------------------------------------
| Dashboard path.
Expand Down
5 changes: 4 additions & 1 deletion overrides/webklex/php-imap/src/Query/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,10 @@ public function generate_query(): string {
} else {
if (is_numeric($statement[1])) {
$query .= $statement[0] . ' ' . $statement[1];
} else if ($statement[0] == 'SINCE' && preg_match("#^[0-9]\-[a-zA-Z]\-[0-9]$#", $statement[1])) {
} else if ($statement[0] == 'SINCE'
//&& preg_match("#^[0-9]\-[a-zA-Z]\-[0-9]$#", $statement[1])
&& config('app.since_without_quotes_on_fetching')
) {
// https://github.com/freescout-help-desk/freescout/issues/4175
$query .= $statement[0] . ' ' . $statement[1];
} else {
Expand Down

0 comments on commit dff234f

Please sign in to comment.