Use Actions()->decodeRawKey()

This commit is contained in:
the-djmaze 2023-03-28 10:02:22 +02:00
parent 3819311a6d
commit 9a4da9d7f0
2 changed files with 3 additions and 6 deletions

View file

@ -1087,7 +1087,7 @@ class Actions
return \MailSo\Base\Utils::UrlSafeBase64Encode(\json_encode($aValues));
}
protected function decodeRawKey(string $sRawKey): array
public function decodeRawKey(string $sRawKey): array
{
return empty($sRawKey) ? []
: (\json_decode(\MailSo\Base\Utils::UrlSafeBase64Decode($sRawKey), true) ?: []);

View file

@ -23,8 +23,7 @@ trait Messages
// throw new ClientException(Notifications::CantGetMessageList);
$oParams = new \MailSo\Mail\MessageListParams;
$sRawKey = $this->GetActionParam('RawKey', '');
$aValues = $sRawKey ? \json_decode(\MailSo\Base\Utils::UrlSafeBase64Decode($sRawKey), true) : null;
$aValues = $this->decodeRawKey($this->GetActionParam('RawKey', ''));
$sHash = '';
if ($aValues && 6 < \count($aValues)) {
// GET
@ -404,9 +403,7 @@ trait Messages
*/
public function DoMessage() : array
{
$sRawKey = (string) $this->GetActionParam('RawKey', '');
$aValues = \json_decode(\MailSo\Base\Utils::UrlSafeBase64Decode($sRawKey), true);
$aValues = $this->decodeRawKey((string) $this->GetActionParam('RawKey', ''));
if ($aValues && 2 <= \count($aValues)) {
$sFolder = (string) $aValues[0];
$iUid = (int) $aValues[1];