We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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');
joomla-cms/libraries/src/WebAsset/WebAssetItem.php
Lines 179 to 182 in aa475c1
Ping @Fedik
The text was updated successfully, but these errors were encountered:
Maybe we should check for the appearance of 'http' or 'https' in $path before changing it?
$path
Sorry, something went wrong.
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.
Please test #44774
Successfully merging a pull request may close this issue.
Steps to reproduce the issue
Use the code below to load Stripe JS:
Expected result
Stripe JS loaded properly
Actual result
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>
System information (as much as possible)
Additional comments
$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
The text was updated successfully, but these errors were encountered: