Catch bad commentlink patterns and report them

We now refuse to start the server if a commentlink.match is so
badly malformed that the java.util.regex package can't parse the
expression.  This should catch common errors caused by mismatched
braces or parens in the expression.

Clients now trap expression parse exceptions and try to filter out
the invalid patterns.  Any exceptions are reported back to the
server in the server's error_log, so the site administrator can
take action and correct their server's configuration file.  In the
mean time the patterns are removed from evaulation in the client,
so the site is at least still somewhat useful.

Bug: issue 389
Change-Id: I7df945acc42f74ba48a9e167fecdb20f102522c8
Signed-off-by: Shawn O. Pearce <sop@google.com>
Reviewed-by: Nico Sallembien <nsallembien@google.com>
This commit is contained in:
Shawn O. Pearce
2010-01-26 18:40:07 -08:00
parent fb5bc32d83
commit 82fc819e76
6 changed files with 134 additions and 3 deletions

View File

@@ -20,6 +20,7 @@ import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwtjsonrpc.client.AllowCrossSiteRequest;
import com.google.gwtjsonrpc.client.RemoteJsonService;
import com.google.gwtjsonrpc.client.RpcImpl;
import com.google.gwtjsonrpc.client.VoidResult;
import com.google.gwtjsonrpc.client.RpcImpl.Version;
import java.util.List;
@@ -31,4 +32,6 @@ public interface SystemInfoService extends RemoteJsonService {
@SignInRequired
void contributorAgreements(AsyncCallback<List<ContributorAgreement>> callback);
void clientError(String message, AsyncCallback<VoidResult> callback);
}