Skip to content

Commit 69491e8

Browse files
committed
Merge branch 'master' into assert
* master: Set PHP_JSON_VERSION to 1.4.0 Remove unnecessary resource checks in openssl ext JSON is now maintained
2 parents 8473157 + 3ddc246 commit 69491e8

File tree

3 files changed

+14
-11
lines changed

3 files changed

+14
-11
lines changed

EXTENSIONS

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -401,8 +401,8 @@ MAINTENANCE: Maintained
401401
STATUS: Working
402402
-------------------------------------------------------------------------------
403403
EXTENSION: json
404-
PRIMARY MAINTAINER: Unknown
405-
MAINTENANCE: Odd fixes
404+
PRIMARY MAINTAINER: Jakub Zelenka <[email protected]>
405+
MAINTENANCE: Maintained
406406
STATUS: Working
407407
SINCE: 5.2
408408
-------------------------------------------------------------------------------

ext/json/php_json.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#ifndef PHP_JSON_H
2323
#define PHP_JSON_H
2424

25-
#define PHP_JSON_VERSION "1.2.1"
25+
#define PHP_JSON_VERSION "1.4.0"
2626
#include "zend_smart_str_public.h"
2727

2828
extern zend_module_entry json_module_entry;

ext/openssl/openssl.c

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1351,14 +1351,15 @@ static X509 * php_openssl_x509_from_zval(zval * val, int makeresource, zend_reso
13511351
if (Z_TYPE_P(val) == IS_RESOURCE) {
13521352
/* is it an x509 resource ? */
13531353
void * what;
1354+
zend_resource *res = Z_RES_P(val);
13541355

1355-
what = zend_fetch_resource_ex(val, "OpenSSL X.509", le_x509);
1356+
what = zend_fetch_resource(res, "OpenSSL X.509", le_x509);
13561357
if (!what) {
13571358
return NULL;
13581359
}
13591360
/* this is so callers can decide if they should free the X509 */
13601361
if (resourceval) {
1361-
*resourceval = Z_RES_P(val);
1362+
*resourceval = res;
13621363
Z_ADDREF_P(val);
13631364
}
13641365
return (X509*)what;
@@ -2762,11 +2763,12 @@ static X509_REQ * php_openssl_csr_from_zval(zval * val, int makeresource, zend_r
27622763
}
27632764
if (Z_TYPE_P(val) == IS_RESOURCE) {
27642765
void * what;
2766+
zend_resource *res = Z_RES_P(val);
27652767

2766-
what = zend_fetch_resource_ex(val, "OpenSSL X.509 CSR", le_csr);
2768+
what = zend_fetch_resource(res, "OpenSSL X.509 CSR", le_csr);
27672769
if (what) {
27682770
if (resourceval) {
2769-
*resourceval = Z_RES_P(val);
2771+
*resourceval = res;
27702772
Z_ADDREF_P(val);
27712773
}
27722774
return (X509_REQ*)what;
@@ -3219,20 +3221,21 @@ static EVP_PKEY * php_openssl_evp_from_zval(zval * val, int public_key, char * p
32193221

32203222
if (Z_TYPE_P(val) == IS_RESOURCE) {
32213223
void * what;
3224+
zend_resource * res = Z_RES_P(val);
32223225

3223-
what = zend_fetch_resource2_ex(val, "OpenSSL X.509/key", le_x509, le_key);
3226+
what = zend_fetch_resource2(res, "OpenSSL X.509/key", le_x509, le_key);
32243227
if (!what) {
32253228
TMP_CLEAN;
32263229
}
32273230
if (resourceval) {
3228-
*resourceval = Z_RES_P(val);
3231+
*resourceval = res;
32293232
Z_ADDREF_P(val);
32303233
}
3231-
if (Z_RES_P(val)->type == le_x509) {
3234+
if (res->type == le_x509) {
32323235
/* extract key from cert, depending on public_key param */
32333236
cert = (X509*)what;
32343237
free_cert = 0;
3235-
} else if (Z_RES_P(val)->type == le_key) {
3238+
} else if (res->type == le_key) {
32363239
int is_priv;
32373240

32383241
is_priv = php_openssl_is_private_key((EVP_PKEY*)what);

0 commit comments

Comments
 (0)