X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FUtil%2FProxy.php;h=839442797ef8ed3b7a29bb3df63874266952fe7e;hb=e519b782fd2180d326ffbd9fc8f1d6fca111ce98;hp=87f7c983e1acb4498d08834e9c5f7a02ec2860c9;hpb=c6b45a958e3b09bc8f3950a718c181dfc9e0b910;p=friendica.git diff --git a/src/Util/Proxy.php b/src/Util/Proxy.php index 87f7c983e1..839442797e 100644 --- a/src/Util/Proxy.php +++ b/src/Util/Proxy.php @@ -1,6 +1,6 @@ getBasePath() . '/proxy'; - $shortpath = hash('md5', $url); $longpath = substr($shortpath, 0, 2); - if (is_dir($basepath) && $writemode && !is_dir($basepath . '/' . $longpath)) { - mkdir($basepath . '/' . $longpath); - chmod($basepath . '/' . $longpath, 0777); - } - $longpath .= '/' . strtr(base64_encode($url), '+/', '-_'); // Extract the URL extension @@ -133,13 +133,8 @@ class Proxy } // Too long files aren't supported by Apache - // Writemode in combination with long files shouldn't be possible - if ((strlen($proxypath) > 250) && $writemode) { - return $shortpath; - } elseif (strlen($proxypath) > 250) { + if (strlen($proxypath) > 250) { return DI::baseUrl() . '/proxy/' . $shortpath . '?url=' . urlencode($url); - } elseif ($writemode) { - return $longpath; } else { return $proxypath . $size; }