ruri_to_assoc(n) and uri_to_assoc(n) return value of 1st when run in same function #1811

Closed
Scryser opened this Issue Sep 18, 2012 · 1 comment

Comments

Projects
None yet
2 participants

Scryser commented Sep 18, 2012

i used the reroute function and for testing i ran sth similar to this:

class Some_class extends CI_Controller {

public function _remap($somevar)
    {
        print_r($this->uri->ruri_to_assoc(1));
        print_r($this->uri->uri_to_assoc(1));
        print_r($somevar);
....
}
...
}

my routes.php include a rule like this

$route['some_class/afunction'] = 'some_class/bfunction';

if i visit randomsite.com/index.php/some_class/afunction

i get:

Array ( [someclass] =>bfunction ) Array ( [someclass] =>bfunction ) bfunction

and for the twist if i swap the order to

print_r($this->uri->uri_to_assoc(1));
print_r($this->uri->ruri_to_assoc(1));

i get:

Array ( [someclass] =>afunction ) Array ( [someclass] =>afunction ) bfunction

however it works as expected if i call one of them with the offset 1 and the other with the offset 2. but not if i call both with the offset 2.

i hope for enough information to be given,

scryser

narfbg closed this in 4a7cc76 Oct 24, 2012

@narfbg narfbg added a commit that referenced this issue Oct 24, 2012

@narfbg narfbg Improve fix for #1811 9093042
Contributor

narfbg commented Oct 24, 2012

See the above commits.

@nonchip nonchip pushed a commit to nonchip/CodeIgniter that referenced this issue Jun 29, 2013

@narfbg narfbg Fix #1811 0ba0d9d

@nonchip nonchip pushed a commit to nonchip/CodeIgniter that referenced this issue Jun 29, 2013

@narfbg narfbg Improve fix for #1811 56d24df
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment