Skip to content

Commit 72c639a

Browse files
committed
:octocat: File::reaplath(): check for symlink
1 parent 0a38d8e commit 72c639a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/File.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ public static function realpath(string $path):string{
6767

6868
if(is_link($path)){
6969
$path = readlink($path);
70+
71+
if($path === false){
72+
throw new InvalidArgumentException('invalid link');
73+
}
7074
}
7175

7276
$realpath = realpath($path);

0 commit comments

Comments
 (0)