• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
adding SERVER_PORT to base_url setting function

#1
My English is not good. Sorry about that.

What do you guys think about adding SERVER_PORT to base_url setting function in __construct() of core/Config.php

If I don't set a BASE_URL at the configuration, It doesn't works.
Reply

#2
hello everyone!

(05-17-2016, 12:13 AM)Sangwon Kim Wrote: My English is not good. Sorry about that.

What do you guys think about adding SERVER_PORT to base_url setting function in __construct() of core/Config.php

If I don't set a BASE_URL at the configuration, It doesn't works.

same issue here, I quickly fixed it myself by adding

PHP Code:
    if(isset($_SERVER['SERVER_PORT'])) {
        
$port $_SERVER['SERVER_PORT'];
        if(
is_https()) {
            if(
$port != 443$server_addr .= ':'.$port;
        }
        else {
            if(
$port != 80$server_addr .= ':'.$port;
        }
    } 

for CodeIgniter 3.0.6 in system/core/Config.php:101 (in __construct(), before setting $base_url)

maybe it helps, works for me in development on nginx+hhvm/fcgi and lighttpd+php-fcgi

BR, chris
Reply

#3
I am, yet again, stunned by the efforts people put into not filling a single configuration setting.
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.