Skip to content
Snippets Groups Projects
Commit 5b9271cf authored by Demian Katz's avatar Demian Katz
Browse files

Bug fix: do not modify src if src is unset.

parent aeea6124
No related merge requests found
...@@ -52,13 +52,15 @@ class HeadScript extends \Zend\View\Helper\HeadScript ...@@ -52,13 +52,15 @@ class HeadScript extends \Zend\View\Helper\HeadScript
public function itemToString($item, $indent, $escapeStart, $escapeEnd) public function itemToString($item, $indent, $escapeStart, $escapeEnd)
{ {
// Normalize href to account for themes: // Normalize href to account for themes:
$relPath = 'js/' . $item->attributes['src']; if (!empty($item->attributes['src'])) {
$currentTheme = ThemeTools::findContainingTheme($relPath); $relPath = 'js/' . $item->attributes['src'];
$currentTheme = ThemeTools::findContainingTheme($relPath);
if (!empty($currentTheme)) { if (!empty($currentTheme)) {
$urlHelper = $this->getView()->plugin('url'); $urlHelper = $this->getView()->plugin('url');
$item->attributes['src'] $item->attributes['src']
= $urlHelper('home') . "themes/$currentTheme/" . $relPath; = $urlHelper('home') . "themes/$currentTheme/" . $relPath;
}
} }
return parent::itemToString($item, $indent, $escapeStart, $escapeEnd); return parent::itemToString($item, $indent, $escapeStart, $escapeEnd);
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment