diff --git a/dev/Model/Message.js b/dev/Model/Message.js index 13faaa70d..f89e1b550 100644 --- a/dev/Model/Message.js +++ b/dev/Model/Message.js @@ -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 : ''; } /** diff --git a/dev/View/Popup/Contacts.js b/dev/View/Popup/Contacts.js index 02c7fe17b..7d0524459 100644 --- a/dev/View/Popup/Contacts.js +++ b/dev/View/Popup/Contacts.js @@ -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' diff --git a/rainloop/v/0.0.0/app/libraries/RainLoop/Utils.php b/rainloop/v/0.0.0/app/libraries/RainLoop/Utils.php index 3d066cb23..629744119 100644 --- a/rainloop/v/0.0.0/app/libraries/RainLoop/Utils.php +++ b/rainloop/v/0.0.0/app/libraries/RainLoop/Utils.php @@ -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