diff options
Diffstat (limited to 'main/php_open_temporary_file.c')
-rw-r--r-- | main/php_open_temporary_file.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/main/php_open_temporary_file.c b/main/php_open_temporary_file.c index 7968e0cc2c..eca5da7754 100644 --- a/main/php_open_temporary_file.c +++ b/main/php_open_temporary_file.c @@ -1,8 +1,8 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2015 The PHP Group | + | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -94,7 +94,7 @@ * SUCH DAMAGE. */ -static int php_do_open_temporary_file(const char *path, const char *pfx, char **opened_path_p TSRMLS_DC) +static int php_do_open_temporary_file(const char *path, const char *pfx, char **opened_path_p) { char *trailing_slash; char *opened_path; @@ -125,9 +125,9 @@ static int php_do_open_temporary_file(const char *path, const char *pfx, char ** } new_state.cwd = estrdup(cwd); - new_state.cwd_length = strlen(cwd); + new_state.cwd_length = (int)strlen(cwd); - if (virtual_file_ex(&new_state, path, NULL, CWD_REALPATH TSRMLS_CC)) { + if (virtual_file_ex(&new_state, path, NULL, CWD_REALPATH)) { efree(new_state.cwd); return -1; } @@ -189,7 +189,7 @@ PHPAPI void php_shutdown_temporary_directory(void) /* * Determine where to place temporary files. */ -PHPAPI const char* php_get_temporary_directory(TSRMLS_D) +PHPAPI const char* php_get_temporary_directory(void) { /* Did we determine the temporary directory already? */ if (temporary_directory) { @@ -200,7 +200,7 @@ PHPAPI const char* php_get_temporary_directory(TSRMLS_D) { char *sys_temp_dir = PG(sys_temp_dir); if (sys_temp_dir) { - int len = strlen(sys_temp_dir); + int len = (int)strlen(sys_temp_dir); if (len >= 2 && sys_temp_dir[len - 1] == DEFAULT_SLASH) { temporary_directory = zend_strndup(sys_temp_dir, len - 1); return temporary_directory; @@ -264,7 +264,7 @@ PHPAPI const char* php_get_temporary_directory(TSRMLS_D) * This function should do its best to return a file pointer to a newly created * unique file, on every platform. */ -PHPAPI int php_open_temporary_fd_ex(const char *dir, const char *pfx, char **opened_path_p, zend_bool open_basedir_check TSRMLS_DC) +PHPAPI int php_open_temporary_fd_ex(const char *dir, const char *pfx, char **opened_path_p, zend_bool open_basedir_check) { int fd; const char *temp_dir; @@ -278,17 +278,17 @@ PHPAPI int php_open_temporary_fd_ex(const char *dir, const char *pfx, char **ope if (!dir || *dir == '\0') { def_tmp: - temp_dir = php_get_temporary_directory(TSRMLS_C); + temp_dir = php_get_temporary_directory(); - if (temp_dir && *temp_dir != '\0' && (!open_basedir_check || !php_check_open_basedir(temp_dir TSRMLS_CC))) { - return php_do_open_temporary_file(temp_dir, pfx, opened_path_p TSRMLS_CC); + if (temp_dir && *temp_dir != '\0' && (!open_basedir_check || !php_check_open_basedir(temp_dir))) { + return php_do_open_temporary_file(temp_dir, pfx, opened_path_p); } else { return -1; } } /* Try the directory given as parameter. */ - fd = php_do_open_temporary_file(dir, pfx, opened_path_p TSRMLS_CC); + fd = php_do_open_temporary_file(dir, pfx, opened_path_p); if (fd == -1) { /* Use default temporary directory. */ goto def_tmp; @@ -296,15 +296,15 @@ def_tmp: return fd; } -PHPAPI int php_open_temporary_fd(const char *dir, const char *pfx, char **opened_path_p TSRMLS_DC) +PHPAPI int php_open_temporary_fd(const char *dir, const char *pfx, char **opened_path_p) { - return php_open_temporary_fd_ex(dir, pfx, opened_path_p, 0 TSRMLS_CC); + return php_open_temporary_fd_ex(dir, pfx, opened_path_p, 0); } -PHPAPI FILE *php_open_temporary_file(const char *dir, const char *pfx, char **opened_path_p TSRMLS_DC) +PHPAPI FILE *php_open_temporary_file(const char *dir, const char *pfx, char **opened_path_p) { FILE *fp; - int fd = php_open_temporary_fd(dir, pfx, opened_path_p TSRMLS_CC); + int fd = php_open_temporary_fd(dir, pfx, opened_path_p); if (fd == -1) { return NULL; |