Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Jan 13, 2025
1 parent bdac8cf commit 015a33c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Illuminate/Cache/DatabaseStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,9 @@ protected function serialize($value)
{
$result = serialize($value);

if (($this->connection instanceof PostgresConnection || $this->connection instanceof SQLiteConnection) && str_contains($result, "\0")) {
if (($this->connection instanceof PostgresConnection ||
$this->connection instanceof SQLiteConnection) &&
str_contains($result, "\0")) {
$result = base64_encode($result);
}

Expand All @@ -503,7 +505,9 @@ protected function serialize($value)
*/
protected function unserialize($value)
{
if (($this->connection instanceof PostgresConnection || $this->connection instanceof SQLiteConnection) && ! Str::contains($value, [':', ';'])) {
if (($this->connection instanceof PostgresConnection ||
$this->connection instanceof SQLiteConnection) &&
! Str::contains($value, [':', ';'])) {
$value = base64_decode($value);
}

Expand Down

0 comments on commit 015a33c

Please sign in to comment.