Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions app/src/main/webapp/WEB-INF/jsps/editor/Comments.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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>

Expand Down Expand Up @@ -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>
Expand Down Expand Up @@ -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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,18 @@ public void noDynamicHtmlWrites() throws IOException {
+ 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.
Expand Down
Loading