updated to current ci but base_url() defect |
the base_url function does not return the port number like it used to
What can I use instead?
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.
Not a bug with either CodeIgniter or codeignitor:
https://www.codeigniter.com/user_guide/i...-not-empty
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.
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 |
Welcome Guest, Not a member yet? Register Sign In |