This is an automated email from the ASF dual-hosted git repository.

snoopdave pushed a commit to branch blogroll-plain-text
in repository https://gitbox.apache.org/repos/asf/roller.git

commit 3a2fe384393b0afd7d6c8183578850ac3e90b211
Author: David M. Johnson <[email protected]>
AuthorDate: Thu Oct 29 23:09:25 2026 -0400

    Show blogroll names and descriptions as plain text
    
    Roller can store a bookmark's name and description as sanitized HTML, so
    escaping them in the blogroll macro showed entities such as &#39; and
    &quot; on weblog pages. The macro now removes tags, decodes entities and
    escapes the result once.
---
 CHANGES.md                                     |  3 ++-
 app/src/main/webapp/WEB-INF/velocity/weblog.vm | 10 ++++++++--
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/CHANGES.md b/CHANGES.md
index 2bee3d9a1..c63e2de41 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -69,7 +69,8 @@
   in the log. A feed URL that is not one is dropped. Blogroll links shown on
   weblog pages must be relative or use `http`, `https`, `ftp` or `mailto`;
   other links, and links with `&` before the path, are shown without a
-  target. The blogroll escapes bookmark names and descriptions.
+  target. The blogroll shows bookmark names and descriptions as plain text,
+  without HTML formatting.
 - **The user picker matches user names only, except for global admins.** When
   a user who is not a global admin searches for users (for example to invite a
   member), only user names are matched. Global admins can still search by
diff --git a/app/src/main/webapp/WEB-INF/velocity/weblog.vm 
b/app/src/main/webapp/WEB-INF/velocity/weblog.vm
index 2d9886c2e..8ff106515 100644
--- a/app/src/main/webapp/WEB-INF/velocity/weblog.vm
+++ b/app/src/main/webapp/WEB-INF/velocity/weblog.vm
@@ -477,9 +477,15 @@ Show bookmarks as a HTML ul list.
     #set($divId = $utils.replace($folderObject.name, " ", "_" ))
     #foreach($bookmark in $bookmarks)
         <li class="rFolderItem">
+        ## name and description may be stored as sanitized HTML; show them
+        ## as plain text, escaped once
+        #set($bookmarkName = "")
+        #set($bookmarkDescription = "")
+        #set($bookmarkName = 
$utils.unescapeHTML($utils.removeHTML($bookmark.name, false)))
+        #set($bookmarkDescription = 
$utils.unescapeHTML($utils.removeHTML($bookmark.description, false)))
         #if($utils.isNotEmpty($bookmark.Image))
           <a href="$utils.escapeHTML($bookmark.url)">
-             <img alt="$utils.escapeHTML($bookmark.description)" border="0"
+             <img alt="$!utils.escapeHTML($bookmarkDescription)" border="0"
                 src="$utils.escapeHTML($bookmark.image)" class="rBookmark" 
/></a>
         #else
             #if($utils.isNotEmpty( $bookmark.FeedUrl))
@@ -487,7 +493,7 @@ Show bookmarks as a HTML ul list.
                src="$url.absoluteSite/images/smrssbadge.gif"
                alt="$text.get("macro.bookmark.urlFeed")"/></a>
             #end
-            <a href="$utils.escapeHTML($bookmark.url)" 
title="$utils.escapeHTML($bookmark.description)">$utils.escapeHTML($bookmark.name)</a>
+            <a href="$utils.escapeHTML($bookmark.url)" 
title="$!utils.escapeHTML($bookmarkDescription)">$!utils.escapeHTML($bookmarkName)</a>
         #end
         </li>
     #end

Reply via email to