summaryrefslogtreecommitdiffstats
path: root/system/core/Config.php
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-06-16 18:54:33 +0200
committerAndrey Andreev <narf@bofh.bg>2012-06-16 18:54:33 +0200
commit95d78cf4f78c0fb685a789c280d106ab242318ef (patch)
tree89a2dd150db58c4465f3f40233e25c8a3a40b71a /system/core/Config.php
parentb089e15b1510de6b6a034631c80d3d5e830ff9f3 (diff)
Fix issue #999
Diffstat (limited to 'system/core/Config.php')
-rw-r--r--system/core/Config.php18
1 files changed, 15 insertions, 3 deletions
diff --git a/system/core/Config.php b/system/core/Config.php
index 656382716..4b4e5a7ba 100644
--- a/system/core/Config.php
+++ b/system/core/Config.php
@@ -235,14 +235,26 @@ class CI_Config {
return $this->slash_item('base_url').$this->item('index_page');
}
+ $uri = $this->_uri_string($uri);
+
if ($this->item('enable_query_strings') === FALSE)
{
$suffix = ($this->item('url_suffix') === FALSE) ? '' : $this->item('url_suffix');
- return $this->slash_item('base_url').$this->slash_item('index_page').$this->_uri_string($uri).$suffix;
+
+ if ($suffix !== '' && ($offset = strpos($uri, '?')) !== FALSE)
+ {
+ $uri = substr($uri, 0, $offset).$suffix.substr($uri, $offset);
+ }
+ else
+ {
+ $uri .= $suffix;
+ }
+
+ return $this->slash_item('base_url').$this->slash_item('index_page').$uri;
}
- elseif (is_array($uri) OR strpos($uri, '?') === FALSE)
+ elseif (strpos($uri, '?') === FALSE)
{
- $uri = '?'.$this->_uri_string($uri);
+ $uri = '?'.$uri;
}
return $this->slash_item('base_url').$this->item('index_page').$uri;