Skip to content

Commit 944e948

Browse files
author
Ilia Alshanetsky
committed
disable realpath cache for safe_mode & open_basedir
1 parent dea7cce commit 944e948

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

main/main.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1091,6 +1091,11 @@ int php_request_startup(TSRMLS_D)
10911091
zend_set_timeout(PG(max_input_time));
10921092
}
10931093

1094+
/* Disable realpath cache if safe_mode or open_basedir are set */
1095+
if (PG(safe_mode) || (PG(open_basedir) && *PG(open_basedir))) {
1096+
CWDG(realpath_cache_size_limit) = 0;
1097+
}
1098+
10941099
if (PG(expose_php)) {
10951100
sapi_add_header(SAPI_PHP_VERSION_HEADER, sizeof(SAPI_PHP_VERSION_HEADER)-1, 1);
10961101
}

0 commit comments

Comments
 (0)