From afd8c660027f5a0ceec594bd131824478c4a3d5e Mon Sep 17 00:00:00 2001 From: Rant Date: Sat, 5 Sep 2026 13:01:53 +0300 Subject: [PATCH] sapi/phpdbg: restore the DEFAULT_SLASH check on the module path The move to memchr() in GH-21578 left both halves of the condition looking for '/', so on Windows a path given with backslashes is not recognised as a path and extension_dir gets prepended to it. Co-Authored-By: Claude Opus 5 --- sapi/phpdbg/phpdbg_prompt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sapi/phpdbg/phpdbg_prompt.c b/sapi/phpdbg/phpdbg_prompt.c index d6249ae068da..88afd1b3752e 100644 --- a/sapi/phpdbg/phpdbg_prompt.c +++ b/sapi/phpdbg/phpdbg_prompt.c @@ -1192,7 +1192,7 @@ static const char *phpdbg_load_module_or_extension(zend_string **path, const cha phpdbg_error("extension_dir ini setting contains a nul byte"); return NULL; } - if (memchr(ZSTR_VAL(*path), '/', ZSTR_LEN(*path)) != NULL || memchr(ZSTR_VAL(*path), '/', ZSTR_LEN(*path)) != NULL) { + if (memchr(ZSTR_VAL(*path), '/', ZSTR_LEN(*path)) != NULL || memchr(ZSTR_VAL(*path), DEFAULT_SLASH, ZSTR_LEN(*path)) != NULL) { /* path is fine */ } else if (extension_dir && ZSTR_LEN(extension_dir) > 0) { zend_string *libpath;