]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Proxy.php
Add Doxygen headers for multiple function in App
[friendica.git] / src / Module / Proxy.php
index 6287727dce630438d7bbc52ffa3008d956d416d9..ccd00c6040fb8be879ba3e9fef2bdae6e88cf3de 100644 (file)
@@ -45,7 +45,7 @@ class Proxy extends BaseModule
                 *
                 * Question: Do we really need these three methods?
                 */
-               if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE'])) {
+               if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) && isset($_SERVER['HTTP_IF_NONE_MATCH'])) {
                        header('HTTP/1.1 304 Not Modified');
                        header('Last-Modified: ' . gmdate('D, d M Y H:i:s', time()) . ' GMT');
                        header('Etag: ' . $_SERVER['HTTP_IF_NONE_MATCH']);
@@ -139,7 +139,7 @@ class Proxy extends BaseModule
                        $cachefile = get_cachefile(hash('md5', $_REQUEST['url']));
                        if ($cachefile != '' && file_exists($cachefile)) {
                                $img_str = file_get_contents($cachefile);
-                               $mime = image_type_to_mime_type(exif_imagetype($cachefile));
+                               $mime = mime_content_type($cachefile);
 
                                header('Content-type: ' . $mime);
                                header('Last-Modified: ' . gmdate('D, d M Y H:i:s', time()) . ' GMT');
@@ -187,7 +187,7 @@ class Proxy extends BaseModule
 
                        $tempfile = tempnam(get_temppath(), 'cache');
                        file_put_contents($tempfile, $img_str);
-                       $mime = image_type_to_mime_type(exif_imagetype($tempfile));
+                       $mime = mime_content_type($tempfile);
                        unlink($tempfile);
 
                        // If there is an error then return a blank image