Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Bug in request parameter handling?


Go to End


752 Views

Avatar
jowst

Community Member, 1 Post

30 July 2014 at 3:16am

Hi,

I am trying to handle an url that contains an url encoded url. eg. http://site.com/query/action/http%3A%2F%2Fwww.nu.nl

I am using this in the Controller.

protected static $url_handlers = array(
'getShortenedLink/$Link' => 'getShortenedLink',
'getOriginalLink/$Link' => 'getOriginalLink',
);

And this in the Yaml file:

---
Name: myroutes
After: 'framework/routes#coreroutes'
---
Director:
rules:
'query': 'QueryController'

There are two problems with it. When adding a url-encode slash to the url, I get a non-silverstripe 404. When I leave the encoded http:// out of the url, I do not get the last part of the url. ie. When I add www.site.com to the url, I get www.site in te $Link parameter.

Is this a known problem, or am I doing something stupid???