mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-24 12:07:23 +08:00
attachment location starts with http return itself
This commit is contained in:
@@ -44,6 +44,9 @@ abstract class Storage {
|
|||||||
|
|
||||||
public function getImageUrl(string $location): string
|
public function getImageUrl(string $location): string
|
||||||
{
|
{
|
||||||
|
if (str_starts_with($location, "http://") || str_starts_with($location, "https://")) {
|
||||||
|
return $location;
|
||||||
|
}
|
||||||
return sprintf('%s/%s', trim($this->getBaseUrl(), '/'), trim($location, '/'));
|
return sprintf('%s/%s', trim($this->getBaseUrl(), '/'), trim($location, '/'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user