Added support for mastodon images
This commit is contained in:
parent
1d835d9c0f
commit
fdd10a29f1
|
@ -3,7 +3,8 @@
|
|||
$url = trim($_GET['url']);
|
||||
|
||||
# check url matches a https://domain/storage/whatever.jpeg url for images
|
||||
if (preg_match('/^https:\/\/[^\/]+\/storage\/[^\s\%]+\.(png|jpg|jpeg)(\?v=[^\&])?$/', $url)) {
|
||||
if (preg_match('/^https:\/\/[^\/]+\/storage\/[^\s\%]+\.(png|jpg|jpeg)(\?v=[^\&])?$/', $url) ||
|
||||
preg_match('/^https:\/\/[^\/]+\/system\/media_attachments\/[^\s\%]+\.(png|jpg|jpeg)(\?v=[^\&])?$/', $url)) {
|
||||
if (preg_match('/^.*\.png(\?v=[^\&])?$/', $url))
|
||||
header('Content-Type: image/png');
|
||||
else if (preg_match('/^.*\.(jpg|jpeg)(\?v=[^\&])?$/', $url))
|
||||
|
|
Loading…
Reference in New Issue