We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 401fabb commit 4b86769Copy full SHA for 4b86769
CodeIgniter/Framework/helpers/url_helper.php
@@ -100,10 +100,21 @@ function base_url($uri = '', $protocol = null)
100
*
101
* @return string
102
*/
103
- function current_url()
+ function current_url($with_query_strings = false)
104
{
105
$CI =& get_instance();
106
- return $CI->config->site_url($CI->uri->uri_string());
+
107
+ $url = $CI->config->site_url($CI->uri->uri_string());
108
109
+ if (
110
+ $with_query_strings
111
+ && !empty($_SERVER['QUERY_STRING'])
112
+ && (config_item('allow_get_array') !== false)
113
+ ) {
114
+ $url .= '?' . $_SERVER['QUERY_STRING'];
115
+ }
116
117
+ return $url;
118
}
119
120
0 commit comments