From 931dc56c7a53c388c21d679ae10dfe0b245aed32 Mon Sep 17 00:00:00 2001 From: Xinchen Hui Date: Fri, 22 Jun 2018 18:21:44 +0800 Subject: [PATCH] Fixed build with PHP-7.3 --- requests/yaf_request_http.c | 5 +++++ yaf_session.c | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/requests/yaf_request_http.c b/requests/yaf_request_http.c index 23b215e..8658611 100644 --- a/requests/yaf_request_http.c +++ b/requests/yaf_request_http.c @@ -96,9 +96,14 @@ yaf_request_t *yaf_request_http_instance(yaf_request_t *this_ptr, zend_string *r * only use url path */ if (strncasecmp(Z_STRVAL_P(uri), "http", sizeof("http") - 1) == 0) { php_url *url_info = php_url_parse(Z_STRVAL_P(uri)); +#if PHP_VERSION_ID < 70300 if (url_info && url_info->path) { settled_uri = zend_string_init(url_info->path, strlen(url_info->path), 0); } +#else + settled_uri = url_info->path; + url_info->path = NULL; +#endif php_url_free(url_info); } else { char *pos = NULL; diff --git a/yaf_session.c b/yaf_session.c index ff48291..65d6184 100644 --- a/yaf_session.c +++ b/yaf_session.c @@ -94,7 +94,12 @@ static yaf_session_t *yaf_session_instance(yaf_session_t *this_ptr) /* {{{ */ { zval_ptr_dtor(&member); - if (property_info->offset != ZEND_WRONG_PROPERTY_OFFSET) { +#if PHP_VERSION_ID < 70300 + if (property_info->offset != ZEND_WRONG_PROPERTY_OFFSET) +#else + if (IS_VALID_PROPERTY_OFFSET(property_info->offset)) +#endif + { zval *prop = OBJ_PROP(obj, property_info->offset); ZVAL_COPY(prop, sess); }