SSH/Agent: use PHP8's new str_contains function

This commit is contained in:
terrafrost 2022-11-29 06:24:32 -06:00
parent 768d2be8f8
commit efd5bf281a

View File

@ -137,7 +137,7 @@ class Agent
throw new RuntimeException("Unable to connect to ssh-agent (Error $errno: $errstr)");
}
} else {
if (substr($address, 0, 9) != '\\\\.\\pipe\\' || strpos(substr($address, 9), '\\') !== false) {
if (substr($address, 0, 9) != '\\\\.\\pipe\\' || str_contains(substr($address, 9), '\\')) {
throw new RuntimeException('Address is not formatted as a named pipe should be');
}