note 69466 added to function.urlencode
| From: | kL at osu1 dot php dot net | Date: | Thu, 07 Sep 2006 00:13:50 +0000 |
| Subject: | note 69466 added to function.urlencode | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-116788@lists.php.net to get a copy of this message | ||
Apache's mod_rewrite and mod_proxy are unable to handle urlencoded URLs properly - http://issues.apache.org/bugzilla/show_bug.cgi?id=34602
If you need to use any of these modules and handle paths that contain %2F or %3A (and few other
encoded special url characters), you'll have use a different encoding scheme.
My solution is to replace "%" with "'".
<?php
function urlencode($u)
{
return
str_replace(array("'",'%'),array('%27',"'"),urlencode($u));
}
function urldecode($u)
{
return urldecode(strtr($u,"'",'%'));
}
?>
----
Server IP: 85.116.0.130
Probable Submitter: 84.92.248.233
----
Manual Page -- http://www.php.net/manual/en/function.urlencode.php
Edit -- https://master.php.net/note/edit/69466
Del: integrated -- https://master.php.net/note/delete/69466/integrated
Del: useless -- https://master.php.net/note/delete/69466/useless
Del: bad code -- https://master.php.net/note/delete/69466/bad+code
Del: spam -- https://master.php.net/note/delete/69466/spam
Del: non-english -- https://master.php.net/note/delete/69466/non-english
Del: in docs -- https://master.php.net/note/delete/69466/in+docs
Del: other reasons-- https://master.php.net/note/delete/69466
Reject -- https://master.php.net/note/reject/69466
Search -- https://master.php.net/manage/user-notes.php