[tag_edit] only add https:// if there is no protocol, see #1015

This commit is contained in:
Shish 2024-01-17 22:42:32 +00:00
parent 50e0d74ee8
commit d8a7ccd894

View file

@ -109,8 +109,8 @@ class TagEditTheme extends Themelet
protected function format_source(string $source = null): HTMLElement
{
if (!empty($source)) {
if (!str_starts_with($source, "http://") && !str_starts_with($source, "https://")) {
$source = "http://" . $source;
if (!str_contains($source, "://")) {
$source = "https://" . $source;
}
$proto_domain = explode("://", $source);
$h_source = $proto_domain[1];