summaryrefslogtreecommitdiff
path: root/net-p2p/vuze/files/vuze-5.7.6.0-commons-lang.patch
blob: a03995d167a60fdc699b9cb2b0fa30b4c5a3bc38 (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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
diff --git a/com/aelitis/azureus/core/metasearch/Result.java b/com/aelitis/azureus/core/metasearch/Result.java
index bec05e1..9588f9a 100644
--- a/com/aelitis/azureus/core/metasearch/Result.java
+++ b/com/aelitis/azureus/core/metasearch/Result.java
@@ -28,7 +28,7 @@ import java.util.Locale;
 import java.util.Map;
 import java.util.Random;
 
-import org.apache.commons.lang.Entities;
+import org.apache.commons.text.StringEscapeUtils;
 import org.gudy.azureus2.core3.util.AENetworkClassifier;
 import org.gudy.azureus2.core3.util.DisplayFormatters;
 import org.gudy.azureus2.core3.util.HostNameToIPResolver;
@@ -464,6 +464,6 @@ public abstract class Result {
 		if ( input == null ){
 			return( null );
 		}
-		return( Entities.HTML40.unescape( input ));
+		return( StringEscapeUtils.unescapeHtml4( input ));
 	}
 }
diff --git a/com/aelitis/azureus/core/metasearch/impl/web/WebResult.java b/com/aelitis/azureus/core/metasearch/impl/web/WebResult.java
index 2d353b8..e03916b 100644
--- a/com/aelitis/azureus/core/metasearch/impl/web/WebResult.java
+++ b/com/aelitis/azureus/core/metasearch/impl/web/WebResult.java
@@ -22,7 +22,7 @@ package com.aelitis.azureus.core.metasearch.impl.web;
 import java.util.Date;
 import java.util.StringTokenizer;
 
-import org.apache.commons.lang.*;
+import org.apache.commons.text.StringEscapeUtils;
 import org.gudy.azureus2.core3.util.Base32;
 import org.gudy.azureus2.core3.util.ByteFormatter;
 import org.gudy.azureus2.core3.util.Debug;
@@ -87,14 +87,14 @@ public class WebResult extends Result {
 	public void setNameFromHTML(String name) {
 		if(name != null) {
 			name = removeHTMLTags(name);
-			this.name = Entities.HTML40.unescape(name);
+			this.name = StringEscapeUtils.unescapeHtml4(name);
 		}
 	}
 	
 	public void setCommentsFromHTML(String comments) {
 		if(comments != null) {
 			comments = removeHTMLTags(comments);
-			comments = Entities.HTML40.unescape(comments);
+			comments = StringEscapeUtils.unescapeHtml4(comments);
 			comments = comments.replaceAll(",", "");
 			comments = comments.replaceAll(" ", "");
 			try{
@@ -107,7 +107,7 @@ public class WebResult extends Result {
 	public void setCategoryFromHTML(String category) {
 		if(category != null) {
 			category = removeHTMLTags(category);
-			this.category = Entities.HTML40.unescape(category).trim();
+			this.category = StringEscapeUtils.unescapeHtml4(category).trim();
 			/*int separator = this.category.indexOf(">");
 			
 			if(separator != -1) {
@@ -136,7 +136,7 @@ public class WebResult extends Result {
 	public void setNbPeersFromHTML(String nbPeers) {
 		if(nbPeers != null) {
 			nbPeers = removeHTMLTags(nbPeers);
-			String nbPeersS = Entities.HTML40.unescape(nbPeers);
+			String nbPeersS = StringEscapeUtils.unescapeHtml4(nbPeers);
 			nbPeersS = nbPeersS.replaceAll(",", "");
 			nbPeersS = nbPeersS.replaceAll(" ", "");
 			try {
@@ -151,7 +151,7 @@ public class WebResult extends Result {
 	public void setNbSeedsFromHTML(String nbSeeds) {
 		if(nbSeeds != null) {
 			nbSeeds = removeHTMLTags(nbSeeds);
-			String nbSeedsS = Entities.HTML40.unescape(nbSeeds);
+			String nbSeedsS = StringEscapeUtils.unescapeHtml4(nbSeeds);
 			nbSeedsS = nbSeedsS.replaceAll(",", "");
 			nbSeedsS = nbSeedsS.replaceAll(" ", "");
 			try {
@@ -166,7 +166,7 @@ public class WebResult extends Result {
 	public void setNbSuperSeedsFromHTML(String nbSuperSeeds) {
 		if(nbSuperSeeds != null) {
 			nbSuperSeeds = removeHTMLTags(nbSuperSeeds);
-			String nbSuperSeedsS = Entities.HTML40.unescape(nbSuperSeeds);
+			String nbSuperSeedsS = StringEscapeUtils.unescapeHtml4(nbSuperSeeds);
 			nbSuperSeedsS = nbSuperSeedsS.replaceAll(",", "");
 			nbSuperSeedsS = nbSuperSeedsS.replaceAll(" ", "");
 			try {
@@ -248,7 +248,7 @@ public class WebResult extends Result {
 	public void setPublishedDateFromHTML(String publishedDate) {
 		if(publishedDate != null && publishedDate.length() > 0) {
 			publishedDate = removeHTMLTags(publishedDate);
-			String publishedDateS = Entities.HTML40.unescape(publishedDate).replace((char)160,(char)32);
+			String publishedDateS = StringEscapeUtils.unescapeHtml4(publishedDate).replace((char)160,(char)32);
 			this.publishedDate = dateParser.parseDate(publishedDateS);
 		}
 	}
@@ -257,7 +257,7 @@ public class WebResult extends Result {
 	public void setSizeFromHTML(String size) {
 		if(size != null) {
 			size = removeHTMLTags(size);
-			String sizeS = Entities.HTML40.unescape(size).replace((char)160,(char)32);
+			String sizeS = StringEscapeUtils.unescapeHtml4(size).replace((char)160,(char)32);
 			sizeS = sizeS.replaceAll("<[^>]+>", " ");
 			//Add a space between the digits and unit if there is none
 			sizeS = sizeS.replaceFirst("(\\d)([a-zA-Z])", "$1 $2");
@@ -303,7 +303,7 @@ public class WebResult extends Result {
 	public void setVotesFromHTML(String votes_str) {
 		if(votes_str != null) {
 			votes_str = removeHTMLTags(votes_str);
-			votes_str = Entities.HTML40.unescape(votes_str);
+			votes_str = StringEscapeUtils.unescapeHtml4(votes_str);
 			votes_str = votes_str.replaceAll(",", "");
 			votes_str = votes_str.replaceAll(" ", "");
 			try {
@@ -317,7 +317,7 @@ public class WebResult extends Result {
 	public void setVotesDownFromHTML(String votes_str) {
 		if(votes_str != null) {
 			votes_str = removeHTMLTags(votes_str);
-			votes_str = Entities.HTML40.unescape(votes_str);
+			votes_str = StringEscapeUtils.unescapeHtml4(votes_str);
 			votes_str = votes_str.replaceAll(",", "");
 			votes_str = votes_str.replaceAll(" ", "");
 			try {
diff --git a/org/gudy/azureus2/core3/util/AddressUtils.java b/org/gudy/azureus2/core3/util/AddressUtils.java
index 2558313..8cafd8a 100644
--- a/org/gudy/azureus2/core3/util/AddressUtils.java
+++ b/org/gudy/azureus2/core3/util/AddressUtils.java
@@ -592,11 +592,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 1035997..5270c35 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.text.StringEscapeUtils;
 import org.gudy.azureus2.core3.util.AENetworkClassifier;
 import org.gudy.azureus2.core3.util.Constants;
 import org.gudy.azureus2.core3.util.Debug;
@@ -679,17 +679,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.escapeHtml4(ref);
 		     				}
 		     				
 		     				char[] chars = replacement.toCharArray();