GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — chore: replace var with let/const in isRealPathSafe (#135) · node-modules/compressing@60fa3af

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • lib
    • utils.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎lib/utils.js‎

Copy file name to clipboardExpand all lines: lib/utils.js
+6-6Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,14 @@ function isRealPathSafe(targetPath, parentDir, realParentDir, callback) {
3636
return isPathWithinParent(p, parentDir) || isPathWithinParent(p, realParentDir);
3737
}
3838

39-
var relative = path.relative(parentDir, targetPath);
40-
var segments = relative.split(path.sep);
41-
var i = 0;
42-
var current = parentDir;
39+
const relative = path.relative(parentDir, targetPath);
40+
const segments = relative.split(path.sep);
41+
let i = 0;
42+
let current = parentDir;
4343

4444
function checkNext() {
4545
if (i >= segments.length) return callback(null, true);
46-
var segment = segments[i++];
46+
const segment = segments[i++];
4747
if (!segment || segment === '.') return checkNext();
4848

4949
current = path.join(current, segment);
@@ -61,7 +61,7 @@ function isRealPathSafe(targetPath, parentDir, realParentDir, callback) {
6161
// Dangling symlink - check textual target
6262
return fs.readlink(current, function(err, linkTarget) {
6363
if (err) return callback(null, false);
64-
var absTarget = path.resolve(path.dirname(current), linkTarget);
64+
const absTarget = path.resolve(path.dirname(current), linkTarget);
6565
callback(null, isWithinParent(absTarget));
6666
});
6767
}

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.