Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Decodes data encoded with MIME base64
<?php base64_decode(string $string, bool $strict = false): string|false
<?php $key = $this->app['config']['app.key'];
if (str_starts_with($key, 'base64:')) {
$key = base64_decode(substr($key, 7));
}
$connection = $config['connection'] ?? null;
<?php {
if ($this->connection instanceof PostgresConnection &&
! Str::contains($serialized, [':', ';'])) {
$serialized = base64_decode($serialized);
}
try {
<?php protected function unserialize($value)
{
if ($this->connection instanceof PostgresConnection && ! Str::contains($value, [':', ';'])) {
$value = base64_decode($value);
}
return unserialize($value);
<?php {
$payload = $this->getJsonPayload($payload);
$iv = base64_decode($payload['iv']);
$this->ensureTagIsValid(
$tag = empty($payload['tag']) ? null : base64_decode($payload['tag'])
<?php $iv = base64_decode($payload['iv']);
$this->ensureTagIsValid(
$tag = empty($payload['tag']) ? null : base64_decode($payload['tag'])
);
$foundValidMac = false;
<?php throw new DecryptException('The payload is invalid.');
}
$payload = json_decode(base64_decode($payload), true);
<?php return false;
}
return strlen(base64_decode($payload['iv'], true)) === openssl_cipher_iv_length(strtolower($this->cipher));
}
<?php protected function parseKey(array $config)
{
if (Str::startsWith($key = $this->key($config), $prefix = 'base64:')) {
$key = base64_decode(Str::after($key, $prefix));
}
return $key;
<?php protected function parseKey(string $key)
{
if (Str::startsWith($key, $prefix = 'base64:')) {
$key = base64_decode(Str::after($key, $prefix));
}
return $key;
<?php protected function parseKey(string $key)
{
if (Str::startsWith($key, $prefix = 'base64:')) {
$key = base64_decode(Str::after($key, $prefix));
}
return $key;
<?php public static function isValid(string $cookie, string $key)
{
$payload = json_decode(base64_decode($cookie), true);
return is_array($payload) &&
is_numeric($payload['expires_at'] ?? null) &&
<?php $this->sent = $data['sent'];
$this->data = (($data['hasAttachments'] ?? false) === true)
? unserialize(base64_decode($data['data']))
: $data['data'];
}
<?php {
$hasAttachments = ($data['hasAttachments'] ?? false) === true;
$this->sentMessage = $hasAttachments ? unserialize(base64_decode($data['sentMessage'])) : $data['sentMessage'];
}
}
<?php return null;
}
$parameters = json_decode(base64_decode(str_replace(['-', '_'], ['+', '/'], $encodedString)), true);
if (json_last_error() !== JSON_ERROR_NONE) {
return null;
<?php if (isset($session->payload)) {
$this->exists = true;
return base64_decode($session->payload);
}
return '';