Fixed Magento version detection

main
Elbert Alias 12 years ago
parent 3b80cec0ba
commit fd61705db0

@ -79,13 +79,20 @@ var wappalyzer = (function() {
matches = pattern.regex.exec(value) matches = pattern.regex.exec(value)
; ;
w.log({ matches: matches, version: version });
if ( matches ) { if ( matches ) {
matches.map(function(match, i) { matches.map(function(match, i) {
// Parse ternary operator // Parse ternary operator
var ternary = new RegExp('\\\\' + i + '\\?([^:]+):(.+)$').exec(version); var ternary = new RegExp('\\\\' + i + '\\?([^:]+):(.+)$').exec(version);
if ( ternary && ternary.length === 3 ) { if ( ternary && ternary.length === 3 ) {
w.log({ match: match, i: i, ternary: ternary });
version = version.replace(ternary[0], match ? ternary[1] : ternary[2]); version = version.replace(ternary[0], match ? ternary[1] : ternary[2]);
w.log({ version: version });
} }
// Replace back references // Replace back references

@ -1129,7 +1129,7 @@
"meta": { "generator": "Joomla!(?: ([\\d.]+))?\\;version:\\1" }, "meta": { "generator": "Joomla!(?: ([\\d.]+))?\\;version:\\1" },
"html": "(?:<div[^>]+id=\"wrapper_r\"|<[^>]+(?:feed|components)/com_|<table[^>]+class=\"pill)\\;confidence:50", "html": "(?:<div[^>]+id=\"wrapper_r\"|<[^>]+(?:feed|components)/com_|<table[^>]+class=\"pill)\\;confidence:50",
"headers": { "X-Content-Encoded-By": "Joomla! ([\\d.]+)\\;version:\\1" }, "headers": { "X-Content-Encoded-By": "Joomla! ([\\d.]+)\\;version:\\1" },
"env": "^jcomments$", "env": "^(jcomments|Joomla)$",
"implies": "PHP" "implies": "PHP"
}, },
"jqPlot": { "jqPlot": {
@ -1323,7 +1323,7 @@
"Magento": { "Magento": {
"website": "www.magentocommerce.com", "website": "www.magentocommerce.com",
"cats": [ 6 ], "cats": [ 6 ],
"script": "(?:js/mage|skin/frontend/(?:default|(enterprise)))\\;version:\\1?Enterprise:Community", "script": [ "js/mage", "skin/frontend/(?:default|(enterprise))\\;version:\\1?Enterprise:Community" ],
"headers": { "Set-Cookie": "frontend=\\;confidence:50" }, "headers": { "Set-Cookie": "frontend=\\;confidence:50" },
"env": "^(?:Mage|VarienForm)$", "env": "^(?:Mage|VarienForm)$",
"implies": "PHP" "implies": "PHP"

@ -1129,7 +1129,7 @@
"meta": { "generator": "Joomla!(?: ([\\d.]+))?\\;version:\\1" }, "meta": { "generator": "Joomla!(?: ([\\d.]+))?\\;version:\\1" },
"html": "(?:<div[^>]+id=\"wrapper_r\"|<[^>]+(?:feed|components)/com_|<table[^>]+class=\"pill)\\;confidence:50", "html": "(?:<div[^>]+id=\"wrapper_r\"|<[^>]+(?:feed|components)/com_|<table[^>]+class=\"pill)\\;confidence:50",
"headers": { "X-Content-Encoded-By": "Joomla! ([\\d.]+)\\;version:\\1" }, "headers": { "X-Content-Encoded-By": "Joomla! ([\\d.]+)\\;version:\\1" },
"env": "^jcomments$", "env": "^(jcomments|Joomla)$",
"implies": "PHP" "implies": "PHP"
}, },
"jqPlot": { "jqPlot": {
@ -1323,7 +1323,7 @@
"Magento": { "Magento": {
"website": "www.magentocommerce.com", "website": "www.magentocommerce.com",
"cats": [ 6 ], "cats": [ 6 ],
"script": "(?:js/mage|skin/frontend/(?:default|(enterprise)))\\;version:\\1?Enterprise:Community", "script": [ "js/mage", "skin/frontend/(?:default|(enterprise))\\;version:\\1?Enterprise:Community" ],
"headers": { "Set-Cookie": "frontend=\\;confidence:50" }, "headers": { "Set-Cookie": "frontend=\\;confidence:50" },
"env": "^(?:Mage|VarienForm)$", "env": "^(?:Mage|VarienForm)$",
"implies": "PHP" "implies": "PHP"

@ -79,13 +79,20 @@ var wappalyzer = (function() {
matches = pattern.regex.exec(value) matches = pattern.regex.exec(value)
; ;
w.log({ matches: matches, version: version });
if ( matches ) { if ( matches ) {
matches.map(function(match, i) { matches.map(function(match, i) {
// Parse ternary operator // Parse ternary operator
var ternary = new RegExp('\\\\' + i + '\\?([^:]+):(.+)$').exec(version); var ternary = new RegExp('\\\\' + i + '\\?([^:]+):(.+)$').exec(version);
if ( ternary && ternary.length === 3 ) { if ( ternary && ternary.length === 3 ) {
w.log({ match: match, i: i, ternary: ternary });
version = version.replace(ternary[0], match ? ternary[1] : ternary[2]); version = version.replace(ternary[0], match ? ternary[1] : ternary[2]);
w.log({ version: version });
} }
// Replace back references // Replace back references

@ -1129,7 +1129,7 @@
"meta": { "generator": "Joomla!(?: ([\\d.]+))?\\;version:\\1" }, "meta": { "generator": "Joomla!(?: ([\\d.]+))?\\;version:\\1" },
"html": "(?:<div[^>]+id=\"wrapper_r\"|<[^>]+(?:feed|components)/com_|<table[^>]+class=\"pill)\\;confidence:50", "html": "(?:<div[^>]+id=\"wrapper_r\"|<[^>]+(?:feed|components)/com_|<table[^>]+class=\"pill)\\;confidence:50",
"headers": { "X-Content-Encoded-By": "Joomla! ([\\d.]+)\\;version:\\1" }, "headers": { "X-Content-Encoded-By": "Joomla! ([\\d.]+)\\;version:\\1" },
"env": "^jcomments$", "env": "^(jcomments|Joomla)$",
"implies": "PHP" "implies": "PHP"
}, },
"jqPlot": { "jqPlot": {
@ -1323,7 +1323,7 @@
"Magento": { "Magento": {
"website": "www.magentocommerce.com", "website": "www.magentocommerce.com",
"cats": [ 6 ], "cats": [ 6 ],
"script": "(?:js/mage|skin/frontend/(?:default|(enterprise)))\\;version:\\1?Enterprise:Community", "script": [ "js/mage", "skin/frontend/(?:default|(enterprise))\\;version:\\1?Enterprise:Community" ],
"headers": { "Set-Cookie": "frontend=\\;confidence:50" }, "headers": { "Set-Cookie": "frontend=\\;confidence:50" },
"env": "^(?:Mage|VarienForm)$", "env": "^(?:Mage|VarienForm)$",
"implies": "PHP" "implies": "PHP"

@ -79,13 +79,20 @@ var wappalyzer = (function() {
matches = pattern.regex.exec(value) matches = pattern.regex.exec(value)
; ;
w.log({ matches: matches, version: version });
if ( matches ) { if ( matches ) {
matches.map(function(match, i) { matches.map(function(match, i) {
// Parse ternary operator // Parse ternary operator
var ternary = new RegExp('\\\\' + i + '\\?([^:]+):(.+)$').exec(version); var ternary = new RegExp('\\\\' + i + '\\?([^:]+):(.+)$').exec(version);
if ( ternary && ternary.length === 3 ) { if ( ternary && ternary.length === 3 ) {
w.log({ match: match, i: i, ternary: ternary });
version = version.replace(ternary[0], match ? ternary[1] : ternary[2]); version = version.replace(ternary[0], match ? ternary[1] : ternary[2]);
w.log({ version: version });
} }
// Replace back references // Replace back references

@ -1129,7 +1129,7 @@
"meta": { "generator": "Joomla!(?: ([\\d.]+))?\\;version:\\1" }, "meta": { "generator": "Joomla!(?: ([\\d.]+))?\\;version:\\1" },
"html": "(?:<div[^>]+id=\"wrapper_r\"|<[^>]+(?:feed|components)/com_|<table[^>]+class=\"pill)\\;confidence:50", "html": "(?:<div[^>]+id=\"wrapper_r\"|<[^>]+(?:feed|components)/com_|<table[^>]+class=\"pill)\\;confidence:50",
"headers": { "X-Content-Encoded-By": "Joomla! ([\\d.]+)\\;version:\\1" }, "headers": { "X-Content-Encoded-By": "Joomla! ([\\d.]+)\\;version:\\1" },
"env": "^jcomments$", "env": "^(jcomments|Joomla)$",
"implies": "PHP" "implies": "PHP"
}, },
"jqPlot": { "jqPlot": {
@ -1323,7 +1323,7 @@
"Magento": { "Magento": {
"website": "www.magentocommerce.com", "website": "www.magentocommerce.com",
"cats": [ 6 ], "cats": [ 6 ],
"script": "(?:js/mage|skin/frontend/(?:default|(enterprise)))\\;version:\\1?Enterprise:Community", "script": [ "js/mage", "skin/frontend/(?:default|(enterprise))\\;version:\\1?Enterprise:Community" ],
"headers": { "Set-Cookie": "frontend=\\;confidence:50" }, "headers": { "Set-Cookie": "frontend=\\;confidence:50" },
"env": "^(?:Mage|VarienForm)$", "env": "^(?:Mage|VarienForm)$",
"implies": "PHP" "implies": "PHP"

@ -79,13 +79,20 @@ var wappalyzer = (function() {
matches = pattern.regex.exec(value) matches = pattern.regex.exec(value)
; ;
w.log({ matches: matches, version: version });
if ( matches ) { if ( matches ) {
matches.map(function(match, i) { matches.map(function(match, i) {
// Parse ternary operator // Parse ternary operator
var ternary = new RegExp('\\\\' + i + '\\?([^:]+):(.+)$').exec(version); var ternary = new RegExp('\\\\' + i + '\\?([^:]+):(.+)$').exec(version);
if ( ternary && ternary.length === 3 ) { if ( ternary && ternary.length === 3 ) {
w.log({ match: match, i: i, ternary: ternary });
version = version.replace(ternary[0], match ? ternary[1] : ternary[2]); version = version.replace(ternary[0], match ? ternary[1] : ternary[2]);
w.log({ version: version });
} }
// Replace back references // Replace back references

@ -1129,7 +1129,7 @@
"meta": { "generator": "Joomla!(?: ([\\d.]+))?\\;version:\\1" }, "meta": { "generator": "Joomla!(?: ([\\d.]+))?\\;version:\\1" },
"html": "(?:<div[^>]+id=\"wrapper_r\"|<[^>]+(?:feed|components)/com_|<table[^>]+class=\"pill)\\;confidence:50", "html": "(?:<div[^>]+id=\"wrapper_r\"|<[^>]+(?:feed|components)/com_|<table[^>]+class=\"pill)\\;confidence:50",
"headers": { "X-Content-Encoded-By": "Joomla! ([\\d.]+)\\;version:\\1" }, "headers": { "X-Content-Encoded-By": "Joomla! ([\\d.]+)\\;version:\\1" },
"env": "^jcomments$", "env": "^(jcomments|Joomla)$",
"implies": "PHP" "implies": "PHP"
}, },
"jqPlot": { "jqPlot": {
@ -1323,7 +1323,7 @@
"Magento": { "Magento": {
"website": "www.magentocommerce.com", "website": "www.magentocommerce.com",
"cats": [ 6 ], "cats": [ 6 ],
"script": "(?:js/mage|skin/frontend/(?:default|(enterprise)))\\;version:\\1?Enterprise:Community", "script": [ "js/mage", "skin/frontend/(?:default|(enterprise))\\;version:\\1?Enterprise:Community" ],
"headers": { "Set-Cookie": "frontend=\\;confidence:50" }, "headers": { "Set-Cookie": "frontend=\\;confidence:50" },
"env": "^(?:Mage|VarienForm)$", "env": "^(?:Mage|VarienForm)$",
"implies": "PHP" "implies": "PHP"

@ -79,13 +79,20 @@ var wappalyzer = (function() {
matches = pattern.regex.exec(value) matches = pattern.regex.exec(value)
; ;
w.log({ matches: matches, version: version });
if ( matches ) { if ( matches ) {
matches.map(function(match, i) { matches.map(function(match, i) {
// Parse ternary operator // Parse ternary operator
var ternary = new RegExp('\\\\' + i + '\\?([^:]+):(.+)$').exec(version); var ternary = new RegExp('\\\\' + i + '\\?([^:]+):(.+)$').exec(version);
if ( ternary && ternary.length === 3 ) { if ( ternary && ternary.length === 3 ) {
w.log({ match: match, i: i, ternary: ternary });
version = version.replace(ternary[0], match ? ternary[1] : ternary[2]); version = version.replace(ternary[0], match ? ternary[1] : ternary[2]);
w.log({ version: version });
} }
// Replace back references // Replace back references

@ -1129,7 +1129,7 @@
"meta": { "generator": "Joomla!(?: ([\\d.]+))?\\;version:\\1" }, "meta": { "generator": "Joomla!(?: ([\\d.]+))?\\;version:\\1" },
"html": "(?:<div[^>]+id=\"wrapper_r\"|<[^>]+(?:feed|components)/com_|<table[^>]+class=\"pill)\\;confidence:50", "html": "(?:<div[^>]+id=\"wrapper_r\"|<[^>]+(?:feed|components)/com_|<table[^>]+class=\"pill)\\;confidence:50",
"headers": { "X-Content-Encoded-By": "Joomla! ([\\d.]+)\\;version:\\1" }, "headers": { "X-Content-Encoded-By": "Joomla! ([\\d.]+)\\;version:\\1" },
"env": "^jcomments$", "env": "^(jcomments|Joomla)$",
"implies": "PHP" "implies": "PHP"
}, },
"jqPlot": { "jqPlot": {
@ -1323,7 +1323,7 @@
"Magento": { "Magento": {
"website": "www.magentocommerce.com", "website": "www.magentocommerce.com",
"cats": [ 6 ], "cats": [ 6 ],
"script": "(?:js/mage|skin/frontend/(?:default|(enterprise)))\\;version:\\1?Enterprise:Community", "script": [ "js/mage", "skin/frontend/(?:default|(enterprise))\\;version:\\1?Enterprise:Community" ],
"headers": { "Set-Cookie": "frontend=\\;confidence:50" }, "headers": { "Set-Cookie": "frontend=\\;confidence:50" },
"env": "^(?:Mage|VarienForm)$", "env": "^(?:Mage|VarienForm)$",
"implies": "PHP" "implies": "PHP"

@ -79,13 +79,20 @@ var wappalyzer = (function() {
matches = pattern.regex.exec(value) matches = pattern.regex.exec(value)
; ;
w.log({ matches: matches, version: version });
if ( matches ) { if ( matches ) {
matches.map(function(match, i) { matches.map(function(match, i) {
// Parse ternary operator // Parse ternary operator
var ternary = new RegExp('\\\\' + i + '\\?([^:]+):(.+)$').exec(version); var ternary = new RegExp('\\\\' + i + '\\?([^:]+):(.+)$').exec(version);
if ( ternary && ternary.length === 3 ) { if ( ternary && ternary.length === 3 ) {
w.log({ match: match, i: i, ternary: ternary });
version = version.replace(ternary[0], match ? ternary[1] : ternary[2]); version = version.replace(ternary[0], match ? ternary[1] : ternary[2]);
w.log({ version: version });
} }
// Replace back references // Replace back references

@ -1323,7 +1323,7 @@
"Magento": { "Magento": {
"website": "www.magentocommerce.com", "website": "www.magentocommerce.com",
"cats": [ 6 ], "cats": [ 6 ],
"script": "(?:js/mage|skin/frontend/(?:default|(enterprise)))\\;version:\\1?Enterprise:Community", "script": [ "js/mage", "skin/frontend/(?:default|(enterprise))\\;version:\\1?Enterprise:Community" ],
"headers": { "Set-Cookie": "frontend=\\;confidence:50" }, "headers": { "Set-Cookie": "frontend=\\;confidence:50" },
"env": "^(?:Mage|VarienForm)$", "env": "^(?:Mage|VarienForm)$",
"implies": "PHP" "implies": "PHP"

@ -79,13 +79,20 @@ var wappalyzer = (function() {
matches = pattern.regex.exec(value) matches = pattern.regex.exec(value)
; ;
w.log({ matches: matches, version: version });
if ( matches ) { if ( matches ) {
matches.map(function(match, i) { matches.map(function(match, i) {
// Parse ternary operator // Parse ternary operator
var ternary = new RegExp('\\\\' + i + '\\?([^:]+):(.+)$').exec(version); var ternary = new RegExp('\\\\' + i + '\\?([^:]+):(.+)$').exec(version);
if ( ternary && ternary.length === 3 ) { if ( ternary && ternary.length === 3 ) {
w.log({ match: match, i: i, ternary: ternary });
version = version.replace(ternary[0], match ? ternary[1] : ternary[2]); version = version.replace(ternary[0], match ? ternary[1] : ternary[2]);
w.log({ version: version });
} }
// Replace back references // Replace back references