We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d6b5a95 commit 18b1f54Copy full SHA for 18b1f54
resources/lib/UnityUser.php
@@ -300,14 +300,17 @@ public function getSSHKeys(): array
300
return $result;
301
}
302
303
+ /*
304
+ key must take the form "KEY_TYPE KEY_DATA OPTIONAL_COMMENT"
305
+ https://github.com/phpseclib/phpseclib/issues/2117
306
+ */
307
private static function removeSSHKeyOptionalCommentSuffix(string $key): string
308
{
309
$matches = [];
- // (leadingWhitespace? word whitespace word) whitespace (words) trailingWhitespace?
- if (preg_match("/^(\s*\S+\s+\S+)\s+(\S.*\S)\s*$/", $key, $matches)) {
310
+ if (preg_match("/^(\S+\s+\S+)/", $key, $matches)) {
311
return $matches[1];
312
} else {
- return $key;
313
+ throw new \ValueError("invalid SSH key: $key");
314
315
316
0 commit comments