Working constructor for UserID

This commit is contained in:
Stephen Paul Weber 2011-07-25 15:14:45 -05:00
parent 4dbfbcb88d
commit fb9fddde16

View File

@ -1225,6 +1225,18 @@ class OpenPGP_TrustPacket extends OpenPGP_Packet {
class OpenPGP_UserIDPacket extends OpenPGP_Packet { class OpenPGP_UserIDPacket extends OpenPGP_Packet {
public $name, $comment, $email; 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() { function read() {
$this->text = $this->input; $this->text = $this->input;
// User IDs of the form: "name (comment) <email>" // User IDs of the form: "name (comment) <email>"