We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 33ef37f commit 0a38d8eCopy full SHA for 0a38d8e
src/File.php
@@ -19,8 +19,10 @@
19
use function file_get_contents;
20
use function file_put_contents;
21
use function is_file;
22
+use function is_link;
23
use function is_readable;
24
use function is_writable;
25
+use function readlink;
26
use function realpath;
27
use function unlink;
28
@@ -62,10 +64,15 @@ public static function isWritable(string $file):bool{
62
64
* @codeCoverageIgnore
63
65
*/
66
public static function realpath(string $path):string{
67
+
68
+ if(is_link($path)){
69
+ $path = readlink($path);
70
+ }
71
72
$realpath = realpath($path);
73
74
if($realpath === false){
- throw new InvalidArgumentException('invalid file path');
75
+ throw new InvalidArgumentException('invalid path');
76
}
77
78
return $realpath;
0 commit comments