summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-12-03 11:56:32 +0100
committerAndrey Andreev <narf@bofh.bg>2012-12-03 11:56:32 +0100
commit6a38949d5ac50a123c7fdee37d9561e02fa72884 (patch)
tree61b61bbea801b523e752673b1e2c7599ac6aa600
parent74ad0bbc4a5e39ced17d33f44ec6f2082d145c8e (diff)
parent4d9fd19e6e224042e04f71c35b174990a177527d (diff)
Merge pull request #2048 from vlakoff/develop
config->site_url() optimizations
-rw-r--r--system/core/Config.php17
1 files changed, 10 insertions, 7 deletions
diff --git a/system/core/Config.php b/system/core/Config.php
index 8250b5b1a..38bcd5c8f 100644
--- a/system/core/Config.php
+++ b/system/core/Config.php
@@ -245,15 +245,18 @@ class CI_Config {
if ($this->item('enable_query_strings') === FALSE)
{
- $suffix = ($this->item('url_suffix') === FALSE) ? '' : $this->item('url_suffix');
+ $suffix = isset($this->config['url_suffix']) ? $this->config['url_suffix'] : '';
- if ($suffix !== '' && ($offset = strpos($uri, '?')) !== FALSE)
+ if ($suffix !== '')
{
- $uri = substr($uri, 0, $offset).$suffix.substr($uri, $offset);
- }
- else
- {
- $uri .= $suffix;
+ if (($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;