Welcome Guest, Not a member yet? Register   Sign In
base_url() and site_url() in CI_3.0.3
#1

(This post was last modified: 10-31-2015, 09:54 PM by seasenx6.)

Hello, I using site_url method for load css and js file in my app.

[Image: psuloan.png]

and today I up to CI_3.0.3, site_url is not working I can not load css and js file.

now I must set my domain in $config['base_url'] (not empty) and then site_url is working.

my question in CI_3.0.3 is : why site_url is not working and why I must set my domain in $config['base_url'] ?
(in CI_3.0.2 site_url method is working when $config['base_url'] is empty)

sorry, my eng is bad. thank you.
Reply
#2

See Change log: http://www.codeigniter.com/user_guide/changelog.html

> Changed Config Library method base_url() to fallback to $_SERVER['SERVER_ADDR'] when $config['base_url'] is empty in order to avoid Host header injections.

The reason is to avoid Host header injections.
Reply
#3

Thank you kenjis.
Reply
#4

You're welcome.

I found that User Guide has clear explanation how to do.
http://www.codeigniter.com/user_guide/in...-not-empty
Reply




Theme © iAndrew 2016 - Forum software by © MyBB