Skip to content

Commit

Permalink
Fixed an unserialize warning for ArrayStorage in PHP 8.3.
Browse files Browse the repository at this point in the history
  • Loading branch information
parpalak committed Nov 22, 2023
1 parent 8cb655e commit 1e92c83
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/S2/Rose/Storage/File/SingleFileArrayStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function load(bool $isDebug = false): array
}

$end = strpos($data, "\n");
$myData = substr($data, 8, $end);
$myData = substr($data, 8, $end - 8);
$data = substr($data, $end + 1);
$unserializeOptions = ['allowed_classes' => [
\DateTime::class,
Expand All @@ -61,17 +61,17 @@ public function load(bool $isDebug = false): array
$this->fulltextProxy->setFulltextIndex(unserialize($myData, $unserializeOptions) ?: []);

$end = strpos($data, "\n");
$myData = substr($data, 8, $end);
$myData = substr($data, 8, $end - 8);
$data = substr($data, $end + 1);
$this->excludedWords = unserialize($myData, $unserializeOptions) ?: [];

$end = strpos($data, "\n");
$myData = substr($data, 8, $end);
$myData = substr($data, 8, $end - 8);
$data = substr($data, $end + 1);
$this->metadata = unserialize($myData, $unserializeOptions) ?: [];

$end = strpos($data, "\n");
$myData = substr($data, 8, $end);
$myData = substr($data, 8, $end - 8);
// $data = substr($data, $end + 1);
$this->toc = unserialize($myData, $unserializeOptions) ?: [];

Expand Down

0 comments on commit 1e92c83

Please sign in to comment.