@@ -16,7 +16,9 @@ class Standards
16
16
17
17
18
18
/**
19
- * Get a list paths where standards are installed.
19
+ * Get a list of paths where standards are installed.
20
+ *
21
+ * Unresolvable relative paths will be excluded from the results.
20
22
*
21
23
* @return array
22
24
*/
@@ -34,6 +36,9 @@ public static function getInstalledStandardPaths()
34
36
foreach ($ installedPaths as $ installedPath ) {
35
37
if (substr ($ installedPath , 0 , 1 ) === '. ' ) {
36
38
$ installedPath = Common::realPath (__DIR__ .$ ds .'.. ' .$ ds .'.. ' .$ ds .$ installedPath );
39
+ if ($ installedPath === false ) {
40
+ continue ;
41
+ }
37
42
}
38
43
39
44
$ resolvedInstalledPaths [] = $ installedPath ;
@@ -229,6 +234,9 @@ public static function isInstalledStandard($standard)
229
234
// This could be a custom standard, installed outside our
230
235
// standards directory.
231
236
$ standard = Common::realPath ($ standard );
237
+ if ($ standard === false ) {
238
+ return false ;
239
+ }
232
240
233
241
// Might be an actual ruleset file itUtil.
234
242
// If it has an XML extension, let's at least try it.
@@ -282,7 +290,7 @@ public static function getInstalledStandardPath($standard)
282
290
283
291
$ path = Common::realpath ($ standardPath .DIRECTORY_SEPARATOR .'ruleset.xml ' );
284
292
285
- if (is_file ($ path ) === true ) {
293
+ if ($ path !== false && is_file ($ path ) === true ) {
286
294
return $ path ;
287
295
} else if (Common::isPharFile ($ standardPath ) === true ) {
288
296
$ path = Common::realpath ($ standardPath );
0 commit comments