Environment
- Template: Gazette 2.0.5 (
shaper_gazette), Helix Ultimate 2.2.10 - SP Page Builder 6.10.0 (Pro), Joomla 5.4.10, PHP 8.3
The problem
Three of the template's SP Page Builder addons build their script and stylesheet URLs like this:
$base_path = Uri::base() . '/templates/' . $app->getTemplate() . '/js/';
Uri::base() (without the true argument) returns the full site URL with a trailing slash, e.g. https://example.com/. Adding '/templates/' produces https://example.com//templates/shaper_gazette/js/owl.carousel.min.js.
Where it occurs in the 2.0.5 package:
sppagebuilder/addons/articles_slider/site.php:scripts()andstylesheets()sppagebuilder/addons/articles/site.php: thescripts()path forjs/sppagebuilder/addons/thumb_gallery/site.php:scripts()and theflexslider.cssstylesheet
Effects:
- The files still load, because web servers merge the slashes. But every URL relative to those files inherits the
//too. For example, the Owl Carousel CSS image becomes//templates/shaper_gazette/css/owl.video.play.pngin our access logs. - Caches and CDNs treat
//templates/...and/templates/...as different URLs. The same file can be cached twice, and path-based rules (cache behaviours, WAF or redirect rules) written for/templates/*don't match the double-slash form.
Suggested fix
Use the path-only base, which has no trailing slash:
$base_path = Uri::base(true) . '/templates/' . $app->getTemplate() . '/js/';
Apply the same change to each listed line. Alternatively, keep Uri::base() and drop the leading slash: Uri::base() . 'templates/' . …. Either produces a single slash and works for sites installed in a subfolder.
Impact
- Every Gazette site using these addons serves its addon assets from double-slash URLs.
- The fix is a few one-line changes, with no behaviour change apart from the corrected URLs.
joomshaper $