From bbf1a1882a676486837abb2d7496b0443a969233 Mon Sep 17 00:00:00 2001 From: William MARTIN Date: Wed, 4 May 2011 11:22:24 +0200 Subject: [PATCH] Fix issue 671 : Update the SSH Key preg pattern --- src/IDF/Key.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/IDF/Key.php b/src/IDF/Key.php index 8896bdc..82d2786 100644 --- a/src/IDF/Key.php +++ b/src/IDF/Key.php @@ -80,7 +80,10 @@ 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)) { + if (!isset($m[2])) { + $m[2] = ""; + } return array('ssh', $m[2], $m[1]); }