Skip to content

Commit

Permalink
Libraries: Only attempt a partial match if the library name contains …
Browse files Browse the repository at this point in the history
…a slash

fixes #4971
  • Loading branch information
nilmerg committed Jan 11, 2023
1 parent 39b9168 commit 159ddd9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion library/Icinga/Application/Libraries.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public function get($name)
$libraryName = $library->getName();
if ($libraryName === $name) {
return $library;
} elseif (explode('/', $libraryName)[1] === $name) {
} elseif (strpos($libraryName, '/') !== false && explode('/', $libraryName)[1] === $name) {
// Also return libs which only partially match
$candidate = $library;
}
Expand Down

0 comments on commit 159ddd9

Please sign in to comment.