Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #2048 from vlakoff/develop

config->site_url() optimizations
  • Loading branch information...
commit 6a38949d5ac50a123c7fdee37d9561e02fa72884 2 parents 74ad0bb + 4d9fd19
@narfbg narfbg authored
Showing with 10 additions and 7 deletions.
  1. +10 −7 system/core/Config.php
View
17 system/core/Config.php
@@ -245,15 +245,18 @@ public function site_url($uri = '')
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;
Please sign in to comment.
Something went wrong with that request. Please try again.