Skip to content

Commit

Permalink
MDL-90 PEAR/HTTP/WebDAV: fix file name encoding ... for real this time?
Browse files Browse the repository at this point in the history
Cherry picked from upstream.
  • Loading branch information
martinlanghoff committed Feb 27, 2008
1 parent ed997a6 commit 351b7cd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/pear/HTTP/WebDAV/Server.php
Expand Up @@ -714,6 +714,9 @@ function http_PROPFIND()
collections end in a slash, this should be done in here
by checking the resource attribute */
$href = $this->_mergePathes($this->_SERVER['SCRIPT_NAME'], $path);

/* minimal urlencoding is needed for the resource path */
$href = $this->_urlencode($href);

echo " <D:href>$href</D:href>\n";

Expand Down Expand Up @@ -2008,7 +2011,7 @@ function http_status($status)
/**
* private minimalistic version of PHP urlencode()
*
* only blanks and XML special chars must be encoded here
* only blanks, percent and XML special chars must be encoded here
* full urlencode() encoding confuses some clients ...
*
* @param string URL to encode
Expand All @@ -2017,6 +2020,7 @@ function http_status($status)
function _urlencode($url)
{
return strtr($url, array(" "=>"%20",
"%"=>"%25",
"&"=>"%26",
"<"=>"%3C",
">"=>"%3E",
Expand Down

0 comments on commit 351b7cd

Please sign in to comment.