mirror of
https://github.com/cesanta/mongoose.git
synced 2026-12-04 21:58:22 +00:00
Made SSI #include file= relative to the current doc, as per spec
This commit is contained in:
1 parent
de7745370c
commit
e003236a03
7 files changed
+12
-9
No files matched your search
+3
-2
@@ -3611,11 +3611,12 @@ static void do_ssi_include(struct mg_connection *conn, const char *ssi,
|
||||
// File name is relative to the webserver root
|
||||
(void) mg_snprintf(conn, path, sizeof(path), "%s%c%s",
|
||||
conn->ctx->config[DOCUMENT_ROOT], '/', file_name);
|
||||
} else if (sscanf(tag, " file=\"%[^\"]\"", file_name) == 1) {
|
||||
} else if (sscanf(tag, " abspath=\"%[^\"]\"", file_name) == 1) {
|
||||
// File name is relative to the webserver working directory
|
||||
// or it is absolute system path
|
||||
(void) mg_snprintf(conn, path, sizeof(path), "%s", file_name);
|
||||
} else if (sscanf(tag, " \"%[^\"]\"", file_name) == 1) {
|
||||
} else if (sscanf(tag, " file=\"%[^\"]\"", file_name) == 1 ||
|
||||
sscanf(tag, " \"%[^\"]\"", file_name) == 1) {
|
||||
// File name is relative to the currect document
|
||||
(void) mg_snprintf(conn, path, sizeof(path), "%s", ssi);
|
||||
if ((p = strrchr(path, '/')) != NULL) {
|
||||
|
||||
Reference in new issue
Block a user