mirror of
https://github.com/the-djmaze/snappymail.git
synced 2024-09-20 15:45:55 +08:00
Bugfix: Contacts.js trim() missing
Bugfix: ClearCookie failed
This commit is contained in:
parent
d88855ebd9
commit
b185402ae7
|
@ -20,7 +20,7 @@ import { emailArrayFromJson, emailArrayToStringClear, emailArrayToString, replyH
|
|||
import { AttachmentModel, staticCombinedIconClass } from 'Model/Attachment';
|
||||
import { AbstractModel } from 'Knoin/AbstractModel';
|
||||
|
||||
const $ = jQuery;
|
||||
const $ = jQuery, isArray = Array.isArray;
|
||||
|
||||
class MessageModel extends AbstractModel {
|
||||
constructor() {
|
||||
|
@ -259,7 +259,7 @@ class MessageModel extends AbstractModel {
|
|||
this.unsubsribeLinks = isNonEmptyArray(json.UnsubsribeLinks) ? json.UnsubsribeLinks : [];
|
||||
|
||||
this.subject(json.Subject);
|
||||
if (Array.isArray(json.SubjectParts)) {
|
||||
if (isArray(json.SubjectParts)) {
|
||||
this.subjectPrefix(json.SubjectParts[0]);
|
||||
this.subjectSuffix(json.SubjectParts[1]);
|
||||
} else {
|
||||
|
@ -269,14 +269,14 @@ class MessageModel extends AbstractModel {
|
|||
|
||||
this.dateTimeStampInUTC(pInt(json.DateTimeStampInUTC));
|
||||
this.hasAttachments(!!json.HasAttachments);
|
||||
this.attachmentsSpecData(Array.isArray(json.AttachmentsSpecData) ? json.AttachmentsSpecData : []);
|
||||
this.attachmentsSpecData(isArray(json.AttachmentsSpecData) ? json.AttachmentsSpecData : []);
|
||||
|
||||
this.fromEmailString(emailArrayToString(this.from, true));
|
||||
this.fromClearEmailString(emailArrayToStringClear(this.from));
|
||||
this.toEmailsString(emailArrayToString(this.to, true));
|
||||
this.toClearEmailsString(emailArrayToStringClear(this.to));
|
||||
|
||||
this.threads(Array.isArray(json.Threads) ? json.Threads : []);
|
||||
this.threads(isArray(json.Threads) ? json.Threads : []);
|
||||
|
||||
this.initFlagsByJson(json);
|
||||
this.computeSenderEmail();
|
||||
|
@ -315,9 +315,9 @@ class MessageModel extends AbstractModel {
|
|||
}
|
||||
|
||||
this.hasAttachments(!!json.HasAttachments);
|
||||
this.attachmentsSpecData(Array.isArray(json.AttachmentsSpecData) ? json.AttachmentsSpecData : []);
|
||||
this.attachmentsSpecData(isArray(json.AttachmentsSpecData) ? json.AttachmentsSpecData : []);
|
||||
|
||||
this.foundedCIDs = Array.isArray(json.FoundedCIDs) ? json.FoundedCIDs : [];
|
||||
this.foundedCIDs = isArray(json.FoundedCIDs) ? json.FoundedCIDs : [];
|
||||
this.attachments(this.initAttachmentsFromJson(json.Attachments));
|
||||
|
||||
this.readReceipt(json.ReadReceipt || '');
|
||||
|
@ -539,7 +539,7 @@ class MessageModel extends AbstractModel {
|
|||
* @returns {string}
|
||||
*/
|
||||
fromAsSingleEmail() {
|
||||
return Array.isArray(this.from) && this.from[0] ? this.from[0].email : '';
|
||||
return isArray(this.from) && this.from[0] ? this.from[0].email : '';
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -13,7 +13,6 @@ import {
|
|||
import {
|
||||
delegateRunOnDestroy,
|
||||
computedPagenatorHelper,
|
||||
trim,
|
||||
isNonEmptyArray,
|
||||
fakeMd5,
|
||||
pInt
|
||||
|
@ -42,6 +41,8 @@ import { getApp } from 'Helper/Apps/User';
|
|||
import { popup, command, showScreenPopup, hideScreenPopup, routeOn, routeOff } from 'Knoin/Knoin';
|
||||
import { AbstractViewNext } from 'Knoin/AbstractViewNext';
|
||||
|
||||
const trim = text => null == text ? "" : (text + "").trim();
|
||||
|
||||
@popup({
|
||||
name: 'View/Popup/Contacts',
|
||||
templateID: 'PopupsContacts'
|
||||
|
|
|
@ -378,7 +378,7 @@ class Utils
|
|||
if (null === $sPath)
|
||||
{
|
||||
$sPath = static::$CookieDefaultPath;
|
||||
$sPath = $sPath && 0 < \strlen($sPath) ? $sPath : null;
|
||||
$sPath = $sPath && 0 < \strlen($sPath) ? $sPath : '/';
|
||||
}
|
||||
|
||||
if (null === $bSecure)
|
||||
|
@ -390,7 +390,7 @@ class Utils
|
|||
\setcookie($sName, $sValue, array(
|
||||
'expires' => $iExpire,
|
||||
'path' => $sPath,
|
||||
'domain' => $sDomain,
|
||||
// 'domain' => $sDomain,
|
||||
'secure' => $bSecure,
|
||||
'httponly' => $bHttpOnly,
|
||||
'samesite' => 'Strict'
|
||||
|
@ -405,10 +405,16 @@ class Utils
|
|||
}
|
||||
|
||||
$sPath = static::$CookieDefaultPath;
|
||||
$sPath = $sPath && 0 < \strlen($sPath) ? $sPath : null;
|
||||
|
||||
unset(static::$Cookies[$sName]);
|
||||
\setcookie($sName, '', \time() - 3600 * 24 * 30, $sPath);
|
||||
\setcookie($sName, '', array(
|
||||
'expires' => \time() - 3600 * 24 * 30,
|
||||
'path' => $sPath && 0 < \strlen($sPath) ? $sPath : '/',
|
||||
// 'domain' => null,
|
||||
'secure' => static::$CookieDefaultSecure,
|
||||
'httponly' => true,
|
||||
'samesite' => 'Strict'
|
||||
));
|
||||
}
|
||||
|
||||
public static function UrlEncode(string $sV, bool $bEncode = false) : string
|
||||
|
|
Loading…
Reference in a new issue