diff --git a/davmail-setup.nsi b/davmail-setup.nsi
index 24dbe78d..ced99c3f 100644
--- a/davmail-setup.nsi
+++ b/davmail-setup.nsi
@@ -92,7 +92,7 @@ Section "MainSection" SEC01
File "dist\lib\commons-collections-3.1.jar"
File "dist\lib\commons-httpclient-3.1.jar"
File "dist\lib\commons-logging-1.0.4.jar"
- File "dist\lib\htmlcleaner-2.1.jar"
+ File "dist\lib\htmlcleaner-2.2.jar"
File "dist\lib\jackrabbit-webdav-1.4.jar"
File "dist\lib\jcharset-1.3.jar"
File "dist\lib\jcifs-1.3.14.jar"
@@ -167,7 +167,7 @@ no_quest:
Delete "$INSTDIR\lib\commons-collections-3.1.jar"
Delete "$INSTDIR\lib\commons-httpclient-3.1.jar"
Delete "$INSTDIR\lib\commons-logging-1.0.4.jar"
- Delete "$INSTDIR\lib\htmlcleaner-2.1.jar"
+ Delete "$INSTDIR\lib\htmlcleaner-2.2.jar"
Delete "$INSTDIR\lib\jackrabbit-webdav-1.4.jar"
Delete "$INSTDIR\lib\jcharset-1.3.jar"
Delete "$INSTDIR\lib\jcifs-1.3.14.jar"
diff --git a/davmail.jsmooth b/davmail.jsmooth
index ebb7fd20..afd86299 100644
--- a/davmail.jsmooth
+++ b/davmail.jsmooth
@@ -13,7 +13,7 @@
dist/lib/commons-collections-3.1.jar
dist/lib/commons-httpclient-3.1.jar
dist/lib/commons-logging-1.0.4.jar
-dist/lib/htmlcleaner-2.1.jar
+dist/lib/htmlcleaner-2.2.jar
dist/lib/jackrabbit-webdav-1.4.jar
dist/lib/jcharset-1.3.jar
dist/lib/jcifs-1.3.14.jar
diff --git a/davmail64.jsmooth b/davmail64.jsmooth
index 8addd7c9..361f622f 100644
--- a/davmail64.jsmooth
+++ b/davmail64.jsmooth
@@ -13,7 +13,7 @@
dist\lib\commons-collections-3.1.jar
dist\lib\commons-httpclient-3.1.jar
dist\lib\commons-logging-1.0.4.jar
-dist\lib\htmlcleaner-2.1.jar
+dist\lib\htmlcleaner-2.2.jar
dist\lib\jackrabbit-webdav-1.4.jar
dist\lib\jcharset-1.3.jar
dist\lib\jcifs-1.3.14.jar
diff --git a/davmailconsole.jsmooth b/davmailconsole.jsmooth
index 6b11532c..796663c9 100644
--- a/davmailconsole.jsmooth
+++ b/davmailconsole.jsmooth
@@ -13,7 +13,7 @@
dist/lib/commons-collections-3.1.jar
dist/lib/commons-httpclient-3.1.jar
dist/lib/commons-logging-1.0.4.jar
-dist/lib/htmlcleaner-2.1.jar
+dist/lib/htmlcleaner-2.2.jar
dist/lib/jackrabbit-webdav-1.4.jar
dist/lib/jcharset-1.3.jar
dist/lib/jcifs-1.3.14.jar
diff --git a/davmailservice.jsmooth b/davmailservice.jsmooth
index bd78ac7a..de198c7c 100644
--- a/davmailservice.jsmooth
+++ b/davmailservice.jsmooth
@@ -13,7 +13,7 @@
dist/lib/commons-collections-3.1.jar
dist/lib/commons-httpclient-3.1.jar
dist/lib/commons-logging-1.0.4.jar
-dist/lib/htmlcleaner-2.1.jar
+dist/lib/htmlcleaner-2.2.jar
dist/lib/jackrabbit-webdav-1.4.jar
dist/lib/jcharset-1.3.jar
dist/lib/jcifs-1.3.14.jar
diff --git a/lib/htmlcleaner-2.1.jar b/lib/htmlcleaner-2.1.jar
deleted file mode 100644
index ca14f056..00000000
Binary files a/lib/htmlcleaner-2.1.jar and /dev/null differ
diff --git a/lib/htmlcleaner-2.2.jar b/lib/htmlcleaner-2.2.jar
new file mode 100644
index 00000000..cc922d06
Binary files /dev/null and b/lib/htmlcleaner-2.2.jar differ
diff --git a/pom.xml b/pom.xml
index e4514b85..b84c6b68 100644
--- a/pom.xml
+++ b/pom.xml
@@ -244,7 +244,7 @@
net.sourceforge.htmlcleaner
htmlcleaner
- 2.1
+ 2.2
diff --git a/src/java/davmail/exchange/ExchangeSession.java b/src/java/davmail/exchange/ExchangeSession.java
index 89e83500..904bd71c 100644
--- a/src/java/davmail/exchange/ExchangeSession.java
+++ b/src/java/davmail/exchange/ExchangeSession.java
@@ -33,8 +33,8 @@ import org.apache.commons.httpclient.methods.PostMethod;
import org.apache.commons.httpclient.params.HttpClientParams;
import org.apache.commons.httpclient.util.URIUtil;
import org.apache.log4j.Logger;
-import org.htmlcleaner.CommentToken;
-import org.htmlcleaner.ContentToken;
+import org.htmlcleaner.CommentNode;
+import org.htmlcleaner.ContentNode;
import org.htmlcleaner.HtmlCleaner;
import org.htmlcleaner.TagNode;
@@ -475,8 +475,8 @@ public abstract class ExchangeSession {
for (Object script : scriptList) {
List contents = ((TagNode) script).getChildren();
for (Object content : contents) {
- if (content instanceof CommentToken) {
- String scriptValue = ((CommentToken) content).getCommentedContent();
+ if (content instanceof CommentNode) {
+ String scriptValue = ((CommentNode) content).getCommentedContent();
String sUrl = StringUtil.getToken(scriptValue, "var a_sUrl = \"", "\"");
String sLgn = StringUtil.getToken(scriptValue, "var a_sLgnQS = \"", "\"");
if (sLgn == null) {
@@ -489,9 +489,9 @@ public abstract class ExchangeSession {
logonMethod = buildLogonMethod(httpClient, newInitMethod);
}
- } else if (content instanceof ContentToken) {
+ } else if (content instanceof ContentNode) {
// Microsoft Forefront Unified Access Gateway redirect
- String scriptValue = ((ContentToken) content).getContent();
+ String scriptValue = ((ContentNode) content).getContent().toString();
String location = StringUtil.getToken(scriptValue, "window.location.replace(\"", "\"");
if (location != null) {
LOGGER.debug("Post logon redirect to: " + location);
diff --git a/src/winrun4j/davmail.exe b/src/winrun4j/davmail.exe
index 8a3db9c9..779f2795 100644
Binary files a/src/winrun4j/davmail.exe and b/src/winrun4j/davmail.exe differ
diff --git a/src/winrun4j/davmail.ini b/src/winrun4j/davmail.ini
index bf637c35..80bc9dd6 100644
--- a/src/winrun4j/davmail.ini
+++ b/src/winrun4j/davmail.ini
@@ -5,7 +5,7 @@ classpath.3=lib/commons-codec-1.3.jar
classpath.4=lib/commons-collections-3.1.jar
classpath.5=lib/commons-httpclient-3.1.jar
classpath.6=lib/commons-logging-1.0.4.jar
-classpath.7=lib/htmlcleaner-2.1.jar
+classpath.7=lib/htmlcleaner-2.2.jar
classpath.8=lib/jackrabbit-webdav-1.4.jar
classpath.9=lib/jcharset-1.3.jar
classpath.10=lib/jcifs-1.3.14.jar
diff --git a/src/winrun4j/davmail64.exe b/src/winrun4j/davmail64.exe
index 6329c396..1d6b5354 100644
Binary files a/src/winrun4j/davmail64.exe and b/src/winrun4j/davmail64.exe differ
diff --git a/src/winrun4j/davmail64.ini b/src/winrun4j/davmail64.ini
index 8a9f909a..c58ae129 100644
--- a/src/winrun4j/davmail64.ini
+++ b/src/winrun4j/davmail64.ini
@@ -5,7 +5,7 @@ classpath.3=lib/commons-codec-1.3.jar
classpath.4=lib/commons-collections-3.1.jar
classpath.5=lib/commons-httpclient-3.1.jar
classpath.6=lib/commons-logging-1.0.4.jar
-classpath.7=lib/htmlcleaner-2.1.jar
+classpath.7=lib/htmlcleaner-2.2.jar
classpath.8=lib/jackrabbit-webdav-1.4.jar
classpath.9=lib/jcharset-1.3.jar
classpath.10=lib/jcifs-1.3.14.jar