Commit 8bff38b3 authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gato

Plugin can now be loaded even if invalid pattern was found.

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk@3363 b35dd754-fafc-0310-a699-88a17e54d16e
parent f7c6a724
......@@ -44,7 +44,13 @@
ContentFilter Plugin Changelog
</h1>
<p><b>1.2.1</b> -- Jan, 2006</p>
<p><b>1.2.2</b> -- January 26, 2006</p>
<ul>
<li>Invalid patter was preventing the plugin from being loaded.</li>
</ul>
<p><b>1.2.1</b> -- January 09, 2006</p>
<ul>
<li>Minor patch to improve handing of email notification failures.</li>
......
......@@ -8,8 +8,8 @@
<name>Content Filter</name>
<description>Scans message packets for defined patterns</description>
<author>Conor Hayes</author>
<version>1.2.1</version>
<date>01/09/2005</date>
<version>1.2.2</version>
<date>01/26/2006</date>
<minServerVersion>2.4.0</minServerVersion>
<!-- UI extension -->
......
......@@ -11,15 +11,6 @@
package org.jivesoftware.wildfire.plugin;
import java.io.File;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;
import javax.mail.internet.MimeUtility;
import org.jivesoftware.util.EmailService;
import org.jivesoftware.util.JiveGlobals;
import org.jivesoftware.util.Log;
......@@ -38,6 +29,15 @@ import org.xmpp.packet.Message;
import org.xmpp.packet.Packet;
import org.xmpp.packet.Presence;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;
import javax.mail.internet.MimeUtility;
import java.io.File;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.regex.PatternSyntaxException;
/**
* Content filter plugin.
*
......@@ -400,7 +400,14 @@ public class ContentFilterPlugin implements Plugin, PacketInterceptor {
// default to "fox,dog"
patterns = JiveGlobals.getProperty(PATTERNS_PROPERTY, "fox,dog");
changeContentFilterPatterns();
try {
changeContentFilterPatterns();
}
catch (PatternSyntaxException e) {
Log.warn("Reseting to default patterns of ContentFilterPlugin", e);
// Existing patterns are invalid so reset to default ones
setPatterns("fox,dog");
}
// default to false
filterStatusEnabled = JiveGlobals.getBooleanProperty(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment