Explorar el Código

there is no /g modifier, using preg_match_all instead

clement hace 1 año
padre
commit
6e4c90fd10
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      src/models/ssh.php

+ 1 - 1
src/models/ssh.php

@@ -19,7 +19,7 @@ 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+/g", $key, $key_name);
+                    preg_match_all("/\S+", $key, $key_name);
                     $keys[] = [$key_name[2] => $key];
                 }
                 return $keys;