ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Adding 'Greater Than Sign' (>) to permitted_uri_chars

September 27, 2010 11:55pm

Subscribe [3]
  • #1 / Sep 27, 2010 11:55pm

    jhummel

    21 posts

    I’m working with an api to a service that requires me to use a ‘>’ character in the URL. I’m getting a message when I try to hit the page that says: ‘The URI you submitted has disallowed characters.’ I opened up my config and tried to change the permitted_uri_chars config item to something like: a-z 0-9>~%.:_\\-<>, but it doesn’t seem to work. I tried all kinds of variations like a-z 0-9>~%.:_\\-\<\> or \<\>a-z 0-9>~%.:_\\- and nothing seems to make a difference.

    In desperation I changed the entire permitted_uri_chars config to ‘a-z’. When hitting urls with numbers in them everything seems to work fine. Am I missing something? Does the permitted_uri_chars config actually do anything?

    Thanks!

  • #2 / Sep 28, 2010 2:02pm

    jhummel

    21 posts

    Anybody? I’ve tried removing everything from the permitted_uri_chars config, which according to the comments, should allow everything in a url, but I’m still getting the message

  • #3 / Sep 29, 2010 10:38am

    Sue Crocker

    26054 posts

    Hi, jhummel. You’d need to make a change to a core file, which would need to be changed again with every update.

    Around line 210 of system/expressionengine/core/EE_URI.php, remove <|>| from the string

    if (preg_match("#(;|\?|{|}|<|>|http:\/\/|https:\/\/|\w+:/*[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})#i", $str)) 
            {
                show_error('The URI you submitted has disallowed characters.', 400);
            }

    Does that help?

  • #4 / Sep 30, 2010 2:12am

    jhummel

    21 posts

    Thanks Sue, That did the trick! I hate editing core files, but I think I’m stuck this time.

  • #5 / Sep 30, 2010 5:14pm

    Ingmar

    29245 posts

    Glad to see Sue was able to help. Please post again as needed.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases