File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed
Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -52,19 +52,26 @@ public static function getGithubKeys($username)
5252
5353 public static function testValidSSHKey ($ key_str )
5454 {
55- // https://github.com/phpseclib/phpseclib/issues/2077
56- // key loader still throws exception, this just mutes a warning for phpunit
57- if (preg_match ( " /^[0-9]+$/ " , $ key_str) ) {
55+ // key loader still throws, these just mute warnings for phpunit
56+ // https://github.com/phpseclib/phpseclib/issues/2079
57+ if ($ key_str == "" ) {
5858 return false ;
5959 }
60+ // https://github.com/phpseclib/phpseclib/issues/2077
61+ // if (preg_match("/^[0-9]+$/", $key_str)) {
62+ // return false;
63+ // }
6064 // https://github.com/phpseclib/phpseclib/issues/2076
61- // key loader still throws exception, this just mutes a warning for phpunit
65+ // there are actually valid JSON keys (JWK), but I don't think anybody uses it
6266 if (!is_null (@json_decode ($ key_str ))) {
6367 return false ;
6468 }
6569 try {
6670 PublicKeyLoader::load ($ key_str );
6771 return true ;
72+ // phpseclib should throw only NoKeyLoadedException but that is not the case
73+ // https://github.com/phpseclib/phpseclib/pull/2078
74+ // } catch (\phpseclib3\Exception\NoKeyLoadedException $e) {
6875 } catch (\Throwable $ e ) {
6976 return false ;
7077 }
You can’t perform that action at this time.
0 commit comments