Author Topic: [1.7 - 1.7.6] Redirects don't work on sites with non-standard port  (Read 21544 times)

0 Members and 1 Guest are viewing this topic.

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
If a website uses non-standard port (i.e. http://example.com:12345/4images) redirects (i.e. after login or logout) won't work on some browsers (Internet Explorer, Google Chrome).

The problem is in $_SERVER['HTTP_HOST'] which might contain the port number.

To fix this find in global.php:
  $script_url .= (!empty($HTTP_SERVER_VARS['HTTP_HOST'])) ? $HTTP_SERVER_VARS['HTTP_HOST'] : getenv("SERVER_NAME");


Insert BELOW:
  if ($port$script_url str_replace($port""$script_url);
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline xbox1

  • Pre-Newbie
  • Posts: 2
    • View Profile
Re: [1.7 - 1.7.6] Redirects don't work on sites with non-standard port
« Reply #1 on: April 30, 2009, 02:51:58 AM »
Thanks a lot....

I fixed it....

Offline Tino23

  • Full Member
  • ***
  • Posts: 191
    • View Profile
    • LMJ - Motorsport
Re: [1.7 - 1.7.6] Redirects don't work on sites with non-standard port
« Reply #2 on: August 31, 2010, 06:24:24 PM »
In der 1.7.8 Version steht an der Stelle
Code: [Select]
if ($port) $script_url = str_replace(":".$port, "", $script_url);Ist der auch für die 1.7.6 Version gültig?

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [1.7 - 1.7.6] Redirects don't work on sites with non-standard port
« Reply #3 on: September 01, 2010, 05:29:58 AM »
1.7.8 has all the fixes from v1.7 to v1.7.7

(or I didn't understand you question...)
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)