cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject [8/8] cordova-lib git commit: CB-8551 fixed regex in isValidCprName
Date Thu, 05 Mar 2015 00:37:37 GMT
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 <stevengill97@gmail.com>
Authored: Wed Mar 4 16:37:11 2015 -0800
Committer: Steve Gill <stevengill97@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


Mime
View raw message