Skip to content
Merged
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
4 changes: 3 additions & 1 deletion core/src/main/java/org/owasp/encoder/Encode.java
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ public static void forHtmlContent(Writer out, String input)
*
* <b>Example JSP Usage</b>
* <pre>
* &lt;div&gt;&lt;%=Encode.forHtmlAttribute(unsafeData)%&gt;&lt;/div&gt;
* &lt;input value=&quot;&lt;%=Encode.forHtmlAttribute(unsafeData)%&gt;&quot; title=&#39;&lt;%=Encode.forHtmlAttribute(moreUnsafeData)%&gt;&#39; /&gt;
* </pre>
*
* <table border="0" class="memberSummary" summary="Shows the input and results of encoding">
Expand Down Expand Up @@ -276,6 +276,8 @@ public static void forHtmlContent(Writer out, String input)
*
* <p><b>Additional Notes</b></p>
* <ul>
* <li>When using this method, the caller must provide quotes around the attribute value.</li>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't like this phrasing, but I chose it because forHtmlUnquotedAttribute() JavaDocs use similar phrasing.

*
* <li>Both the single-quote character ({@code '}) and the
* double-quote character ({@code "}) are encoded so this is safe
* for HTML attributes with either enclosing character.</li>
Expand Down