Skip to content

Commit

Permalink
Merge pull request #25 from whitedigital-eu/fix/check-data-type
Browse files Browse the repository at this point in the history
fix: concat only if url is scalar
  • Loading branch information
acirulis authored Mar 20, 2023
2 parents b37710d + 3940635 commit ad81352
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Service/AuditService.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
use function class_implements;
use function implode;
use function in_array;
use function is_scalar;
use function mb_strimwidth;
use function method_exists;
use function rtrim;
Expand Down Expand Up @@ -94,8 +95,8 @@ public function audit(string $type, string $message, array $data = [], string $c
$this->validateType($type);

$location = '';
if (null !== ($data['url'] ?? null)) {
$location = ' ' . $data['url'];
if (null !== ($url = $data['url'] ?? null) && is_scalar($url)) {
$location = ' ' . $url;
}

if (!in_array(AuditEntityInterface::class, class_implements($class), true)) {
Expand Down

0 comments on commit ad81352

Please sign in to comment.