From fa696569f9e2c8d3d286eb14891c0adc797200d8 Mon Sep 17 00:00:00 2001 From: Max Romanov Date: Thu, 23 Jul 2020 14:24:16 +0300 Subject: PHP: removing assertion to fix build on macOS. The nxt_assert macro uses nxt_thread_context, which caused the following linker error when using it in the library: ld: illegal thread local variable reference to regular symbol _nxt_thread_context for architecture x86_64 --- src/nxt_php_sapi.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/nxt_php_sapi.c') diff --git a/src/nxt_php_sapi.c b/src/nxt_php_sapi.c index ee0976ce..767dcaec 100644 --- a/src/nxt_php_sapi.c +++ b/src/nxt_php_sapi.c @@ -707,7 +707,11 @@ nxt_php_dirname(const nxt_str_t *file, nxt_str_t *dir) { size_t length; - nxt_assert(file->length > 0 && file->start[0] == '/'); + if (file->length == 0 || file->start[0] != '/') { + nxt_unit_alert(NULL, "php_dirname: invalid file name " + "(not starts from '/')"); + return NXT_ERROR; + } length = file->length; -- cgit