Commit 0fadf67 1 parent d91e62d commit 0fadf67 Copy full SHA for 0fadf67
File tree 2 files changed +11
-0
lines changed
2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -160,6 +160,10 @@ public function sitePath(string $siteName): ?string
160
160
$ domain = static ::domainFromSiteName ($ siteName );
161
161
162
162
foreach ($ this ->config ['paths ' ] as $ path ) {
163
+ if (! is_dir ($ path )) {
164
+ continue ;
165
+ }
166
+
163
167
$ handle = opendir ($ path );
164
168
165
169
if ($ handle === false ) {
Original file line number Diff line number Diff line change @@ -90,6 +90,13 @@ public function test_it_returns_null_default_site_path_if_not_set()
90
90
$ this ->assertNull ($ server ->defaultSitePath ());
91
91
}
92
92
93
+ public function test_it_ignores_invalid_paths ()
94
+ {
95
+ $ server = new Server (['paths ' => ['fake ' => __DIR__ .'/invalid_path ' ]]);
96
+
97
+ $ this ->assertNull ($ server ->sitePath ('tighten ' ));
98
+ }
99
+
93
100
public function test_it_tests_whether_host_is_ip_address ()
94
101
{
95
102
$ this ->assertTrue (Server::hostIsIpAddress ('192.168.1.1 ' ));
You can’t perform that action at this time.
0 commit comments