From: info at marcel-schlesinger dot de Operating system: PHP version: 6CVS-2008-09-02 (snap) PHP Bug Type: URL related Bug description: urlencode with a safe paremeter
Description: ------------ I looked myself and determined that the RFC3986 is very spongelike. Compared with other programming languages I noticed that everyone differently converts the RFC. In Python there is a nice feature, that you can tell wich chars have to be safe urllib.quote(s, safe='~'). All chars except this one in the safe parameter are escaped. With PHP you could do this only with a search & replace function which isn't very nice. So i want to suggest, to add likewise one more parameter to the urlencode function. Expected result: ---------------- echo urlencode("Test str \"'.-/", array('\'', '"')); output: Test+str+"'%2E%2D%2F ====== echo rawurlencode("Test str \"'.-/", array('\'', '"')); output: Test%20str%20"'%2E%2D%2F Actual result: -------------- echo urlencode("Test str \"'.-/"); output: Test+str+%22%27.-%2F ====== echo rawurlencode("Test str \"'.-/"); output: Test%20str%20%22%27.-%2F -- Edit bug report at http://bugs.php.net/?id=45968&edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=45968&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=45968&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=45968&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=45968&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=45968&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=45968&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=45968&r=needscript Try newer version: http://bugs.php.net/fix.php?id=45968&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=45968&r=support Expected behavior: http://bugs.php.net/fix.php?id=45968&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=45968&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=45968&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=45968&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=45968&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=45968&r=dst IIS Stability: http://bugs.php.net/fix.php?id=45968&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=45968&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=45968&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=45968&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=45968&r=mysqlcfg