summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2016-04-28 13:28:07 +0200
committerAndrey Andreev <narf@devilix.net>2016-04-28 13:28:07 +0200
commit4ac24c201c673b52b39b7efc2235f1d84d1acd08 (patch)
tree5e8ae1dc8c95bf6bb8bb5534a3d5b001bec647ee
parent9343851e6155f6728e02332000f1885e248e907d (diff)
Fix #4605
-rw-r--r--system/core/Config.php9
-rw-r--r--tests/codeigniter/core/Config_test.php2
-rw-r--r--user_guide_src/source/changelog.rst1
3 files changed, 6 insertions, 6 deletions
diff --git a/system/core/Config.php b/system/core/Config.php
index ca6fb3793..9fd3e4a7d 100644
--- a/system/core/Config.php
+++ b/system/core/Config.php
@@ -319,7 +319,7 @@ class CI_Config {
}
}
- return $base_url.ltrim($this->_uri_string($uri), '/');
+ return $base_url.$this->_uri_string($uri);
}
// -------------------------------------------------------------
@@ -337,11 +337,8 @@ class CI_Config {
{
if ($this->item('enable_query_strings') === FALSE)
{
- if (is_array($uri))
- {
- $uri = implode('/', $uri);
- }
- return trim($uri, '/');
+ is_array($uri) && $uri = implode('/', $uri);
+ return ltrim($uri, '/');
}
elseif (is_array($uri))
{
diff --git a/tests/codeigniter/core/Config_test.php b/tests/codeigniter/core/Config_test.php
index 26a5f32f5..b5c9e849d 100644
--- a/tests/codeigniter/core/Config_test.php
+++ b/tests/codeigniter/core/Config_test.php
@@ -127,6 +127,8 @@ class Config_test extends CI_TestCase {
$this->assertEquals($index_page.'/'.$uri, $this->config->site_url($uri));
$this->assertEquals($index_page.'/'.$uri.'/'.$uri2, $this->config->site_url(array($uri, $uri2)));
+ $this->assertEquals($index_page.'/test/', $this->config->site_url('test/'));
+
$suffix = 'ing';
$this->config->set_item('url_suffix', $suffix);
diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst
index 5a482208a..d50c0a052 100644
--- a/user_guide_src/source/changelog.rst
+++ b/user_guide_src/source/changelog.rst
@@ -26,6 +26,7 @@ Bug fixes for 3.0.7
- Fixed a bug (#861) - :doc:`Database Forge <database/forge>` method ``create_table()`` incorrectly accepts field width constraints for MSSQL/SQLSRV integer-type columns.
- Fixed a bug (#4562) - :doc:`Cache Library <libraries/caching>` didn't check if ``Memcached::quit()`` is available before calling it.
- Fixed a bug (#4563) - :doc:`Input Library <libraries/input>` method ``request_headers()`` ignores ``$xss_clean`` parameter value after first call.
+- Fixed a bug (#4605) - :doc:`Config Library <libraries/config>` method ``site_url()`` stripped trailing slashes from relative URIs passed to it.
Version 3.0.6
=============