]> granicus.if.org Git - php/commitdiff
- Baby steps... Use PHP_FOPEN()
authorAndi Gutmans <andi@php.net>
Thu, 30 Mar 2000 22:41:13 +0000 (22:41 +0000)
committerAndi Gutmans <andi@php.net>
Thu, 30 Mar 2000 22:41:13 +0000 (22:41 +0000)
main/fopen_wrappers.c
main/main.c
main/rfc1867.c

index b2a6f1980a5f67ffc9bab41d84899c4abf31aaea..0b99813760a279f97e7ae3e4c04970d628d0bf04 100644 (file)
@@ -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);
                                }
                        }
                }
index 435eb437621e32e2031fddb09098bd43422aa461..06d208ec6101c53ab0fde35fd315beffae594009 100644 (file)
@@ -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)); 
index 3f183cb7d20b650b42a4739b97abf77d826713c6..bca099689d067d446750f4b32c1ca60ff43c602d 100644 (file)
@@ -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;