Skip to content

Commit

Permalink
php 8.1 deprecations (#494)
Browse files Browse the repository at this point in the history
* php 8.1 deprecations

* php 8.1 deprecations

* Update DataFormatter.php
  • Loading branch information
alikon authored Dec 27, 2021
1 parent d7a9c22 commit 0d44b75
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/DebugBar/JavascriptRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -789,6 +789,8 @@ protected function makeUriRelativeTo($uri, $root)
return $uris;
}

$uri = $uri ?? '';

if (substr($uri, 0, 1) === '/' || preg_match('/^([a-zA-Z]+:\/\/|[a-zA-Z]:\/|[a-zA-Z]:\\\)/', $uri)) {
return $uri;
}
Expand All @@ -805,7 +807,7 @@ protected function makeUriRelativeTo($uri, $root)
protected function filterAssetArray($array, $type = '')
{
$types = array('css', 'js', 'inline_css', 'inline_js', 'inline_head');
$typeIndex = array_search(strtolower($type), $types);
$typeIndex = array_search(strtolower($type ?? ''), $types);
return $typeIndex !== false ? $array[$typeIndex] : $array;
}

Expand Down

0 comments on commit 0d44b75

Please sign in to comment.