Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

url_helper current_url https fix. #947

Closed
byazrail opened this issue Feb 22, 2018 · 3 comments
Closed

url_helper current_url https fix. #947

byazrail opened this issue Feb 22, 2018 · 3 comments

Comments

@byazrail
Copy link
Contributor

hi guys,

`
function current_url(bool $returnObject = false)
{
$url = \CodeIgniter\Config\Services::request()->uri;

	if (\CodeIgniter\Config\Services::request()->isSecure())
	{
		$scheme = 'https';
	}

	if (isset($scheme))
	{
		$url->setScheme($scheme);
	}

	return $returnObject === true ? $url : (string) $url;
}

`

@lonnieezell
Copy link
Member

It should be already from the Request class. Are you not seeing that?

@byazrail
Copy link
Contributor Author

I see,
base_url() https fix. not be use current_url().

see https://blabla.com/foo/bar
current_url() - http://blabla.com/foo/bar

@lonnieezell
Copy link
Member

What is your baseURL set to in application/Config/App.php? base_url uses that to generate the URL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants