summaryrefslogtreecommitdiffstats
path: root/system/libraries/URI.php
diff options
context:
space:
mode:
Diffstat (limited to 'system/libraries/URI.php')
-rw-r--r--system/libraries/URI.php23
1 files changed, 8 insertions, 15 deletions
diff --git a/system/libraries/URI.php b/system/libraries/URI.php
index 8de26f933..aecf05138 100644
--- a/system/libraries/URI.php
+++ b/system/libraries/URI.php
@@ -245,30 +245,23 @@ class CI_URI {
*/
function _reindex_segments()
{
- // Is the routed segment array different then the main segment array?
- // have to compute the diff both ways since PHP returns only values in $arr1 that are not in $arr2.
- $diff = (array_diff($this->rsegments, $this->segments) != array_diff($this->segments, $this->rsegments)) ? TRUE : FALSE;
-
$i = 1;
+
foreach ($this->segments as $val)
{
$this->segments[$i++] = $val;
}
+
unset($this->segments[0]);
- if ($diff == FALSE)
- {
- $this->rsegments = $this->segments;
- }
- else
+ $i = 1;
+
+ foreach ($this->rsegments as $val)
{
- $i = 1;
- foreach ($this->rsegments as $val)
- {
- $this->rsegments[$i++] = $val;
- }
- unset($this->rsegments[0]);
+ $this->rsegments[$i++] = $val;
}
+
+ unset($this->rsegments[0]);
}
// --------------------------------------------------------------------