From 0841b01855f0c14aef770d3ae8fe0342bc2d0982 Mon Sep 17 00:00:00 2001
From: Tim van Dijen <tvdijen@gmail.com>
Date: Thu, 26 Sep 2019 13:16:17 +0200
Subject: [PATCH] Properly calculate the URL for modules

---
 lib/SimpleSAML/XHTML/Template.php | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/SimpleSAML/XHTML/Template.php b/lib/SimpleSAML/XHTML/Template.php
index 12bad067f..dc885c2f4 100644
--- a/lib/SimpleSAML/XHTML/Template.php
+++ b/lib/SimpleSAML/XHTML/Template.php
@@ -172,18 +172,18 @@ class Template extends Response
     public function asset($asset, $module = null)
     {
         $baseDir = $this->configuration->getBaseDir();
-        $basePath =  $this->configuration->getBasePath();
         if (is_null($module)) {
             $file = $baseDir.'www/assets/'.$asset;
+            $basePath =  $this->configuration->getBasePath();
             $path = $basePath.'assets/'.$asset;
         } else {
             $file = $baseDir.'modules/'.$module.'/www/assets/'.$asset;
-            $path = $basePath.'module.php/'.$module.'/assets/'.$asset;
+            $path = Module::getModuleUrl($module.'/assets/'.$asset);
         }
 
         if (!file_exists($file)) {
             // don't be too harsh if an asset is missing, just pretend it's there...
-            return $basePath.'assets/'.$asset;
+            return $path;
         }
 
         $tag = $this->configuration->getVersion();
-- 
GitLab