Pārlūkot izejas kodu

Fixing bug: invalid array key when the key name didn't contain the @ character

clement 1 gadu atpakaļ
vecāks
revīzija
e13fc6208d
1 mainītis faili ar 2 papildinājumiem un 2 dzēšanām
  1. 2 2
      src/models/ssh.php

+ 2 - 2
src/models/ssh.php

@@ -19,8 +19,8 @@ function get_ssh_keys($id) {
                 for ($i = 0; $i < $info[0]["sshpublickey"]["count"]; $i++) {
                     $key = $info[0]["sshpublickey"][$i];
                     $key_name = array();
-                    preg_match("/\S+@\S+/", $key, $key_name);
-                    $keys[] = [$key_name[0] => $key];
+                    preg_match("/\S+/g", $key, $key_name);
+                    $keys[] = [$key_name[2] => $key];
                 }
                 return $keys;
             }