Skip to content

Commit 99439ed

Browse files
Update Assets.php
1 parent 830adb5 commit 99439ed

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Assets.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,8 @@ public function addStyles($assets)
106106
public function addStylesDirectly($assets)
107107
{
108108
foreach ((array)$assets as &$item) {
109+
$item = ltrim(trim($item), '/');
110+
109111
if (!in_array($item, $this->appendedStyles)) {
110112
$this->appendedStyles[$item] = [
111113
'src' => $item,
@@ -127,6 +129,8 @@ public function addStylesDirectly($assets)
127129
public function addScriptsDirectly($assets, $location = self::ASSETS_SCRIPT_POSITION_FOOTER)
128130
{
129131
foreach ((array)$assets as &$item) {
132+
$item = ltrim(trim($item), '/');
133+
130134
if (!in_array($item, $this->appendedScripts[$location])) {
131135
$this->appendedScripts[$location][$item] = [
132136
'src' => $item,

0 commit comments

Comments
 (0)