? ? Success

User tests: Successful: Unsuccessful:

avatar HLeithner
HLeithner
4 Mar 2019

Pull Request for Issue #23046 .

Summary of Changes

Use the correct http schema.

Testing Instructions

Test user registration with and without forced https on http and https

Expected result

  • Registration email is http if you are on http when force http is "none"
  • Registration email is https if you are on https when force http is "none"
  • Registration email is https if you are on https when force http is "Entire Site"

Actual result

  • Registration email is http if you are on https when force http is "none"
avatar HLeithner HLeithner - open - 4 Mar 2019
avatar HLeithner HLeithner - change - 4 Mar 2019
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 4 Mar 2019
Category Libraries
avatar SharkyKZ
SharkyKZ - comment - 4 Mar 2019

It's not documented anymore, but $ssl with value -1 should force HTTP. It's what menu items have:

name="secure"
type="list"
label="COM_MENUS_ITEM_FIELD_SECURE_LABEL"
description="COM_MENUS_ITEM_FIELD_SECURE_DESC"
default="0"
filter="integer"
>
<option value="-1">JOFF</option>
<option value="1">JON</option>
<option value="0">COM_MENUS_FIELD_VALUE_IGNORE</option>

Basing protocol on request would require another option, I think.

avatar HLeithner
HLeithner - comment - 5 Mar 2019

Value 2 is forcing http and that should still works.

avatar SharkyKZ
SharkyKZ - comment - 5 Mar 2019

Value -1 should do that also, as described above. With this patch, menu item settings aren't respected anymore.

avatar HLeithner
HLeithner - comment - 5 Mar 2019

The API for route::link is different then the https force options.

We convert it before we call route::link
you will find this in the registration.php:
$linkMode = $config->get('force_ssl', 0) == 2 ? 1 : -1;

avatar SharkyKZ
SharkyKZ - comment - 5 Mar 2019

Secure menu item option is different from Force SSL option in global configuration. Somewhere between 3.1 and 3.2 the description of $ssl param was changed but behavior remained the same. This is from 3.1.0:

/**
 * Translates an internal Joomla URL to a humanly readible URL.
 *
 * @param   string   $url    Absolute or Relative URI to Joomla resource.
 * @param   boolean  $xhtml  Replace & by &amp; for XML compilance.
 * @param   integer  $ssl    Secure state for the resolved URI.
 *                             1: Make URI secure using global secure site URI.
 *                             0: Leave URI in the same secure state as it was passed to the function.
 *                            -1: Make URI unsecure using the global unsecure site URI.
 *
 * @return  The translated humanly readible URL.
 *
 * @since   11.1
 */
public static function _($url, $xhtml = true, $ssl = null)

So it's technically correct that -1 forces HTTP. But we do need a new option to use protocol from request.

avatar HLeithner
HLeithner - comment - 5 Mar 2019

-1 doesn't force it, -1 uses the current protocol. It's used because it's int and not 0 but don't ask me why not NULL is used.

avatar SharkyKZ
SharkyKZ - comment - 5 Mar 2019

Without patch value -1 forces HTTP and this is fine. Changing this is going to break secure option in menu items. Also with this patch value 2 doesn't force HTTP when current URL is HTTPS.

A B/C safe solution is to introduce another value to replace -1 wherever we want to use protocol from request.

avatar SharkyKZ
SharkyKZ - comment - 5 Mar 2019

To be more clear, behavior with both -1 and 2 is exactly the same and it must remain so.

avatar HLeithner
HLeithner - comment - 5 Mar 2019

So I rewrote route::_ and route::link to support absolute parameter.

And also deprecated -1 and added constants to the route class.

avatar HLeithner HLeithner - change - 5 Mar 2019
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - change - 5 Mar 2019
Category Libraries Administration com_messages Front End com_users Libraries Plugins
e814241 5 Mar 2019 avatar HLeithner cs
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 24 Apr 2019
avatar chrisxchrisxchrisx
chrisxchrisxchrisx - comment - 24 Apr 2019

Thank you all for your work. The test was not successful but it is the first time I have tested a Joomla patch so please bear with me if it was my fault:

Steps to test the patch

In Joomla "staging" from https://github.com/joomla/joomla-cms
With release patch installed but no patch applied from https://github.com/joomla-extensions/patchtester/releases/tag/2.0.1

Users: Options: Allow User Registration: Yes

Users: Options: New User Account Activation: Administrators

include {loadmodule 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 Secure = On

select the single article menu item and select Create an account

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

apply patch 24089

clear Joomla cache and expired cache and browser cache

select the single article menu item and select Create an account

Expected result

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

Actual result

https://localhost/joomla-cms-staging/index.php/registration-form?task=registration.register
Error message: The requested page cannot be found
Error: 0 Class 'Route' not found

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 25 Apr 2019
avatar chrisxchrisxchrisx
chrisxchrisxchrisx - comment - 25 Apr 2019

I have tested this item 🔴 unsuccessfully on bb54c76

Thank you all for your work. The test was not successful but it is the first time I have tested a Joomla patch so please bear with me if it was my fault:

Steps to test the patch

In Joomla "staging" from https://github.com/joomla/joomla-cms
With release patch installed but no patch applied from https://github.com/joomla-extensions/patchtester/releases/tag/2.0.1

Users: Options: Allow User Registration: Yes

Users: Options: New User Account Activation: Administrators

include {loadmodule 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 Secure = On

select the single article menu item, select Create an account, complete form and submit

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

apply patch 24089

clear Joomla cache and expired cache and browser cache

select the single article menu item, select Create an account, complete form and submit

Expected result

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

Actual result

at index.php/registration-form?task=registration.register
Error message: The requested page cannot be found
Error: 0 Class 'Route' not found


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

avatar chrisxchrisxchrisx
chrisxchrisxchrisx - comment - 25 Apr 2019

I have tested this item 🔴 unsuccessfully on bb54c76

Thank you all for your work. The test was not successful but it is the first time I have tested a Joomla patch so please bear with me if it was my fault:

Steps to test the patch

In Joomla "staging" from https://github.com/joomla/joomla-cms
With release patch installed but no patch applied from https://github.com/joomla-extensions/patchtester/releases/tag/2.0.1

Users: Options: Allow User Registration: Yes

Users: Options: New User Account Activation: Administrators

include {loadmodule 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 Secure = On

select the single article menu item, select Create an account, complete form and submit

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

apply patch 24089

clear Joomla cache and expired cache and browser cache

select the single article menu item, select Create an account, complete form and submit

Expected result

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

Actual result

at index.php/registration-form?task=registration.register
Error message: The requested page cannot be found
Error: 0 Class 'Route' not found


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

avatar chrisxchrisxchrisx chrisxchrisxchrisx - test_item - 25 Apr 2019 - Tested unsuccessfully
avatar HLeithner HLeithner - change - 25 Apr 2019
Labels Removed: J3 Issue
avatar HLeithner
HLeithner - comment - 25 Apr 2019

thx @chrisxchrisxchrisx fixed now

avatar chrisxchrisxchrisx
chrisxchrisxchrisx - comment - 26 Apr 2019

I have tested this item ✅ successfully on 4610fe4

Test as before yields expected result. Well done guys.


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

avatar chrisxchrisxchrisx
chrisxchrisxchrisx - comment - 26 Apr 2019

I have tested this item ✅ successfully on 4610fe4

Test as before yields expected result. Well done guys.


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

avatar chrisxchrisxchrisx chrisxchrisxchrisx - test_item - 26 Apr 2019 - Tested successfully
avatar alikon
alikon - comment - 26 Apr 2019

I have tested this item ✅ successfully on 4610fe4


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

avatar alikon
alikon - comment - 26 Apr 2019

I have tested this item ✅ successfully on 4610fe4


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

avatar alikon alikon - test_item - 26 Apr 2019 - Tested successfully
avatar alikon alikon - change - 26 Apr 2019
Status Pending Ready to Commit
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 26 Apr 2019

Status "Ready To Commit".

avatar zero-24 zero-24 - change - 27 Apr 2019
Labels Added: ?
avatar HLeithner HLeithner - change - 5 Jun 2019
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2019-06-05 14:36:15
Closed_By HLeithner
avatar HLeithner HLeithner - close - 5 Jun 2019
avatar HLeithner HLeithner - merge - 5 Jun 2019

Add a Comment

Login with GitHub to post a comment