[OJS-3.2.0] OJS generates Protocol-relative URLs in notification e-mails

Hi,
There are some posts in the forum talking about issues related with “reverse proxy”. IMHO, with Cloud and docker this will be a more and common scenario so I think we need a solution for this.

To take the whole picture, those are some examples:

I though was fair continue talking about this problem here because this post is one of the most recent, well explained and include a fix that just need to be implemented (patch posted here is not generic enough).

Although I agree with Clinton with this:

This will not be possible/feasible/desirable/comfortable in some scenarios and (please correct me) I think the problem here is that OJS is not working as it should.

IMHO (and I have a limited perspective) OJS is asking about the protocol to SCRIPT_URI, when it need to honor the protocol specified at HTTP_X_FORWARDED_PROTO (if exists).

As published before in this thread typo3 are also dealing with similar issues and they fixed it the way specified:
https://forge.typo3.org/issues/29693

Tomorrow I will also dig into Drupal and Wordpress to be sure we are moving in the same direction, but if you agree, I can make a PR for 3.2 and 3.3 to fix this issue and make “reverse-proxiers” life easier. :slight_smile:

The patch is as simple as adding a condition here:

To check if HTTP_X_FORWARDED_PROTO exists, and if yes, set the protocol to be whatever you find in the variable.

Waiting for your comments,
m.