Skip to content

Commit 7087b78

Browse files
committed
Fixed issue where invalid github usernames generate invalid ssh keys.
1 parent a716b8a commit 7087b78

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

webroot/panel/account.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,15 @@
3838
break;
3939
case "github":
4040
$gh_user = $_POST["gh_user"];
41+
if (empty($gh_user)) {
42+
break;
43+
}
4144
$keys = UnitySite::getGithubKeys($gh_user);
42-
$added_keys = $keys;
45+
foreach ($keys as $key) {
46+
if (UnitySite::testValidSSHKey($key)) {
47+
array_push($added_keys, $key);
48+
}
49+
}
4350
break;
4451
}
4552

0 commit comments

Comments
 (0)