Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.
  • Root
  • » PHP
  • » [PHP-DEV] Re: Suggestion for get_headers [RSS Feed]

#1 March 10, 2008 01:16:32

Justin M.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[PHP-DEV] Re: Suggestion for get_headers


Justin Martin wrote:Hi there,I have a suggestion regarding get_headers, however I do not have aknowledge of C with which to provide a patch.The function get_headers is, as most will know, used to retrieve headersgenerated by an HTTP request. The primary parameter to this, "string$url", is provided unencoded. Due to this, any request with specialcharacters (i.e. a space), will return 400 BAD REQUEST. My suggestion toremedy this, would be to internally apply the function "urlencode" tothe $url parameter. This would automatically encode any provided URL,while remaining transparent.Any comments?

Thanks,
Justin MartinHi again,Just noticed a discrepancy in my suggestion. I hadn't taken into accountthat urlencode would encode everything, including parts of the domainname. A solution would have to be used to avoid this.Thanks,
Justin Martin

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit:http://www.php.net/unsub.php

Offline

#2 March 10, 2008 12:39:39

Christian S.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[PHP-DEV] Re: Suggestion for get_headers


Justin Martin wrote:
>> headers generated by an HTTP request. The primary parameter to this,
>> "string $url", is provided unencoded. Due to this, any request with
>> special characters (i.e. a space), will return 400 BAD REQUEST. My

Garbage in, garbage out. It is up to you to provide it with a valid URL
(spaces are not allowed in a URL).
Use e.g. http_build_query() for the URL parameters.

Regards,
- Chris

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit:http://www.php.net/unsub.php

Offline

  • Root
  • » PHP
  • » [PHP-DEV] Re: Suggestion for get_headers [RSS Feed]

Board footer

Moderator control

Enjoy the 16th of December
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support