diff --git a/themes/danbooru/view.theme.php b/themes/danbooru/view.theme.php
index 43c4332f..41127900 100644
--- a/themes/danbooru/view.theme.php
+++ b/themes/danbooru/view.theme.php
@@ -43,10 +43,7 @@ class CustomViewPostTheme extends ViewPostTheme
}
if (!is_null($image->source)) {
- $h_source = html_escape($image->source);
- if (substr($image->source, 0, 7) != "http://" && substr($image->source, 0, 8) != "https://") {
- $h_source = "http://" . $h_source;
- }
+ $h_source = html_escape(make_http($image->source));
$html .= "
Source: link";
}
diff --git a/themes/danbooru2/view.theme.php b/themes/danbooru2/view.theme.php
index e795b42f..0c3726ee 100644
--- a/themes/danbooru2/view.theme.php
+++ b/themes/danbooru2/view.theme.php
@@ -44,10 +44,7 @@ class CustomViewPostTheme extends ViewPostTheme
if (!is_null($image->source)) {
- $h_source = html_escape($image->source);
- if (substr($image->source, 0, 7) != "http://" && substr($image->source, 0, 8) != "https://") {
- $h_source = "http://" . $h_source;
- }
+ $h_source = html_escape(make_http($image->source));
$html .= "
Source: link";
}
diff --git a/themes/lite/view.theme.php b/themes/lite/view.theme.php
index aecae4dd..7163a9b2 100644
--- a/themes/lite/view.theme.php
+++ b/themes/lite/view.theme.php
@@ -48,10 +48,7 @@ class CustomViewPostTheme extends ViewPostTheme
if (!is_null($image->source)) {
- $h_source = html_escape($image->source);
- if (substr($image->source, 0, 7) != "http://" && substr($image->source, 0, 8) != "https://") {
- $h_source = "http://" . $h_source;
- }
+ $h_source = html_escape(make_http($image->source));
$html .= "
Source: link";
}