summaryrefslogtreecommitdiffstats
path: root/system/core/URI.php
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2013-01-03 10:46:17 +0100
committerAndrey Andreev <narf@bofh.bg>2013-01-03 10:46:17 +0100
commitc5b766c15c6aa69dcc4609d46b0abd45baf1a8d9 (patch)
treec0010de0de80c3a96ff7d1eb3dd3edbc70e6ae6b /system/core/URI.php
parent80500afbd188600212ca913a7bac073009feac73 (diff)
parent4279223ced1179d434446f7f69efed4be7332774 (diff)
Merge pull request #2106 from danhunsaker/feature/uri-extensibility
Improved extensibility of the URI class
Diffstat (limited to 'system/core/URI.php')
-rw-r--r--system/core/URI.php14
1 files changed, 2 insertions, 12 deletions
diff --git a/system/core/URI.php b/system/core/URI.php
index e6f2832aa..fb8540118 100644
--- a/system/core/URI.php
+++ b/system/core/URI.php
@@ -506,23 +506,13 @@ class CI_URI {
return $default;
}
- in_array($which, array('segment', 'rsegment'), TRUE) OR $which = 'segment';
-
if (isset($this->keyval[$which], $this->keyval[$which][$n]))
{
return $this->keyval[$which][$n];
}
- if ($which === 'segment')
- {
- $total_segments = 'total_segments';
- $segment_array = 'segment_array';
- }
- else
- {
- $total_segments = 'total_rsegments';
- $segment_array = 'rsegment_array';
- }
+ $total_segments = "total_{$which}s";
+ $segment_array = "{$which}_array";
if ($this->$total_segments() < $n)
{