aboutsummaryrefslogtreecommitdiff
path: root/src/java/com/juick/http/www/Utils.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/java/com/juick/http/www/Utils.java')
-rw-r--r--src/java/com/juick/http/www/Utils.java13
1 files changed, 2 insertions, 11 deletions
diff --git a/src/java/com/juick/http/www/Utils.java b/src/java/com/juick/http/www/Utils.java
index 4c41555e..b2d9a999 100644
--- a/src/java/com/juick/http/www/Utils.java
+++ b/src/java/com/juick/http/www/Utils.java
@@ -107,20 +107,11 @@ public class Utils {
}
public static String encodeHTML(String str) {
- String ret = str;
- ret = ret.replaceAll("&", "&");
- ret = ret.replaceAll("<", "&lt;");
- ret = ret.replaceAll(">", "&gt;");
- ret = ret.replaceAll("'", "&apos;");
- ret = ret.replaceAll("\"", "&quot;");
- ret = ret.replaceAll("\n", "&#10;");
- return str;
+ return str.replaceAll("&", "&amp;").replaceAll("<", "&lt;").replaceAll(">", "&gt;").replaceAll("'", "&apos;").replaceAll("\"", "&quot;").replaceAll("\n", "&#10;");
}
public static String encodeSphinx(String str) {
- String ret = str;
- ret = ret.replaceAll("@", "\\\\@");
- return ret;
+ return str.replaceAll("@", "\\\\@");
}
public static String fetchURL(String url) {