Configuration parameter use_https is never used

Submitted by Anonymous on Sun, 04/06/2014 - 10:43
Written by
FiMa

Hi! As I see there is a configuration parameter $conf['use_https'] = 0 can be found in config.php.
Seems this parameter is never regarded through the code.
What I have: Usebb ver. 1.0.17, php ver. 5.4.99-hiphop (HHVM implementation of PHP by Facebook). HHVM by some reason sets $_SERVER['HTTPS'] by default but with an empty value. So what I get in Usebb sources\functions.php:

$protocol = ( isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off' ) ? 'https' : 'http'; // this is true, https is choosen

As the result, after login/logout the users are redirected to https:// but server does not support this actually.
I suggest to redesign the line of code as follows:

$protocol = ( $this->get_config('use_https') && isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off' ) ? 'https' : 'http';

Thank you.