Return-Path: X-Original-To: apmail-cordova-commits-archive@www.apache.org Delivered-To: apmail-cordova-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 19AD317577 for ; Thu, 5 Mar 2015 00:37:31 +0000 (UTC) Received: (qmail 24494 invoked by uid 500); 5 Mar 2015 00:37:30 -0000 Delivered-To: apmail-cordova-commits-archive@cordova.apache.org Received: (qmail 24404 invoked by uid 500); 5 Mar 2015 00:37:30 -0000 Mailing-List: contact commits-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list commits@cordova.apache.org Received: (qmail 24247 invoked by uid 99); 5 Mar 2015 00:37:30 -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; Thu, 05 Mar 2015 00:37:30 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 65502E03AF; Thu, 5 Mar 2015 00:37:30 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: steven@apache.org To: commits@cordova.apache.org Date: Thu, 05 Mar 2015 00:37:37 -0000 Message-Id: <775c79009f0344e187ab63eca456766b@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [8/8] cordova-lib git commit: CB-8551 fixed regex in isValidCprName CB-8551 fixed regex in isValidCprName Project: http://git-wip-us.apache.org/repos/asf/cordova-lib/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-lib/commit/fc73432f Tree: http://git-wip-us.apache.org/repos/asf/cordova-lib/tree/fc73432f Diff: http://git-wip-us.apache.org/repos/asf/cordova-lib/diff/fc73432f Branch: refs/heads/CB-8551 Commit: fc73432fa0cd3842891dbd2bbfc23acdc50a16c0 Parents: 037246e Author: Steve Gill Authored: Wed Mar 4 16:37:11 2015 -0800 Committer: Steve Gill Committed: Wed Mar 4 16:37:11 2015 -0800 ---------------------------------------------------------------------- cordova-lib/src/plugman/registry/registry.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/fc73432f/cordova-lib/src/plugman/registry/registry.js ---------------------------------------------------------------------- diff --git a/cordova-lib/src/plugman/registry/registry.js b/cordova-lib/src/plugman/registry/registry.js index 079c5a0..cdbe90b 100644 --- a/cordova-lib/src/plugman/registry/registry.js +++ b/cordova-lib/src/plugman/registry/registry.js @@ -383,14 +383,17 @@ function fetchPlugin(plugin, client, useNpmRegistry) { * @return {Boolean} if plugin id is reverse domain name style. */ function isValidCprName(plugin) { - //Create regex that checks for at least two dots with any characters except @ to determine if it is reverse domain name style. Also makes sure not to match @VERSION. - var matches = /([^@]*\.[^@]*\.[^@]*[^@\d])/.exec(plugin) - + // Split @Version from the plugin if it exists. + var splitVersion = plugin.split('@'); + + //Create regex that checks for at least two dots with any characters except @ to determine if it is reverse domain name style. + var matches = /([^@]*\.[^@]*\.[^@]*)/.exec(splitVersion[0]) + //If matches equals null, plugin is not reverse domain name style - if(matches === null) { + if(matches === null) { return false; } else { - warnIfIdInMapper(plugin, matches); + warnIfIdInMapper(splitVersion[0], matches); } return true } --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org For additional commands, e-mail: commits-help@cordova.apache.org