Skip to content

Commit

Permalink
fix: empty string leads to empty filename
Browse files Browse the repository at this point in the history
  • Loading branch information
BernhardBaumrock committed Jun 7, 2023
1 parent 14b9b10 commit f929762
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions RockFrontend.module.php
Original file line number Diff line number Diff line change
Expand Up @@ -1757,6 +1757,8 @@ public function seo()
*/
public function scripts($name = 'main')
{
$name = trim($name);
if (!$name) $name = 'main';
if (!$this->scripts) $this->scripts = new WireData();
$script = $this->scripts->get("rockfrontend-script-$name") ?: new ScriptsArray($name);
$this->scripts->set("rockfrontend-script-$name", $script);
Expand All @@ -1780,6 +1782,8 @@ public function scripts($name = 'main')
*/
public function styles($name = 'main', $cssDir = null)
{
$name = trim($name);
if (!$name) $name = 'main';
if (!$this->styles) $this->styles = new WireData();
$style = $this->styles->get("rf-style-$name") ?: new StylesArray($name);
if ($name) $this->styles->set("rf-style-$name", $style);
Expand Down

0 comments on commit f929762

Please sign in to comment.