note 114743 added to function.gnupg-decrypt
| From: | aidukas at gmail dot com | Date: | Tue, 01 Apr 2014 09:02:50 +0000 |
| Subject: | note 114743 added to function.gnupg-decrypt | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-199087@lists.php.net to get a copy of this message | ||
If empty text is encrypted, the gnupg_decrypt() function will return a boolean FALSE so if you do a
strict comparison (===, !==) to track a failure it will trigger you a failure.
For failures use Exceptions:
<?php
$gpg = new gnupg();
$gpg->seterrormode(gnupg::ERROR_EXCEPTION);
/*
.......further code.......
*/
try {
$string = $gpg->decrypt($stringToDecrypt);
} catch (Exception $e) {
// do the Error processing
}
?>
----
Server IP: 72.52.91.14
Probable Submitter: 88.216.169.32
----
Manual Page -- http://php.net/manual/en/function.gnupg-decrypt.php
Edit -- https://master.php.net/note/edit/114743
Del: integrated -- https://master.php.net/note/delete/114743/integrated
Del: useless -- https://master.php.net/note/delete/114743/useless
Del: bad code -- https://master.php.net/note/delete/114743/bad+code
Del: spam -- https://master.php.net/note/delete/114743/spam
Del: non-english -- https://master.php.net/note/delete/114743/non-english
Del: in docs -- https://master.php.net/note/delete/114743/in+docs
Del: other reasons-- https://master.php.net/note/delete/114743
Reject -- https://master.php.net/note/reject/114743
Search -- https://master.php.net/manage/user-notes.php