temp hack fix for many images

This commit is contained in:
Jeremy Kauffman 2017-03-29 21:03:37 -04:00
parent c66c6c6afd
commit 411348d341
2 changed files with 3 additions and 3 deletions

View file

@ -23,7 +23,7 @@ class LBRY
{
throw new Exception($responseData['error']['message'] ?? 'Something unknown went wrong');
}
if (isset($responseData['result']))
if (isset($responseData['result']))
{
return $responseData['result'];
}
@ -66,7 +66,6 @@ class LBRY
return
//TODO: Expand these checks AND verify it is an image claim!
($metadata['license'] == "Public Domain" || stripos($metadata['license'], 'Creative Commons') !== false) &&
in_array($metadata['content_type'], ['image/jpeg', 'image/png']) &&
!isset($metadata['fee']);
});

View file

@ -11,7 +11,8 @@ if ($claim)
if (isset($getResult['completed']) && $getResult['completed'] && isset($getResult['download_path']))
{
$path = $getResult['download_path'];
header('Content-type: ' . $getResult['metadata']['content_type']);
// $validType = isset($getResult['content_type']) && in_array($getResult['content_type'], ['image/jpeg', 'image/png']);
header('Content-type: image/jpeg');
header('Content-length: ' . filesize($path));
readfile($getResult['download_path']);
}