• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
updated to current ci but base_url() defect

#1
the base_url function does not return the port number like it used to
What can I use instead?
Reply

#2
@cupboy1

How is your base url defined in your config file?
Reply

#3
It's blank in both config files (older version, and current version). Definitely a bug with the new codeignitor version. I don't know what older version I'm currently running but it's a version 3 version, just not the latest one. My IIS settings are correct.
Reply

#4
Not a bug with either CodeIgniter or codeignitor:
https://www.codeigniter.com/user_guide/i...-not-empty
Reply

#5
I was able to fix it by going into system/core/Config.php and changing __construct to do it the old way, using  $__SERVER['HTTP_HOST'] instead of the new, non-working way which used $__SERVER['SERVER_ADDR']

Hasn't been thoroughly tested yet but works so far.

Now that I've gotten a way into the site I get a new error:

Call to a member function unset_userdata() on null

Strange stuff.
Reply

#6
Never a good idea to mess with code in system. The change was made because using HTTP_HOST can lead to a host header injection attack.

If you absolutely want to do it "your way", the proper approach would be to "extend" the Config class ... https://www.codeigniter.com/user_guide/g...core-class
Reply

#7
I've taken a look at that. I intend to study it further.
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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