diff options
author | Alex Waugh <alexwaugh@php.net> | 2006-03-07 22:35:30 +0000 |
---|---|---|
committer | Alex Waugh <alexwaugh@php.net> | 2006-03-07 22:35:30 +0000 |
commit | 5dea328391c8ce728386da8b19e198c75cca4762 (patch) | |
tree | faf092aa486a36cc9b051bbc0619a738234e3df6 /sapi/webjames | |
parent | 4e6245978b8654e5d12e784f0d81ba21951950f9 (diff) | |
download | php-git-5dea328391c8ce728386da8b19e198c75cca4762.tar.gz |
MFH Improve DOCUMENT_ROOT setting
Diffstat (limited to 'sapi/webjames')
-rw-r--r-- | sapi/webjames/webjames.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sapi/webjames/webjames.c b/sapi/webjames/webjames.c index a9e82ab98e..3068d8fccc 100644 --- a/sapi/webjames/webjames.c +++ b/sapi/webjames/webjames.c @@ -27,7 +27,7 @@ #include <unixlib/local.h> -#define WEBJAMES_SAPI_VERSION "1.0.0" +#define WEBJAMES_SAPI_VERSION "1.0.1" typedef struct { struct connection *conn; /*structure holding all the details of the current request*/ @@ -96,6 +96,7 @@ static char *sapi_webjames_read_cookies(TSRMLS_D) static void sapi_webjames_register_variables(zval *track_vars_array TSRMLS_DC) { char buf[BUF_SIZE + 1]; + char *docroot; buf[BUF_SIZE] = '\0'; @@ -105,7 +106,9 @@ static void sapi_webjames_register_variables(zval *track_vars_array TSRMLS_DC) ADD_NUM("SERVER_PORT", port); ADD_STRING("SERVER_ADMIN",configuration.webmaster); ADD_STRING("GATEWAY_INTERFACE", "CGI/1.1"); - ADD_STRING("DOCUMENT_ROOT", configuration.site); + + docroot = __unixify(WG(conn)->homedir,0,NULL,1024,0); + if (docroot) ADD_STRING("DOCUMENT_ROOT", docroot); ADD_FIELD("REQUEST_METHOD", methodstr); ADD_FIELD("REQUEST_URI", requesturi); @@ -147,7 +150,7 @@ static void webjames_module_main(TSRMLS_D) char *path; /* Convert filename to Unix format*/ - __riscosify_control|=__RISCOSIFY_DONT_CHECK_DIR; + __riscosify_control|=__RISCOSIFY_STRICT_UNIX_SPECS; path = __unixify(WG(conn)->filename,0,NULL,1024,0); if (path) SG(request_info).path_translated = estrdup(path); |