Browse Source

[mod_indexfile] save physical path to env (fixes #448, #892)

save physical path to environment (PATH_TRANSLATED_DIRINDEX)
when index generator is full path (not relative path)

fix uri.path when index generator is full path (not relative path)
personal/stbuehler/mod-csrf-old
Glenn Strauss 6 years ago
parent
commit
e0bafab2db
  1. 1
      NEWS
  2. 19
      src/mod_indexfile.c

1
NEWS

@ -77,6 +77,7 @@ NEWS
* [mod_ssi] config ssi.conditional-requests
* [mod_ssi] config ssi.exec (fixes #2051)
* [mod_redirect,mod_rewrite] short-circuit if blank replacement (fixes #2085)
* [mod_indexfile] save physical path to env (fixes #448, #892)
- 1.4.39 - 2016-01-02
* [core] fix memset_s call (fixes #2698)

19
src/mod_indexfile.c

@ -193,11 +193,22 @@ URIHANDLER_FUNC(mod_indexfile_subrequest) {
continue;
}
/* rewrite uri.path to the real path (/ -> /index.php) */
buffer_append_string_buffer(con->uri.path, ds->value);
buffer_copy_buffer(con->physical.path, p->tmp_buf);
if (ds->value && ds->value->ptr[0] == '/') {
/* replace uri.path */
buffer_copy_buffer(con->uri.path, ds->value);
/* fce is already set up a few lines above */
if (NULL == (ds = (data_string *)array_get_unused_element(con->environment, TYPE_STRING))) {
ds = data_string_init();
}
buffer_copy_string_len(ds->key, CONST_STR_LEN("PATH_TRANSLATED_DIRINDEX"));
buffer_copy_buffer(ds->value, con->physical.path);
array_insert_unique(con->environment, (data_unset *)ds);
} else {
/* append to uri.path the relative path to index file (/ -> /index.php) */
buffer_append_string_buffer(con->uri.path, ds->value);
}
buffer_copy_buffer(con->physical.path, p->tmp_buf);
return HANDLER_GO_ON;
}

Loading…
Cancel
Save