File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -315,17 +315,19 @@ added: v0.11.2
315
315
* ` path ` {string}
316
316
* Returns: {boolean}
317
317
318
- The ` path.isAbsolute() ` method determines if ` path ` is an absolute path.
318
+ The ` path.isAbsolute() ` method determines if the literal ` path ` is absolute.
319
+ Therefore, it’s not safe for mitigating path traversals.
319
320
320
321
If the given ` path ` is a zero-length string, ` false ` will be returned.
321
322
322
323
For example, on POSIX:
323
324
324
325
``` js
325
- path .isAbsolute (' /foo/bar' ); // true
326
- path .isAbsolute (' /baz/..' ); // true
327
- path .isAbsolute (' qux/' ); // false
328
- path .isAbsolute (' .' ); // false
326
+ path .isAbsolute (' /foo/bar' ); // true
327
+ path .isAbsolute (' /baz/..' ); // true
328
+ path .isAbsolute (' /baz/../..' ); // true
329
+ path .isAbsolute (' qux/' ); // false
330
+ path .isAbsolute (' .' ); // false
329
331
```
330
332
331
333
On Windows:
You can’t perform that action at this time.
0 commit comments