Skip to content

Commit 2a1f23f

Browse files
authored
Merge pull request #5808 from kenjis/fix-current_url
docs: clarify that current_url() returns URL based on Config\App
2 parents 6b8b0b5 + b358908 commit 2a1f23f

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

system/Helpers/url_helper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ function base_url($relativePath = '', ?string $scheme = null): string
109109

110110
if (! function_exists('current_url')) {
111111
/**
112-
* Returns the current full URL based on the IncomingRequest.
112+
* Returns the current full URL based on the Config\App settings and IncomingRequest.
113113
* String returns ignore query and fragment parts.
114114
*
115115
* @param bool $returnObject True to return an object instead of a string

user_guide_src/source/helpers/url_helper.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,9 @@ The following functions are available:
8888
:returns: The current URL
8989
:rtype: string|\\CodeIgniter\\HTTP\\URI
9090

91-
Returns the full URL (including segments) of the page being currently
92-
viewed.
91+
Returns the full URL (including segments) of the page being currently viewed.
92+
However for security reasons, it is created based on the ``Config\App`` settings,
93+
and not intended to match the browser URL.
9394

9495
.. note:: Calling this function is the same as doing this:
9596

0 commit comments

Comments
 (0)