Use the code below to load Stripe JS:
$wa = Factory::getDocument()->getWebAssetManager();
$wa->registerAndUseScript('sesame.stripepay', 'https://js.stripe.com/v3/');
Stripe JS loaded properly
Stripe JS is not loaded. The script element has wrong src like below
<script src="/joomla/root/path/https://js.stripe.com/v3/?12f2b9" data-asset-name="sesame.stripepay"></script>
$wa->registerAndUseScript('sesame.stripepay', 'https://js.stripe.com/v3');
works properlyjoomla-cms/libraries/src/WebAsset/WebAssetItem.php
Lines 179 to 182 in aa475c1
Ping @Fedik
Labels |
Added:
No Code Attached Yet
|
Labels |
Added:
bug
|
Could check if the $path
is NOT a URL:
if (str_ends_with($path, '/') && !str_starts_with($path, '.') && !filter_var($path, FILTER_VALIDATE_URL)) {
$path = Uri::root(true) . '/' . $path;
}
You both very close to solution, but there actualy 3-rd way :)
I will do PR later.
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2025-01-24 10:38:22 |
Closed_By | ⇒ | Fedik |
Maybe we should check for the appearance of 'http' or 'https' in
$path
before changing it?