This is a big can of worms. Web2py restrict allowed chars in the url
because they may be used to build file paths and we want to avoid
problems with incompatible filesystems. Which chars should be allowed,
which ones no? So far we took a conservative approach.

Allowing any char: ((.+)) can result in security issues.

If you really need this you can use routes

routes_is=[('/app/ctrl/func/$anything','/app/ctrl/func?filename=
$anything')]

and use vars instead of args


On Jan 12, 12:51 am, "Xie&Tian" <[email protected]> wrote:
> hi
>
> Recently I've been having problem dealing with url like this:
>
>    http://example.com/app/ctrl/func/%E9%87%91%E5%B1%B1
>
> you can see that the argument to the function is not alphabetical
> characters. They are generated by encodeURIComponent in javascript
> from non-English language. In this case, web2py failed to extract app,
> ctrl and func from the url and gave an "Invalid request" in return.
>
> I find this problem related to regex_url in gluon/main.py: (I
> compressed it for display)
> regex_url = 
> re.compile("(^(/(?P<a>\w+)(/(?P<c>\w+)(/(?P<f>\w+)(\.(?P<e>\w+))?(/(?P<s>([\...@][\=\./]?)+))?)?)?)?/?$)",
> re.X)
>
> so I changed it to:
> regex_url = 
> re.compile("(^(/(?P<a>\w+)(/(?P<c>\w+)(/(?P<f>\w+)(\.(?P<e>\w+))?(/(?P<s>(.+)))?)?)?)?/?$)",
> re.X)
>
> and it works well.
>
> What do you think mdipierro? Did I miss anything?
>
> --
> Luyun Xie
> 谢路云http://magefromhell.blogspot.com/
> (http://blog.hellmage.info/)
-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.


Reply via email to