Skip to content

Commit 817efbd

Browse files
committed
fix account page ssh key index validation
1 parent 20d8ce6 commit 817efbd

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

webroot/panel/account.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,11 @@
5959
if (!preg_match("/^[0-9]+$/", $indexStr)) {
6060
break;
6161
}
62-
unset($keys[intval($indexStr)]); // remove key from array
62+
$index = intval($indexStr);
63+
if ($index >= count($keys)) {
64+
break;
65+
}
66+
unset($keys[$index]); // remove key from array
6367
$keys = array_values($keys);
6468

6569
$USER->setSSHKeys($keys, $OPERATOR); // Update user keys

0 commit comments

Comments
 (0)