diff --git a/app/helpers/theme.php b/app/helpers/theme.php index 9c1dde5..126677d 100644 --- a/app/helpers/theme.php +++ b/app/helpers/theme.php @@ -116,9 +116,11 @@ class Theme return null; } - // Use the router to generate the URL + // Generate URL that goes through index.php global $app_root; - return "$app_root/app/helpers/theme-asset.php?theme=" . urlencode($themeId) . "&path=" . urlencode($assetPath); + // Remove any trailing slash from app_root to avoid double slashes + $baseUrl = rtrim($app_root, '/'); + return "$baseUrl/?page=theme-asset&theme=" . urlencode($themeId) . "&path=" . urlencode($assetPath); } diff --git a/app/pages/theme-asset.php b/app/pages/theme-asset.php new file mode 100644 index 0000000..4136034 --- /dev/null +++ b/app/pages/theme-asset.php @@ -0,0 +1,10 @@ +