Skip to content

Commit

Permalink
Merge tag v2.1.46 into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
roadiz-ci committed Sep 28, 2023
1 parent fff2c93 commit 570d58f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/AbstractDocumentFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ public function updateDocument(DocumentInterface $document): DocumentInterface
}
}

$document->setFolder(substr(hash("crc32b", date('YmdHi')), 0, 12));
$document->setFolder(\mb_substr(hash("crc32b", date('YmdHi')), 0, 12));
}

$document->setFilename($this->getFileName());
Expand Down
2 changes: 1 addition & 1 deletion src/Models/DocumentTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ public function isEmbed(): bool

protected function initDocumentTrait(): void
{
$this->setFolder(substr(hash("crc32b", date('YmdHi')), 0, 12));
$this->setFolder(\mb_substr(hash("crc32b", date('YmdHi')), 0, 12));
}

#[
Expand Down
2 changes: 1 addition & 1 deletion src/TwigExtension/DocumentExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public function getFilters(): array
public function formatBytes($bytes, int $precision = 2): string
{
$size = ['B','kB','MB','GB','TB','PB','EB','ZB','YB'];
$factor = floor((strlen((string) $bytes) - 1) / 3);
$factor = floor((\mb_strlen((string) $bytes) - 1) / 3);
return sprintf("%.{$precision}f", (int) $bytes / pow(1024, $factor)) . @$size[$factor];
}

Expand Down

0 comments on commit 570d58f

Please sign in to comment.