https lost in form action

How to fix a ChronoForms form action URL incorrectly using HTTP instead of HTTPS.

Overview

The issue occurs when the site is behind an HTTPS proxy, causing the server to incorrectly detect the protocol.
Modify the specified file to update the protocol detection logic, ensuring it correctly identifies HTTPS connections from proxy headers.

Answered
ChronoForms v6
Hy,

I have installed on a fresh install Joomla 3.7.5, the chronoforms 6.0.9

I have installed the "Basic contact form", save, create, the menu entry.
When i call the page "https://www.domain.fr/rendez-vous"
All seems good, but if you check the HTML's code of the form tag, URL action is HTTP

<form action="http://www.domain.fr/rendez-vous?chronoform=Contact&event=submit" method="post" name="display-section1" id="display-section1" data-id="display-section1" class="ui form G2-form" data-valloc="inline" enctype="multipart/form-data" data-dtask="send/self" data-result="replace/self" data-subanimation="1">


Thanks
co contact@informatiqueprog.net 14 Sep, 2017
Answer
2 Likes
I finally found why, I'm behind a HTTPS proxy.

To resolve this, you need to change on

cegcore2\libs\url.php

line 32
REPLACE
if((!empty($_SERVER['HTTPS']) AND $_SERVER['HTTPS'] !== 'off') OR $_SERVER['SERVER_PORT'] == 443){

BY
if((!empty($_SERVER['HTTPS']) AND $_SERVER['HTTPS'] !== 'off')
			OR $_SERVER['SERVER_PORT'] == 443
			OR (!empty($_SERVER['HTTP_X_FORWARDED_PROTO']) AND $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')
			OR (!empty($_SERVER['HTTP_X_FORWARDED_SSL']) AND $_SERVER['HTTP_X_FORWARDED_SSL'] == 'on')){
Max_admin Max_admin 10 Oct, 2017
Thank you for posting the solution!

Best regards
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.