File tree 1 file changed +11
-4
lines changed
1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change 20
20
use function array_values ;
21
21
use function copy ;
22
22
use function error_get_last ;
23
+ use function explode ;
23
24
use function function_exists ;
24
25
use function implode ;
25
26
use function is_dir ;
@@ -171,9 +172,15 @@ public static function realpath(string $path): string
171
172
return '' ;
172
173
}
173
174
174
- // ~: is user home dir in *nix OS
175
- if ($ parts [0 ] === '~ ' && false === OS ::isWindows ()) {
176
- $ parts [0 ] = OS ::getUserHomeDir ();
175
+ $ start = '' ;
176
+ $ isUnix = DIRECTORY_SEPARATOR === '/ ' ;
177
+ if ($ isUnix ) {
178
+ // ~: is user home dir in *nix OS
179
+ if ($ parts [0 ] === '~ ' ) {
180
+ $ parts [0 ] = OS ::getUserHomeDir ();
181
+ } else {
182
+ $ start = '/ ' ;
183
+ }
177
184
}
178
185
179
186
$ absolutes = [];
@@ -189,7 +196,7 @@ public static function realpath(string $path): string
189
196
}
190
197
}
191
198
192
- return implode (DIRECTORY_SEPARATOR , $ absolutes );
199
+ return $ start . implode (DIRECTORY_SEPARATOR , $ absolutes );
193
200
}
194
201
195
202
/**********************************************************************************
You can’t perform that action at this time.
0 commit comments