mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-04-09 16:38:50 +00:00
fix: absolute urls for images in pixivbridge (#2993)
This commit is contained in:
parent
3c2353c0ec
commit
f40ed566be
@ -224,6 +224,6 @@ class PixivBridge extends BridgeAbstract
|
|||||||
file_put_contents($path, $illust);
|
file_put_contents($path, $illust);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 'cache/pixiv_img/' . preg_replace('/.*\//', '', $path);
|
return get_home_page_url() . 'cache/pixiv_img/' . preg_replace('/.*\//', '', $path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -18,6 +18,21 @@ final class Json
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns e.g. 'https://example.com/' or 'https://example.com/bridge/'
|
||||||
|
*/
|
||||||
|
function get_home_page_url(): string
|
||||||
|
{
|
||||||
|
$https = $_SERVER['HTTPS'] ?? null;
|
||||||
|
$host = $_SERVER['HTTP_HOST'] ?? null;
|
||||||
|
$uri = $_SERVER['REQUEST_URI'] ?? null;
|
||||||
|
if (($pos = strpos($uri, '?')) !== false) {
|
||||||
|
$uri = substr($uri, 0, $pos);
|
||||||
|
}
|
||||||
|
$scheme = $https === 'on' ? 'https' : 'http';
|
||||||
|
return "$scheme://$host$uri";
|
||||||
|
}
|
||||||
|
|
||||||
function create_sane_stacktrace(\Throwable $e): array
|
function create_sane_stacktrace(\Throwable $e): array
|
||||||
{
|
{
|
||||||
$frames = array_reverse($e->getTrace());
|
$frames = array_reverse($e->getTrace());
|
||||||
|
Loading…
Reference in New Issue
Block a user