We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 20903a8 commit 2004b70Copy full SHA for 2004b70
ext/openssl/openssl.c
@@ -1567,14 +1567,11 @@ PHP_FUNCTION(openssl_x509_export_to_file)
1567
1568
bio_out = BIO_new_file(file_path, PHP_OPENSSL_BIO_MODE_W(PKCS7_BINARY));
1569
if (bio_out) {
1570
- if (!notext && !X509_print(bio_out, cert)) {
1571
- php_openssl_store_errors();
1572
- }
1573
- if (!PEM_write_bio_X509(bio_out, cert)) {
+ if ((notext || X509_print(bio_out, cert)) && PEM_write_bio_X509(bio_out, cert)) {
+ RETVAL_TRUE;
+ } else {
1574
php_openssl_store_errors();
1575
}
1576
-
1577
- RETVAL_TRUE;
1578
} else {
1579
1580
php_error_docref(NULL, E_WARNING, "Error opening file %s", file_path);
0 commit comments