* NetDrive: enable old workarounds for current user-agent string, create 0 byte files when storing without

This commit is contained in:
Ralf Becker 2015-08-04 14:41:43 +00:00
parent d43c2d0b54
commit 7be501ab9f

View File

@ -2701,10 +2701,13 @@ class HTTP_WebDAV_Server
*/
public static function _urlencode($url)
{
// cadaver (and probably all neon using agents) need a more complete url encoding
// otherwise special chars like "$,()'" in filenames do NOT work
// netdrive does NOT use a User-Agent, but requires full urlencoding for non-ascii chars (eg. German Umlauts)
if (strpos($_SERVER['HTTP_USER_AGENT'],'neon') !== false || !isset($_SERVER['HTTP_USER_AGENT']))
// cadaver (and probably all neon using agents) need a more complete url encoding
// otherwise special chars like "$,()'" in filenames do NOT work
if (strpos($_SERVER['HTTP_USER_AGENT'],'neon') !== false ||
// old netdrive does NOT use a User-Agent, but requires full urlencoding for non-ascii chars (eg. German Umlauts)
!isset($_SERVER['HTTP_USER_AGENT']) ||
// current netdrive uses "NetDrive 2.5.8" as user-agent
stripos($_SERVER['HTTP_USER_AGENT'],'NetDrive') !== false)
{
return strtr(rawurlencode($url),array(
'%2F' => '/',