Menu

#2 Added a url_encode method as a replacement for strdup

open
nobody
None
5
2010-06-24
2010-06-24
Anonymous
No

I'm providing a url_encode() function to replace the current. It had a /*FIX ME*/ comment in it, here it is.
It should be a drop in replacement.

Function is provided in the self-standing program that test one string which was encoded with PHP
to compare the output.

Discussion

  • Anonymous

    Anonymous - 2010-06-24

    First patch is wrong as it url-encodes the whole URI and it should not. The path should be left as is and not encode '/'s

     
  • Anonymous

    Anonymous - 2010-06-24

    Added a second and updated version of url encode that should handle reserved and unreserved characters better

     
  • Michal Suchanek

    Michal Suchanek - 2012-09-03

    Thanks for these encode function.

    I guess I will need to look up the RFC which specifies what characters should be encoded and make some tests before I replace the strdup with it. Otherwise it might break more URLs than it fixes ;-)

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.