Welcome Guest, Not a member yet? Register   Sign In
current_url() and HTTPS?
#2

[eluser]TheFuzzy0ne[/eluser]
Yes. Current URL pretty much returns the following:

The URL of your site as written for base_url in your config.php
the index.php page (often set to '' to hide it).
The URI as it is in your address bar.

I think you just need to override the function so that it actually returns the current URL (which can be spoofed), or at least changes the http:// to https:// when it should.

EDIT: I've probably got the numbers wrong in the calls to substr, but this code might do it.

./system/application/helpers/MY_url_helper.php
Code:
function current_url()
{
    $CI =& get_instance();
    $url = $CI->config->site_url($CI->uri->uri_string());
    if ($_SERVER['SERVER_PORT'] == 443)
    {
        $url = substr($url, 0, 4).'s'.substr($url, 4);
    }
    return $url;
}


Messages In This Thread
current_url() and HTTPS? - by El Forum - 05-14-2009, 12:14 PM
current_url() and HTTPS? - by El Forum - 05-14-2009, 12:46 PM
current_url() and HTTPS? - by El Forum - 05-14-2009, 01:25 PM



Theme © iAndrew 2016 - Forum software by © MyBB