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

snoopdave pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/roller.git


The following commit(s) were added to refs/heads/master by this push:
     new 6b7e246b2 Use double-quoted href attributes on the comment management 
page (#181)
6b7e246b2 is described below

commit 6b7e246b2dcdcfc87b97a09bf10ec7042b2d67e9
Author: David M. Johnson <[email protected]>
AuthorDate: Mon Sep 7 14:48:09 2026 -0400

    Use double-quoted href attributes on the comment management page (#181)
    
    * Use double-quoted href attributes on the comment management page
    
    The comment management screen wrapped its <s:property/> URL values in
    single-quoted href attributes. This switches them to double-quoted
    attributes, matching the convention already used for URL-valued
    attributes elsewhere in the authoring UI (for example the bookmark URL
    in Bookmarks.jsp), so externally supplied URL values stay contained
    within the attribute.
    
    Adds a rule to AuthoringUiSinkAuditTest asserting the comment author URL
    renders inside a double-quoted href.
    
    Claude-Session: https://claude.ai/code/session_015X69HHQ5XnjRkJP8ymzwFf
    
    * Assert standard comment author link markup
---
 app/src/main/webapp/WEB-INF/jsps/editor/Comments.jsp         | 12 ++++++------
 .../ui/struts2/editor/AuthoringUiSinkAuditTest.java          | 12 ++++++++++++
 2 files changed, 18 insertions(+), 6 deletions(-)

diff --git a/app/src/main/webapp/WEB-INF/jsps/editor/Comments.jsp 
b/app/src/main/webapp/WEB-INF/jsps/editor/Comments.jsp
index 4a9877706..8331c284a 100644
--- a/app/src/main/webapp/WEB-INF/jsps/editor/Comments.jsp
+++ b/app/src/main/webapp/WEB-INF/jsps/editor/Comments.jsp
@@ -112,13 +112,13 @@
                 <ul class="pager">
                     <s:if test="pager.prevLink != null">
                         <li class="previous">
-                            <a href='<s:property value="pager.prevLink" />'>
+                            <a href="<s:property value="pager.prevLink" />">
                                 <span aria-hidden="true">&larr;</span>Newer</a>
                         </li>
                     </s:if>
                     <s:if test="pager.nextLink != null">
                         <li class="next">
-                            <a href='<s:property 
value="pager.nextLink"/>'>Older
+                            <a href="<s:property 
value="pager.nextLink"/>">Older
                                 <span aria-hidden="true">&rarr;</span></a>
                         </li>
                     </s:if>
@@ -246,7 +246,7 @@
 
                                         <div class="details">
                                             <s:text 
name="commentManagement.entryTitled"/>&nbsp;:&nbsp;
-                                            <a href='<s:property 
value="#comment.weblogEntry.permalink" />'>
+                                            <a href="<s:property 
value="#comment.weblogEntry.permalink" />">
                                                 <s:property 
value="#comment.weblogEntry.title"/></a>
                                         </div>
 
@@ -277,7 +277,7 @@
                                         <s:if test="#safeCommentUrl != null">
                                             <div class="details">
                                                 <s:text 
name="commentManagement.commentByURL"/>&nbsp;:&nbsp;
-                                                <a href='<s:property 
value="#safeCommentUrl" escapeHtml="true" />'>
+                                                <a href="<s:property 
value="#safeCommentUrl" escapeHtml="true" />">
                                                     <str:truncateNicely 
upper="60" appendToEnd="..."><s:property
                                                             
value="#safeCommentUrl" escapeHtml="true"/></str:truncateNicely></a>
                                             </div>
@@ -356,13 +356,13 @@
             <ul class="pager">
                 <s:if test="pager.prevLink != null">
                     <li class="previous">
-                        <a href='<s:property value="pager.prevLink" />'>
+                        <a href="<s:property value="pager.prevLink" />">
                             <span aria-hidden="true">&larr;</span>Newer</a>
                     </li>
                 </s:if>
                 <s:if test="pager.nextLink != null">
                     <li class="next">
-                        <a href='<s:property value="pager.nextLink"/>'>Older
+                        <a href="<s:property value="pager.nextLink"/>">Older
                             <span aria-hidden="true">&rarr;</span></a>
                     </li>
                 </s:if>
diff --git 
a/app/src/test/java/org/apache/roller/weblogger/ui/struts2/editor/AuthoringUiSinkAuditTest.java
 
b/app/src/test/java/org/apache/roller/weblogger/ui/struts2/editor/AuthoringUiSinkAuditTest.java
index cf8eac734..e060305f5 100644
--- 
a/app/src/test/java/org/apache/roller/weblogger/ui/struts2/editor/AuthoringUiSinkAuditTest.java
+++ 
b/app/src/test/java/org/apache/roller/weblogger/ui/struts2/editor/AuthoringUiSinkAuditTest.java
@@ -139,6 +139,18 @@ public class AuthoringUiSinkAuditTest {
                         + offenders.size() + ":\n  " + String.join("\n  ", 
offenders));
     }
 
+    /** Comment author URL markup convention, consistent with the authoring 
templates. */
+    @Test
+    public void commentAuthorUrlUsesDoubleQuotedHref() throws IOException {
+        Path comments = JSP_ROOT.resolve("editor/Comments.jsp");
+        String body = new String(Files.readAllBytes(comments), 
StandardCharsets.UTF_8)
+                .replaceAll("\\s+", " ");
+        String expected = "<a href=\"<s:property value=\"#safeCommentUrl\" "
+                + "escapeHtml=\"true\" />\">";
+        assertTrue(body.contains(expected),
+                "Comments.jsp must use the standard comment author URL link 
markup");
+    }
+
     /**
      * Guards the audit itself: if the JSP directory moved or the patterns 
stopped
      * matching anything at all, the three tests above would pass vacuously.

Reply via email to