Skip to content

Commit

Permalink
NOJIRA java.net.URLEncode => java.net.URLEncoder (sakaiproject#7861)
Browse files Browse the repository at this point in the history
* NOJIRA java.net.URLEncode => java.net.URLEncoder

* NOJIRA  java.net.URLEncode => java.net.URLEncoder
  • Loading branch information
axxter99 authored Feb 10, 2020
1 parent 1c825ee commit 44cb9bd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -349,8 +349,8 @@ public String processFormattedText(final String strFromBrowser, StringBuilder er
* WEB Utility -
* Return a string based on id that is fully escaped using URL rules, using a UTF-8 underlying encoding.
*
* Note: java.net.URLEncode.encode() provides a more standard option
* FormattedText.decodeNumericCharacterReferences() undoes this operation
* Note: {@link java.net.URLEncoder#encode(String, String)} provides a more standard option
* {@link FormattedText#decodeNumericCharacterReferences(String)} undoes this operation
*
* @param value
* The string to escape.
Expand All @@ -375,13 +375,13 @@ public String processFormattedText(final String strFromBrowser, StringBuilder er
* into src="URL" or href="URL" places within our markup. There
* are many "valid" URLs that are dangerous unless escaped.
*
* Note: java.net.URLEncode.encode() is not sufficient for because
* Note: {@link java.net.URLEncoder#encode(String, String)} is not sufficient for because
* it encodes the whole string including colons and slashes so
* https://www.sakailms.org/?x=Hello World becomes
* https%3A%2F%2Fwww.sakailms.org%2F%3Fx%3DHello%20World instead of
* https://www.sakailms.org/?x=Hello%20World
*
* java.net.URLEncode.encode() is designed for application/x-www-form-urlencoded
* {@link java.net.URLEncoder#encode(String, String)} is designed for application/x-www-form-urlencoded
* data in forms and as the parameters on GET strings. It is not suitable
* to encode entire URLs prior to embedding them in an href or src attribute.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ public static String escapeJavascript(String value)
* @param id
* The string to escape.
* @return id fully escaped using URL rules.
* @deprecated use {@link java.net.URLEncode#encode(String, String)}
* @deprecated use {@link java.net.URLEncoder#encode(String, String)}
*/
public static String escapeUrl(String id)
{
Expand Down

0 comments on commit 44cb9bd

Please sign in to comment.