From 91889cef2dc16647e6cc12885b4ea9f4b980cd15 Mon Sep 17 00:00:00 2001
From: NCAT <58818829+leroystrubinsky@users.noreply.github.com>
Date: Sat, 1 Feb 2025 15:00:14 -0500
Subject: [PATCH 1/2] HTML links to render correctly
tags & author HTML links do not render correctly. To display properly - modify the PHP code to output the tags without escaping the HTML
---
.../frontend/templates/post/info/author.phtml | 20 ++++++++++---------
view/frontend/templates/post/info/tag.phtml | 2 +-
2 files changed, 12 insertions(+), 10 deletions(-)
diff --git a/view/frontend/templates/post/info/author.phtml b/view/frontend/templates/post/info/author.phtml
index 3bc45621..bde614b8 100644
--- a/view/frontend/templates/post/info/author.phtml
+++ b/view/frontend/templates/post/info/author.phtml
@@ -36,17 +36,19 @@ $modifierName = $modifier !== null ? $modifier->getName() : '';
showAuthorInfo()) : ?>
|
- = $escaper->escapeHtml(__(
- 'By: %1',
- '' . $authorName . ''
- )) ?>
+ = /* @noEscape */ __(
+ 'By: %1',
+ '' . $escaper->escapeHtml($authorName) . ''
+ ) ?>
+
|
- = $escaper->escapeHtml(__(
- 'Modify By: %1 at %2',
- '' . $modifierName . '',
- $block->getDateFormat($_post->getUpdatedAt())
- )) ?>
+ = /* @noEscape */ __(
+ 'Modify By: %1 at %2',
+ '' . $escaper->escapeHtml($modifierName) . '',
+ $block->getDateFormat($_post->getUpdatedAt())
+ ) ?>
+
diff --git a/view/frontend/templates/post/info/tag.phtml b/view/frontend/templates/post/info/tag.phtml
index f781a10c..c8acbcca 100644
--- a/view/frontend/templates/post/info/tag.phtml
+++ b/view/frontend/templates/post/info/tag.phtml
@@ -29,5 +29,5 @@ use Magento\Framework\Escaper;
$_post = $block->getPost();
?>
getTagList($_post)) : ?>
- | = $escaper->escapeHtml(__('Tags: %1', $tagList)); ?>
+ | = __('Tags: ') ?>= $tagList ?>
From e67ecdb087b8ecc748b481214f8fb494b84222b0 Mon Sep 17 00:00:00 2001
From: NCAT <58818829+leroystrubinsky@users.noreply.github.com>
Date: Fri, 21 Feb 2025 14:38:44 -0500
Subject: [PATCH 2/2] HTML tags visible
HTML tags being visible in the frontend for the tags and author
---
view/frontend/templates/post/info/author.phtml | 10 ++++++----
view/frontend/templates/post/info/tag.phtml | 2 +-
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/view/frontend/templates/post/info/author.phtml b/view/frontend/templates/post/info/author.phtml
index bde614b8..0ad5819d 100644
--- a/view/frontend/templates/post/info/author.phtml
+++ b/view/frontend/templates/post/info/author.phtml
@@ -37,16 +37,18 @@ $modifierName = $modifier !== null ? $modifier->getName() : '';
|
= /* @noEscape */ __(
- 'By: %1',
- '' . $escaper->escapeHtml($authorName) . ''
+ 'By: %2',
+ $escaper->escapeUrl($author->getUrl()),
+ $authorName
) ?>
|
= /* @noEscape */ __(
- 'Modify By: %1 at %2',
- '' . $escaper->escapeHtml($modifierName) . '',
+ 'Modify By: %2 at %3',
+ $escaper->escapeUrl($modifier->getUrl()),
+ $modifierName,
$block->getDateFormat($_post->getUpdatedAt())
) ?>
diff --git a/view/frontend/templates/post/info/tag.phtml b/view/frontend/templates/post/info/tag.phtml
index c8acbcca..80e90824 100644
--- a/view/frontend/templates/post/info/tag.phtml
+++ b/view/frontend/templates/post/info/tag.phtml
@@ -29,5 +29,5 @@ use Magento\Framework\Escaper;
$_post = $block->getPost();
?>
getTagList($_post)) : ?>
- | = __('Tags: ') ?>= $tagList ?>
+ | = $escaper->escapeHtml(__('Tags: ')) ?>= /* @noEscape */ $tagList ?>