cfpathcheck
Advanced tools
Comparing version 0.8.0 to 0.8.1
@@ -214,3 +214,3 @@ /*global module, require */ | ||
// include '$path'; (inside <cfscript>) | ||
var includeMatches = matchAll(line, /\binclude\s['"]([^'"]+)['"]/g); | ||
var includeMatches = matchAll(line, /\binclude\s['"](.*\.cfm)['"]/g); | ||
@@ -220,7 +220,11 @@ cfIncludeMatches.concat(includeMatches).forEach(function (includeMatch) { | ||
// Dynamic path (contains #): all we can check is the non-dynamic part | ||
// Dynamic path (contains # or &): all we can check is the non-dynamic part, | ||
// wound back to the last slash | ||
var templatePath = includeMatch[1]; | ||
var hashPos = templatePath.indexOf('#'); | ||
if (hashPos !== -1) { | ||
templatePath = path.dirname(templatePath.substr(0, hashPos)); | ||
var ampersandPos = templatePath.indexOf('&'); | ||
if (hashPos !== -1 || ampersandPos !== -1) { | ||
var searchPos = hashPos !== -1 ? hashPos : ampersandPos; | ||
var lastSlashPos = templatePath.lastIndexOf('/', searchPos); | ||
templatePath = path.dirname(templatePath.substr(0, lastSlashPos)); | ||
} | ||
@@ -227,0 +231,0 @@ |
{ | ||
"name": "cfpathcheck", | ||
"description": "Check CFML files for correct paths in cfinclude/cfimport tags", | ||
"version": "0.8.0", | ||
"version": "0.8.1", | ||
"homepage": "https://github.com/timbeadle/cfpathcheck", | ||
@@ -6,0 +6,0 @@ "author": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
18206
311