- // Is no http in front of it?
- /// @TODO To weak test for being a valid URL
- if (substr($url, 0, 4) !== 'http') {
- return $url;
- }
-
- // Only continue if it isn't a local image and the isn't deactivated
- if (self::isLocalImage($url)) {
- $url = str_replace(Strings::normaliseLink(DI::baseUrl()) . '/', DI::baseUrl() . '/', $url);
- return $url;
- }
-
- // Is the proxy disabled?
- if (DI::config()->get('system', 'proxy_disabled')) {
+ // Quit if not an HTTP/HTTPS link or if local
+ if (!in_array(parse_url($url, PHP_URL_SCHEME), ['http', 'https']) || self::isLocalImage($url)) {