Merge branch 'PHP-8.0'

* PHP-8.0:
  Revert "Fix bug #64865: Use CONTEXT_DOCUMENT_ROOT for scanning dir tree"
This commit is contained in:
Nikita Popov 2020-10-19 11:24:26 +02:00
commit dbfa6aa9c4
2 changed files with 3 additions and 9 deletions

View file

@ -914,12 +914,9 @@ static int sapi_cgi_activate(void)
if (fcgi_is_fastcgi()) { if (fcgi_is_fastcgi()) {
fcgi_request *request = (fcgi_request*) SG(server_context); fcgi_request *request = (fcgi_request*) SG(server_context);
/* Prefer CONTEXT_DOCUMENT_ROOT if set */ doc_root = FCGI_GETENV(request, "DOCUMENT_ROOT");
doc_root = FCGI_GETENV(request, "CONTEXT_DOCUMENT_ROOT");
doc_root = doc_root ? doc_root : FCGI_GETENV(request, "DOCUMENT_ROOT");
} else { } else {
doc_root = getenv("CONTEXT_DOCUMENT_ROOT"); doc_root = getenv("DOCUMENT_ROOT");
doc_root = doc_root ? doc_root : getenv("DOCUMENT_ROOT");
} }
/* DOCUMENT_ROOT should also be defined at this stage..but better check it anyway */ /* DOCUMENT_ROOT should also be defined at this stage..but better check it anyway */
if (doc_root) { if (doc_root) {

View file

@ -729,10 +729,7 @@ static int sapi_cgi_activate(void) /* {{{ */
/* Load and activate user ini files in path starting from DOCUMENT_ROOT */ /* Load and activate user ini files in path starting from DOCUMENT_ROOT */
if (PG(user_ini_filename) && *PG(user_ini_filename)) { if (PG(user_ini_filename) && *PG(user_ini_filename)) {
/* Prefer CONTEXT_DOCUMENT_ROOT if set */ doc_root = FCGI_GETENV(request, "DOCUMENT_ROOT");
doc_root = FCGI_GETENV(request, "CONTEXT_DOCUMENT_ROOT");
doc_root = doc_root ? doc_root : FCGI_GETENV(request, "DOCUMENT_ROOT");
/* DOCUMENT_ROOT should also be defined at this stage..but better check it anyway */ /* DOCUMENT_ROOT should also be defined at this stage..but better check it anyway */
if (doc_root) { if (doc_root) {
doc_root_len = strlen(doc_root); doc_root_len = strlen(doc_root);