mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-04 06:57:03 +03:00
Fixes a search for non-ascii strings (#793)
This commit is contained in:
parent
106ee26ad2
commit
2a7d8ccab8
2 changed files with 70 additions and 8 deletions
|
|
@ -967,8 +967,10 @@ class MailClient
|
|||
*/
|
||||
private function escapeSearchString($sSearch, $bDetectGmail = true)
|
||||
{
|
||||
return ($bDetectGmail && !\MailSo\Base\Utils::IsAscii($sSearch) && $this->IsGmail())
|
||||
? '{'.\strlen($sSearch).'+}'."\r\n".$sSearch : $this->oImapClient->EscapeString($sSearch);
|
||||
return !\MailSo\Base\Utils::IsAscii($sSearch)
|
||||
? '{'.\strlen($sSearch).'}'."\r\n".$sSearch : $this->oImapClient->EscapeString($sSearch);
|
||||
// return ($bDetectGmail && !\MailSo\Base\Utils::IsAscii($sSearch) && $this->IsGmail())
|
||||
// ? '{'.\strlen($sSearch).'+}'."\r\n".$sSearch : $this->oImapClient->EscapeString($sSearch);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1396,7 +1398,7 @@ class MailClient
|
|||
}
|
||||
|
||||
$sCriteriasResult = \trim($sCriteriasResult);
|
||||
$sCriteriasResult .= ' NOT DELETED';
|
||||
$sCriteriasResult .= ' UNDELETED';
|
||||
|
||||
$sFilter = \trim($sFilter);
|
||||
if ('' !== $sFilter)
|
||||
|
|
@ -1832,7 +1834,7 @@ class MailClient
|
|||
{
|
||||
$aResultUids = $bUseSortIfSupported ?
|
||||
$this->oImapClient->MessageSimpleSort(array('REVERSE ARRIVAL'), $sSearchCriterias, true) :
|
||||
$this->oImapClient->MessageSimpleSearch($sSearchCriterias, true)
|
||||
$this->oImapClient->MessageSimpleSearch($sSearchCriterias, true, \MailSo\Base\Utils::IsAscii($sSearchCriterias) ? '' : 'UTF-8')
|
||||
;
|
||||
|
||||
if (!$bUidsFromCacher && $bUseCacheAfterSearch && \is_array($aResultUids) && $oCacher && $oCacher->IsInited() && 0 < \strlen($sSerializedHash))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue