From fb9fddde16baf3497112c000e70baa222862c747 Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Mon, 25 Jul 2011 15:14:45 -0500 Subject: [PATCH] Working constructor for UserID --- lib/openpgp.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/openpgp.php b/lib/openpgp.php index 4c60059..83c2b73 100644 --- a/lib/openpgp.php +++ b/lib/openpgp.php @@ -1225,6 +1225,18 @@ class OpenPGP_TrustPacket extends OpenPGP_Packet { class OpenPGP_UserIDPacket extends OpenPGP_Packet { public $name, $comment, $email; + function __construct($name='', $comment='', $email='') { + parent::__construct(); + if(!$comment && !$email) { + $this->input = $name; + $this->read(); + } else { + $this->name = $name; + $this->comment = $comment; + $this->email = $email; + } + } + function read() { $this->text = $this->input; // User IDs of the form: "name (comment) "