Somewhat unexpected behaviour with _remap - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Somewhat unexpected behaviour with _remap (/showthread.php?tid=27320) |
Somewhat unexpected behaviour with _remap - El Forum - 02-07-2010 [eluser]Unknown[/eluser] Hi, I'm not sure this is a bug, but I found a somewhat unexpected behaviour with _remap when I wrote a little filemanager app. The url of the file manager controller for browsing a directory looks like this: index.php/filemanager/path/to/directory I'm using the _remap function to override the method calling behaviour of the controller. The problem: If the second uri segment begins with an underscore, CodeIgniter throws a 404 error, because the security checks assume that an evil user wants to access a protected method. I expected that this security check is only necessary when there is no _remap method. As a dirty workarround, I did a little modification to the core. ./system/codeigniter/CodeIgniter.php : - commented out line 178 where the security check is done: Code: if ( ! class_exists($class) - moved the security check to line 202 after the instantiation of the $CI class: Code: $CI = new $class(); It works for me, but I'm not sure it's a good solution... it might be the best not to use _remap in my filemanager controller |