diff options
author | Andi Gutmans <andi@php.net> | 2000-03-30 22:41:13 +0000 |
---|---|---|
committer | Andi Gutmans <andi@php.net> | 2000-03-30 22:41:13 +0000 |
commit | 9df7df3293302198a29b1657682dba49ce02aa6b (patch) | |
tree | 054ac1524387e60e5e591f5ddc9b84f80575c4ff /main | |
parent | 72b57c66f096e1a16e865de808296bfffbf3c41b (diff) | |
download | php-git-9df7df3293302198a29b1657682dba49ce02aa6b.tar.gz |
- Baby steps... Use PHP_FOPEN()
Diffstat (limited to 'main')
-rw-r--r-- | main/fopen_wrappers.c | 16 | ||||
-rw-r--r-- | main/main.c | 2 | ||||
-rw-r--r-- | main/rfc1867.c | 2 |
3 files changed, 10 insertions, 10 deletions
diff --git a/main/fopen_wrappers.c b/main/fopen_wrappers.c index b2a6f1980a..0b99813760 100644 --- a/main/fopen_wrappers.c +++ b/main/fopen_wrappers.c @@ -204,7 +204,7 @@ PHPAPI FILE *php_fopen_wrapper(char *path, char *mode, int options, int *issock, return NULL; } if (php_check_open_basedir(path)) return NULL; - return fopen(path, mode); + return PHP_FOPEN(path, mode); } } @@ -282,7 +282,7 @@ PHPAPI FILE *php_fopen_primary_script(void) SG(request_info).path_translated = NULL; return NULL; } - fp = fopen(fn, "r"); + fp = PHP_FOPEN(fn, "r"); /* refuse to open anything that is not a regular file */ if (fp && (0 > fstat(fileno(fp), &st) || !S_ISREG(st.st_mode))) { @@ -331,7 +331,7 @@ PHPAPI FILE *php_fopen_with_path(char *filename, char *mode, char *path, char ** return NULL; } if (php_check_open_basedir(filename)) return NULL; - fp = fopen(filename, mode); + fp = PHP_FOPEN(filename, mode); if (fp && opened_path) { *opened_path = expand_filepath(filename); } @@ -353,14 +353,14 @@ PHPAPI FILE *php_fopen_with_path(char *filename, char *mode, char *path, char ** return NULL; } if (php_check_open_basedir(trypath)) return NULL; - fp = fopen(trypath, mode); + fp = PHP_FOPEN(trypath, mode); if (fp && opened_path) { *opened_path = expand_filepath(trypath); } return fp; } else { if (php_check_open_basedir(filename)) return NULL; - return fopen(filename, mode); + return PHP_FOPEN(filename, mode); } } if (!path || (path && !*path)) { @@ -368,7 +368,7 @@ PHPAPI FILE *php_fopen_with_path(char *filename, char *mode, char *path, char ** return NULL; } if (php_check_open_basedir(filename)) return NULL; - fp = fopen(filename, mode); + fp = PHP_FOPEN(filename, mode); if (fp && opened_path) { *opened_path = strdup(filename); } @@ -395,7 +395,7 @@ PHPAPI FILE *php_fopen_with_path(char *filename, char *mode, char *path, char ** return NULL; } } - if ((fp = fopen(trypath, mode)) != NULL) { + if ((fp = PHP_FOPEN(trypath, mode)) != NULL) { if (php_check_open_basedir(trypath)) { fclose(fp); efree(pathbuf); @@ -898,7 +898,7 @@ static FILE *php_fopen_url_wrapper(const char *path, char *mode, int options, in if (php_check_open_basedir((char *) path)) { fp = NULL; } else { - fp = fopen(path, mode); + fp = PHP_FOPEN(path, mode); } } } diff --git a/main/main.c b/main/main.c index 435eb43762..06d208ec61 100644 --- a/main/main.c +++ b/main/main.c @@ -250,7 +250,7 @@ void php_log_err(char *log_message) return; } #endif - log_file = fopen(PG(error_log), "a"); + log_file = PHP_FOPEN(PG(error_log), "a"); if (log_file != NULL) { time(&error_time); strftime(error_time_str, 128, "%d-%b-%Y %H:%M:%S", localtime_r(&error_time, &tmbuf)); diff --git a/main/rfc1867.c b/main/rfc1867.c index 3f183cb7d2..bca099689d 100644 --- a/main/rfc1867.c +++ b/main/rfc1867.c @@ -254,7 +254,7 @@ static void php_mime_split(char *buf, int cnt, char *boundary, zval *array_ptr) } else if ((loc - ptr - 4) <= 0) { fn = "none"; } else { - fp = fopen(fn, "wb"); + fp = PHP_FOPEN(fn, "wb"); if (!fp) { php_error(E_WARNING, "File Upload Error - Unable to open temporary file [%s]", fn); SAFE_RETURN; |