Welcome Guest, Not a member yet? Register   Sign In
Having Trouble Using A URL As A Parameter
#1

[eluser]helloworldly[/eluser]
Is it possible to use the URI segment method when you are trying to want a parameter to be a url? Or does the path need to use query strings? Or something I'm missing? What do folks recommend?

Would be nice to have something like this:

http://example.com/some_class_name/some_...ing!23.xml

But I get an Apache 404 error, which, by the way, seems to prematurely decodes the url parameter:

"The requested URL /some_class_name/some_function_name/http://somesite.com/something/2123.xml was not found on this server."

Thanks for any help!
#2

[eluser]Twisted1919[/eluser]
You can allow ( and ) in the url like allowed chars , then pass your url like :
blah.com/controller/method/(http://myfancysite/with/a/link/to/a/xml.file)
Didn't tried but must work as long as you don't have other chars in the uri .
#3

[eluser]bretticus[/eluser]
Man, loading anonymous content via browser URI seems a little scary to me. Hope you have a good filtering mechanism in place!
#4

[eluser]helloworldly[/eluser]
Thanks folks.

@Twisted1919 :

An Error Was Encountered
The URI you submitted has disallowed characters.

Url was a twitter rss feed: so:
(http://twitter.com/statuses/user_timeline/123456789.rss)

@bretticus:
The url is an optional way to pass a feed url to be processed by SimplePie parser. Should I reconsider?

Thanks again!
#5

[eluser]helloworldly[/eluser]
Ah, @Twisted1919 "You can allow ( and ) in the url like allowed chars"...

Didn't know about $config['permitted_uri_chars']. Works. Thanks much @Twisted1919.

Now, re: @bretticus, is the question of whether I should even be doing this!
#6

[eluser]bretticus[/eluser]
I suppose that depends on how much you trust SimplePie. It's just that you are effectively allowing anyone to have your PHP code load any document of their choosing. I have no idea how SimplePie loads/parses a remote document. If it's an option, they may just have it locked down tight. However, unless you need to let you users pop in any feed of their choosing, you could always just provide a list of urls (or websites) that you trust. IF the URL is not part of that domain, reject it. On the other hand, I think I remember seeing SimplePie demo with a write in text field to do exactly what you are doing.




Theme © iAndrew 2016 - Forum software by © MyBB