sapi/phpdbg: restore the DEFAULT_SLASH check on the module path (#23583)

The move to memchr() in GH-21578 changed:
`if (strchr(*path, '/') != NULL || strchr(*path, DEFAULT_SLASH) != NULL) {`
to
`if (memchr(ZSTR_VAL(*path), '/', ZSTR_LEN(*path)) != NULL || memchr(ZSTR_VAL(*path), '/', ZSTR_LEN(*path)) != NULL) {`
instead of
`if (memchr(ZSTR_VAL(*path), '/', ZSTR_LEN(*path)) != NULL || memchr(ZSTR_VAL(*path), DEFAULT_SLASH, ZSTR_LEN(*path)) != NULL) {`

Fix this.
This commit is contained in:
Dmitry Rantovov authored and GitHub committed 2026-09-06 13:34:37 +01:00
1 parent d1116a1775
commit 1d82b6f0d7
1 file changed
+1 -1
+1 -1
View File
@@ -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;