From 806e69b85898d3e36e5f307d1cfb5c8205562d84 Mon Sep 17 00:00:00 2001 From: Thomas Keller Date: Thu, 7 Oct 2010 11:56:52 +0000 Subject: [PATCH] Don't let sync git fail on ssh keys with no comment field (references: issue 531 and issue 545) --- src/IDF/Key.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/IDF/Key.php b/src/IDF/Key.php index c9d7eff..2320d8f 100644 --- a/src/IDF/Key.php +++ b/src/IDF/Key.php @@ -80,7 +80,7 @@ class IDF_Key extends Pluf_Model if (preg_match('#^\[pubkey ([^\]]+)\]\s*(\S+)\s*\[end\]$#', $this->content, $m)) { return array('mtn', $m[1], $m[2]); } - else if (preg_match('#^ssh\-[a-z]{3}\s(\S+)\s(\S+)$#', $this->content, $m)) { + else if (preg_match('#^ssh\-[a-z]{3}\s(\S+)(?:\s(\S+))?$#', $this->content, $m)) { return array('ssh', $m[2], $m[1]); }