Skip to content

Commit

Permalink
plugins/php: handle php8.1 zend_file_handle signature change
Browse files Browse the repository at this point in the history
filename is now a zend_string.

Refs unbit#2394
  • Loading branch information
xrmx committed Apr 10, 2022
1 parent a8c180c commit df1330f
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions plugins/php/php_plugin.c
Original file line number Diff line number Diff line change
Expand Up @@ -1044,14 +1044,19 @@ int uwsgi_php_request(struct wsgi_request *wsgi_req) {

SG(request_info).path_translated = wsgi_req->file;

memset(&file_handle, 0, sizeof(zend_file_handle));
file_handle.type = ZEND_HANDLE_FILENAME;
file_handle.filename = real_filename;
#if PHP_VERSION_ID >= 80100
zend_string *handle_filename = zend_string_init(real_filename, real_filename_len, 0);
#else
const char *handle_filename = real_filename;
#endif
memset(&file_handle, 0, sizeof(zend_file_handle));
file_handle.type = ZEND_HANDLE_FILENAME;
file_handle.filename = handle_filename;

if (php_request_startup() == FAILURE) {
if (php_request_startup() == FAILURE) {
uwsgi_500(wsgi_req);
return -1;
}
return -1;
}

struct uwsgi_string_list *usl=NULL;

Expand Down

0 comments on commit df1330f

Please sign in to comment.