From 547e0fb30b1d25a44be63d9ff2961afb7279e1ca Mon Sep 17 00:00:00 2001
From: Floorb <132411956+Neetpone@users.noreply.github.com>
Date: Mon, 27 Feb 2023 05:42:26 -0500
Subject: [PATCH] fix: do not uppercase the tags, fix some other cosmetic
issues.
---
includes/common.php | 2 +-
includes/functions.php | 8 ++------
2 files changed, 3 insertions(+), 7 deletions(-)
diff --git a/includes/common.php b/includes/common.php
index 3656d39..eef5949 100644
--- a/includes/common.php
+++ b/includes/common.php
@@ -241,7 +241,7 @@ $site_info = getSiteInfo();
$global_site_info = $site_info['site_info'];
$row = $site_info['site_info'];
$title = trim($row['title']);
-$baseurl = trim($row['baseurl']);
+$baseurl = paste_protocol() . rtrim(trim($row['baseurl']), '/');
$site_name = trim($row['site_name']);
$email = trim($row['email']);
$additional_scripts = trim($row['additional_scripts']);
diff --git a/includes/functions.php b/includes/functions.php
index 7b8c680..f5e639d 100644
--- a/includes/functions.php
+++ b/includes/functions.php
@@ -8,17 +8,15 @@ function tagsToHtml(array | Collection $tags) : string {
$tag = $tagObj->name;
$tag_lower = strtolower($tag);
if ($tag_lower === 'nsfw' || $tag_lower === 'explicit') {
- $tag = strtoupper($tag);
$tagcolor = "tag is-danger";
} elseif ($tag_lower === 'safe') {
- $tag = strtoupper($tag);
$tagcolor = "tag is-success";
} elseif ($tag[0] === '/' && $tag[-1] === '/') {
$tagcolor = "tag is-primary";
} else {
$tagcolor = "tag is-info";
}
- $output .= '' . pp_html_escape(ucfirst($tag)) . '';
+ $output .= '' . pp_html_escape($tag) . '';
}
return $output;
}
@@ -43,17 +41,15 @@ function tagsToHtmlUser(string | array | Collection $tags, $profile_username) :
foreach ($tagsSplit as $tag) {
$tag_lower = strtolower($tag);
if ($tag_lower === 'nsfw' || $tag_lower === 'explicit') {
- $tag = strtoupper($tag);
$tagcolor = "tag is-danger";
} elseif ($tag_lower === 'safe') {
- $tag = strtoupper($tag);
$tagcolor = "tag is-success";
} elseif ($tag[0] === '/' && $tag[-1] === '/') {
$tagcolor = "tag is-primary";
} else {
$tagcolor = "tag is-info";
}
- $output .= '' . pp_html_escape(ucfirst($tag)) . '';
+ $output .= '' . pp_html_escape($tag) . '';
}
return $output;
}