Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id A7848200CD7 for ; Tue, 1 Aug 2017 12:07:01 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id A2C5F166D8E; Tue, 1 Aug 2017 10:07:01 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id E981B166D8D for ; Tue, 1 Aug 2017 12:07:00 +0200 (CEST) Received: (qmail 49724 invoked by uid 500); 1 Aug 2017 10:07:00 -0000 Mailing-List: contact commits-help@struts.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@struts.apache.org Delivered-To: mailing list commits@struts.apache.org Received: (qmail 49715 invoked by uid 99); 1 Aug 2017 10:07:00 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Aug 2017 10:07:00 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 66433DFF36; Tue, 1 Aug 2017 10:06:59 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: lukaszlenart@apache.org To: commits@struts.apache.org Message-Id: <55ae05d967a9445aa34197592297afb8@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: struts git commit: Uses better RegEx to improve performance Date: Tue, 1 Aug 2017 10:06:59 +0000 (UTC) archived-at: Tue, 01 Aug 2017 10:07:01 -0000 Repository: struts Updated Branches: refs/heads/support-2-3 54a4dce7b -> 744c1f409 Uses better RegEx to improve performance Project: http://git-wip-us.apache.org/repos/asf/struts/repo Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/744c1f40 Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/744c1f40 Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/744c1f40 Branch: refs/heads/support-2-3 Commit: 744c1f409d983641af3e8e3b573c2f2d2c2c6d9c Parents: 54a4dce Author: Lukasz Lenart Authored: Tue Aug 1 12:01:43 2017 +0200 Committer: Lukasz Lenart Committed: Tue Aug 1 12:01:43 2017 +0200 ---------------------------------------------------------------------- .../xwork2/validator/validators/URLValidator.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/struts/blob/744c1f40/xwork-core/src/main/java/com/opensymphony/xwork2/validator/validators/URLValidator.java ---------------------------------------------------------------------- diff --git a/xwork-core/src/main/java/com/opensymphony/xwork2/validator/validators/URLValidator.java b/xwork-core/src/main/java/com/opensymphony/xwork2/validator/validators/URLValidator.java index 9aa3c9d..b46dea3 100644 --- a/xwork-core/src/main/java/com/opensymphony/xwork2/validator/validators/URLValidator.java +++ b/xwork-core/src/main/java/com/opensymphony/xwork2/validator/validators/URLValidator.java @@ -74,18 +74,18 @@ public class URLValidator extends FieldValidatorSupport { return urlRegex; } else { return "^(https?|ftp):\\/\\/" + - "(([a-z0-9$_\\.\\+!\\*\\'\\(\\),;\\?&=-]|%[0-9a-f]{2})+" + - "(:([a-z0-9$_\\.\\+!\\*\\'\\(\\),;\\?&=-]|%[0-9a-f]{2})+)?" + + "(([a-z0-9$_\\.\\+!\\*\\'\\(\\),;\\?&=\\-]|%[0-9a-f]{2})+" + + "(:([a-z0-9$_\\.\\+!\\*\\'\\(\\),;\\?&=\\-]|%[0-9a-f]{2})+)?" + "@)?(#?" + ")((([a-z0-9]\\.|[a-z0-9][a-z0-9-]*[a-z0-9]\\.)*" + "[a-z][a-z0-9-]*[a-z0-9]" + "|((\\d|[1-9]\\d|1\\d{2}|2[0-4][0-9]|25[0-5])\\.){3}" + "(\\d|[1-9]\\d|1\\d{2}|2[0-4][0-9]|25[0-5])" + ")(:\\d+)?" + - ")(((\\/{0,1}([a-z0-9$_\\.\\+!\\*\\'\\(\\),;:@&=-]|%[0-9a-f]{2})*)*" + - "(\\?([a-z0-9$_\\.\\+!\\*\\'\\(\\),;:@&=-]|%[0-9a-f]{2})*)" + + ")(((\\/([a-z0-9$_\\.\\+!\\*\\'\\(\\),;:@&=\\-]|%[0-9a-f]{2})*)*" + + "(\\?([a-z0-9$_\\.\\+!\\*\\'\\(\\),;:@&=\\-\\/\\:]|%[0-9a-f]{2})*)" + "?)?)?" + - "(#([a-z0-9$_\\.\\+!\\*\\'\\(\\),;:@&=-]|%[0-9a-f]{2})*)?" + + "(#([a-z0-9$_\\.\\+!\\*\\'\\(\\),;:@&=\\-]|%[0-9a-f]{2})*)?" + "$"; } }