Topic: Erroneous https detected for "redirect_url"

I installed the latest PunBB for testing. When I login I get redirected to an invalid HTTPS url. My test setup uses HTTP.


Debian 6
PHP 5.4, Nginx 1.2 from DotDeb repo.
SQLite 3

After some digging I trace it to the get_current_url function in include/functions.php, specifically this line:

$protocol = (!isset($_SERVER['HTTPS']) || strtolower($_SERVER['HTTPS']) == 'off') ? ...

It seems that on my system $_SERVER['HTTPS'] is set, but to an empty string.

I changed that line to:

$protocol = (!isset($_SERVER['HTTPS']) || empty($_SERVER['HTTPS']) || strtolower($_SERVER['HTTPS']) == 'off') ? ...

And all is well. I login and get redirected correctly.

Re: Erroneous https detected for "redirect_url"

sleddog2, thank you for figuring out this problem! Your solution worked for me.

For others who may experience this same problem, it occurred for me with a server that has SNI enabled and that's hosting several sites, some which use valid SSL certs but not the one with punBB which threw this error.

Adding the "empty($_SERVER['HTTPS'])" statement should definitely be included in the next upgrade to punBB. Fingers crossed it comes soon.

Re: Erroneous https detected for "redirect_url"

You are a LIFE saver, same thing happened to me and spent an hour trying to figure it out. Thought it was on my end somehow.