No Code Attached Yet
avatar leeroy1821
leeroy1821
30 Oct 2024

Steps to reproduce the issue

Mail template com_users.password_reset

HTML Body:

<p>Hello,</p>
<p>
	A request has been made to reset your {SITENAME} account password. To reset your password, you will need to submit this verification code to verify that the request was legitimate.
</p>
<p>
    The verification code is {TOKEN}
</p>
<p>
	Click <a href="{LINK_HTML}">here</a> and proceed with resetting your password.    
</p>
<p>
    Thank you.
</p>

Expected result

URL in email is correct: https://www.mysite.com/component/users/reset.html?layout=confirm&amp;token=blablabla&amp;Itemid=123

Actual result

URL in email is broken: https://www.mysite.com/https://www.mysite.com/component/users/reset.html?layout=confirm&amp;token=blablabla&amp;Itemid=123

The https://www.mysite.com is dobled in email.

System information (as much as possible)

  • Joomla! 5.2.0
  • PHP 8.3.13

Additional comments

When I put Mail Template Layout to No, problem not exist. Make me think Mail Template Layout is problem.

I look in MailTemplate. Line 331 $htmlBody = MailHelper::convertRelativeToAbsoluteUrls($htmlBody);. Add var_dump($htmlBody); next to it. I see <a href="https://www.mysite.com/{LINK_HTML}">. But LINK_HTML already have https://www.mysite.com/! This comes the problem, no?

I move $htmlBody = MailHelper::convertRelativeToAbsoluteUrls($htmlBody); after the big if layout and problem not exist.

avatar leeroy1821 leeroy1821 - open - 30 Oct 2024
avatar joomla-cms-bot joomla-cms-bot - change - 30 Oct 2024
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 30 Oct 2024
avatar webmasterab
webmasterab - comment - 30 Oct 2024

I also have this URL problem with the emails that are now sent by Joomla 5.2.

Very annoying.
How nice that there is a solution soon.
However, it is better to submit this as a pull request, then if it works and the test is successful, it can be adopted in the core.

Do you know how to create a pull request?

avatar leeroy1821
leeroy1821 - comment - 30 Oct 2024

@webmasterab I can ask colleague. He helpt some month ago with pull request for passkeys. I will come with pull request in some hours.

avatar leeroy1821
leeroy1821 - comment - 30 Oct 2024

I made pull request #44378

Thanks!

avatar fgsw
fgsw - comment - 30 Oct 2024

@leeroy1821 can you close this Issue as you have created a Pull Request?

avatar leeroy1821 leeroy1821 - change - 30 Oct 2024
Status New Closed
Closed_Date 0000-00-00 00:00:00 2024-10-30 11:28:08
Closed_By leeroy1821
avatar leeroy1821 leeroy1821 - close - 30 Oct 2024
avatar leeroy1821
leeroy1821 - comment - 30 Oct 2024

Close issue. See all Pull Request #44378 Thanks!

Add a Comment

Login with GitHub to post a comment