From 71474142ac6a99efb92fb5d758483c832b182652 Mon Sep 17 00:00:00 2001 From: Shish Date: Fri, 19 Jan 2024 11:10:54 +0000 Subject: [PATCH] [themes] don't force http:// upon file:// sources in themes, fixes #1015 --- themes/danbooru/view.theme.php | 5 +---- themes/danbooru2/view.theme.php | 5 +---- themes/lite/view.theme.php | 5 +---- 3 files changed, 3 insertions(+), 12 deletions(-) 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"; }