summaryrefslogtreecommitdiff
blob: c58d475995ee88a96723328e187dc4cb9da02f4d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
diff --git a/org/gudy/azureus2/core3/util/AddressUtils.java b/org/gudy/azureus2/core3/util/AddressUtils.java
index 6691951..38f14ee 100644
--- a/org/gudy/azureus2/core3/util/AddressUtils.java
+++ b/org/gudy/azureus2/core3/util/AddressUtils.java
@@ -494,11 +494,11 @@ AddressUtils
 			try{
 					// unfortunately we have an incompatible base64 standard in i2p, they replaced / with ~ and + with -
 				
-				char[]	encoded = to_decode.toCharArray();
+				byte[]	encoded = to_decode.getBytes();
 				
 				for ( int i=0;i<encoded.length;i++){
 					
-					char c = encoded[i];
+					byte c = encoded[i];
 					
 					if ( c == '~' ){
 						encoded[i] = '/';
diff --git a/org/gudy/azureus2/pluginsimpl/local/utils/xml/simpleparser/SimpleXMLParserDocumentImpl.java b/org/gudy/azureus2/pluginsimpl/local/utils/xml/simpleparser/SimpleXMLParserDocumentImpl.java
index a67a8a2..da4a46c 100644
--- a/org/gudy/azureus2/pluginsimpl/local/utils/xml/simpleparser/SimpleXMLParserDocumentImpl.java
+++ b/org/gudy/azureus2/pluginsimpl/local/utils/xml/simpleparser/SimpleXMLParserDocumentImpl.java
@@ -25,7 +25,7 @@ package org.gudy.azureus2.pluginsimpl.local.utils.xml.simpleparser;
 import javax.xml.parsers.*;
 
 import org.xml.sax.*;
-import org.apache.commons.lang.Entities;
+import org.apache.commons.lang.StringEscapeUtils;
 import org.gudy.azureus2.core3.util.AENetworkClassifier;
 import org.gudy.azureus2.core3.util.Constants;
 import org.gudy.azureus2.core3.util.Debug;
@@ -656,17 +656,8 @@ SimpleXMLParserDocumentImpl
 		     					replacement = new String( buffer, 0, buffer_pos );
 		     					
 		     				}else{
-		     							     							     					
-			     				int num = Entities.HTML40.entityValue( ref );
-			     					
-		     					if ( num != -1 ){
-		     					
-		     						replacement = "&#" + num + ";";
-		     						
-		     					}else{
-		     						
-		     						replacement = new String( buffer, 0, buffer_pos );
-		     					}
+
+								replacement = StringEscapeUtils.escapeHtml(ref);
 		     				}
 		     				
 		     				char[] chars = replacement.toCharArray();