You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by st...@apache.org on 2015/03/06 01:27:00 UTC

[24/27] 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/master
Commit: fc73432fa0cd3842891dbd2bbfc23acdc50a16c0
Parents: 037246e
Author: Steve Gill <st...@gmail.com>
Authored: Wed Mar 4 16:37:11 2015 -0800
Committer: Steve Gill <st...@gmail.com>
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