diff options
Diffstat (limited to 'main/fopen_wrappers.c')
| -rw-r--r-- | main/fopen_wrappers.c | 36 |
1 files changed, 10 insertions, 26 deletions
diff --git a/main/fopen_wrappers.c b/main/fopen_wrappers.c index 11d31366d7..88519bc726 100644 --- a/main/fopen_wrappers.c +++ b/main/fopen_wrappers.c @@ -1,7 +1,5 @@ /* +----------------------------------------------------------------------+ - | PHP Version 7 | - +----------------------------------------------------------------------+ | Copyright (c) The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | @@ -17,8 +15,7 @@ +----------------------------------------------------------------------+ */ -/* {{{ includes - */ +/* {{{ includes */ #include "php.h" #include "php_globals.h" #include "SAPI.h" @@ -75,14 +72,8 @@ Allows any change to open_basedir setting in during Startup and Shutdown events, or a tightening during activation/runtime/deactivation */ PHPAPI ZEND_INI_MH(OnUpdateBaseDir) { - char **p, *pathbuf, *ptr, *end; -#ifndef ZTS - char *base = (char *) mh_arg2; -#else - char *base = (char *) ts_resource(*((int *) mh_arg2)); -#endif - - p = (char **) (base + (size_t) mh_arg1); + char **p = (char **) ZEND_INI_GET_ADDR(); + char *pathbuf, *ptr, *end; if (stage == PHP_INI_STAGE_STARTUP || stage == PHP_INI_STAGE_SHUTDOWN || stage == PHP_INI_STAGE_ACTIVATE || stage == PHP_INI_STAGE_DEACTIVATE) { /* We're in a PHP_INI_SYSTEM context, no restrictions */ @@ -275,8 +266,7 @@ PHPAPI int php_check_open_basedir(const char *path) return php_check_open_basedir_ex(path, 1); } -/* {{{ php_check_open_basedir - */ +/* {{{ php_check_open_basedir */ PHPAPI int php_check_open_basedir_ex(const char *path, int warn) { /* Only check when open_basedir is available */ @@ -324,8 +314,7 @@ PHPAPI int php_check_open_basedir_ex(const char *path, int warn) } /* }}} */ -/* {{{ php_fopen_and_set_opened_path - */ +/* {{{ php_fopen_and_set_opened_path */ static FILE *php_fopen_and_set_opened_path(const char *path, const char *mode, zend_string **opened_path) { FILE *fp; @@ -346,8 +335,7 @@ static FILE *php_fopen_and_set_opened_path(const char *path, const char *mode, z } /* }}} */ -/* {{{ php_fopen_primary_script - */ +/* {{{ php_fopen_primary_script */ PHPAPI int php_fopen_primary_script(zend_file_handle *file_handle) { char *path_info; @@ -703,8 +691,7 @@ PHPAPI FILE *php_fopen_with_path(const char *filename, const char *mode, const c } /* }}} */ -/* {{{ php_strip_url_passwd - */ +/* {{{ php_strip_url_passwd */ PHPAPI char *php_strip_url_passwd(char *url) { register char *p, *url_start; @@ -743,24 +730,21 @@ PHPAPI char *php_strip_url_passwd(char *url) } /* }}} */ -/* {{{ expand_filepath - */ +/* {{{ expand_filepath */ PHPAPI char *expand_filepath(const char *filepath, char *real_path) { return expand_filepath_ex(filepath, real_path, NULL, 0); } /* }}} */ -/* {{{ expand_filepath_ex - */ +/* {{{ expand_filepath_ex */ PHPAPI char *expand_filepath_ex(const char *filepath, char *real_path, const char *relative_to, size_t relative_to_len) { return expand_filepath_with_mode(filepath, real_path, relative_to, relative_to_len, CWD_FILEPATH); } /* }}} */ -/* {{{ expand_filepath_use_realpath - */ +/* {{{ expand_filepath_use_realpath */ PHPAPI char *expand_filepath_with_mode(const char *filepath, char *real_path, const char *relative_to, size_t relative_to_len, int realpath_mode) { cwd_state new_state; |
