summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/nxt_php_sapi.c3
-rw-r--r--test/test_php_targets.py1
2 files changed, 3 insertions, 1 deletions
diff --git a/src/nxt_php_sapi.c b/src/nxt_php_sapi.c
index 126a4684..d2494938 100644
--- a/src/nxt_php_sapi.c
+++ b/src/nxt_php_sapi.c
@@ -1025,7 +1025,8 @@ nxt_php_dynamic_request(nxt_php_run_ctx_t *ctx, nxt_unit_request_t *r)
nxt_str_null(&script_name);
- ctx->path_info.start = (u_char *) strstr((char *) path.start, ".php/");
+ ctx->path_info.start = memmem(path.start, path.length, ".php/",
+ strlen(".php/"));
if (ctx->path_info.start != NULL) {
ctx->path_info.start += 4;
path.length = ctx->path_info.start - path.start;
diff --git a/test/test_php_targets.py b/test/test_php_targets.py
index 918c5fda..eec1846f 100644
--- a/test/test_php_targets.py
+++ b/test/test_php_targets.py
@@ -47,6 +47,7 @@ class TestPHPTargets(TestApplicationPHP):
assert self.get(url='/2')['body'] == '2'
assert self.get(url='/blah')['status'] == 503 # TODO 404
assert self.get(url='/')['body'] == 'index'
+ assert self.get(url='/1.php?test=test.php/')['body'] == '1'
assert 'success' in self.conf(
"\"1.php\"", 'applications/targets/targets/default/index'