Welcome Guest, Not a member yet? Register   Sign In
Any way to allow certain URL characters only for a specifc controller?

Is there any way to change the allowed URL characters for a specific controller rather than change them globally? I am integrating a payment processor that needs to post certain characters in the URL to a specific controller but I don't want to compromise the security of the rest of the site.

You could try this:

// set it for modified url.
$this->config->set_item('permitted_uri_chars', 'a-z 0-9~%.:_\-&?');

// your code here!

// set it back for orginal url.
$this->config->set_item('permitted_uri_chars', 'a-z 0-9~%.:_\-');

Another alternative is to use a pre_system hook and change the config setting at run time based on the current URL.

$hook['pre_system'][] = array(
'function' => 'check_chars',
'filename' => 'chars.php',
'filepath' => 'hooks',

function check_chars( ) {
if ( stripos( $_SERVER[ 'REQUEST_URI' ], '/login' ) !== false || stripos( $_SERVER[ 'REQUEST_URI' ], '/register' ) !== false ) {
  $config =& load_class( 'Config', 'core' );
  $config->set_item( 'permitted_uri_chars', '.....' );


Theme © iAndrew 2016 - Forum software by © MyBB