?
avatar chrisxchrisxchrisx
chrisxchrisxchrisx
12 Nov 2018

Steps to reproduce the issue

In Joomla prior to 3.9.0

Users: Options: Allow User Registration: Yes

Users: Options: New User Account Activation: Administrators

include {load_module mod_login} in an article

link a published menu module to a visible menu

publish a single article menu item for the article in the visible menu

create a hidden menu not linked to any menu module

publish a menu item alias menu item for the single article menu item in the hidden menu

publish a users registration form menu item with the menu item alias menu item as owner

set all the above menu items Metadata Security = Yes

note that registration links emailed to users and administrators honour the security setting by using https:

upgrade to Joomla 3.9.0

note that registration links emailed to users and administrators do not honour the security settings but use http:

Expected result

registration links emailed to users and administrators honour the security setting by using https: even after upgrade to 3.9.0

Actual result

that registration links emailed to users and administrators do not honour the security settings but use http: after upgrade to 3.9.0

System information (as much as possible)

PHP Built On Linux web31.fasteurohosting.com 2.6.32-896.16.1.lve1.4.54.el6.x86_64 #1 SMP Wed May 2 07:43:19 EDT 2018 x86_64
Database Type mysql
Database Version 5.6.41-log
Database Collation latin1_swedish_ci
Database Connection Collation utf8mb4_general_ci
PHP Version 7.2.11
Web Server LiteSpeed
WebServer to PHP Interface litespeed
Joomla! Version Joomla! 3.9.0 Stable [ Amani ] 30-October-2018 14:00 GMT
Joomla! Platform Version Joomla Platform 13.1.0 Stable [ Curiosity ] 24-Apr-2013 00:00 GMT
User Agent Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:63.0) Gecko/20100101 Firefox/63.0

Additional comments

Apparent regression

Thank you for your work

avatar chrisxchrisxchrisx chrisxchrisxchrisx - open - 12 Nov 2018
avatar joomla-cms-bot joomla-cms-bot - labeled - 12 Nov 2018
avatar PhilETaylor
PhilETaylor - comment - 12 Nov 2018

The url in the email comes from JUri::base

$data['siteurl'] = JUri::base();

That function has not changed for a while
see: https://github.com/joomla/joomla-cms/commits/staging/libraries/src/Uri/Uri.php

You can see it here:

public static function base($pathonly = false)

comparing:
https://corefiles.myjoomla.io/pre/joomla/3.8.0/libraries/src/Uri/Uri.php
https://corefiles.myjoomla.io/pre/joomla/3.9.0/libraries/src/Uri/Uri.php

The only change since 3.8.0 has been for "Extra cleanup to remove invalid chars in the URL to prevent injections through broken server implementation"

avatar PhilETaylor
PhilETaylor - comment - 12 Nov 2018

do you have a hard coded $live_site in /configuration.php ?

avatar chrisxchrisxchrisx
chrisxchrisxchrisx - comment - 12 Nov 2018

Yes Phil, I have $live_site = 'http://my.url' and if that is not optimum I'm happy to change it, however comparing registration.php between 3.8.13 and 3.9.0 I see a number of changes under the headings:

// Admin activation is on and user is verifying their email

and

// Set the link to confirm the user email

and

// Set the link to confirm the user account.

In other words, there are significant code changes in this functionality, which my email logs confirm went wrong exactly when I applied that upgrade.

Although to be honest I haven't taken any time to review the code changes myself yet, I would appreciate your expertise as usual, as well as others'.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/23046.

avatar PhilETaylor
PhilETaylor - comment - 12 Nov 2018

REMOVE any setting for $live_site unless you KNOW why you need that. Joomla DOESNT need that to be completed to work correctly.

avatar PhilETaylor
PhilETaylor - comment - 12 Nov 2018

Yes there were changes in 3.9.0 to User Activations during registration, but I think your issue is an incorrect $live_site param, because you are forcing Joomla to use a http:// url and not allowing it to guess https://

avatar SharkyKZ
SharkyKZ - comment - 12 Nov 2018

There was a change in how the links are generated. See #21152.

But I can't confirm your claims about Secure option being respected when generating activation links. This option is only used in mod_menu. So even before 3.9 the activation link depended on where registration took place.

avatar chrisxchrisxchrisx
chrisxchrisxchrisx - comment - 12 Nov 2018

Thank you Phil I have changed $live_site = 'http://my.url' to $live_site = '' but the problem still persists. Please let me know if I misunderstood your recommendation and should have deleted the $live_site line altogether.

Thank you Sharky. You are correct that before 3.9 the activation link depended on where registration took place. The issue is that for my site, definitely, the activation link since 3.9 no longer depends on where registration took place, but is always http even though the actual registration page was https. So mod_menu is working correctly, but registration.php is not, as far as my site is concerned.

I hope this helps and please accept my apologies if I am misunderstanding or doing anything else wrong. Many thanks for your ongoing time and expertise.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/23046.

avatar SharkyKZ
SharkyKZ - comment - 12 Nov 2018

@izharaazmi is JRoute::link() supposed to build a relative URL when protocol is not being changed?

avatar izharaazmi
izharaazmi - comment - 12 Nov 2018

Yes, It should and it does. Looks like this issue is not related to JRoute rather Uri::base but again Uri::base in administrator will give administrator link. So it must be Uri::root.

avatar SharkyKZ
SharkyKZ - comment - 12 Nov 2018

If you're looking at $data['siteurl'] = JUri::base(); snippet above, it's a separate issue.

Back to JRoute::link(), a relative link is built here:

$uri = self::$_router[$client]->build($url);

Because the link is relative, doing isSsl() is always going to fail:

if ((int) $ssl || $uri->isSsl())

$uri->setScheme(((int) $ssl === 1 || $uri->isSsl()) ? 'https' : 'http');

Also, -1 is passed as $ssl argument wherever we use JRoute::link() but it's not documented as an accepted value. It passes first (loose) check but fails at the second (strict).

avatar chrisxchrisxchrisx
chrisxchrisxchrisx - comment - 15 Nov 2018

I gather from the comments that the symptoms reported do indeed reflect a problem introduced with Joomla 3.9.0 and that those with more expertise and dedication than I are investigating a fix. Please do let me know if I am wrong, or if there is anything I can do to help. Many thanks, Chris


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/23046.

avatar franz-wohlkoenig franz-wohlkoenig - change - 4 Mar 2019
Status New Information Required
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 4 Mar 2019

@HLeithner is this Issue solved?

avatar HLeithner
HLeithner - comment - 4 Mar 2019

Closing, we have a PR for this #24089

avatar HLeithner HLeithner - close - 4 Mar 2019
avatar HLeithner HLeithner - change - 4 Mar 2019
Status Information Required Closed
Closed_Date 0000-00-00 00:00:00 2019-03-04 21:04:16
Closed_By HLeithner

Add a Comment

Login with GitHub to post a comment