]> granicus.if.org Git - php/commitdiff
Add a missing expand_filepath()
authorZeev Suraski <zeev@php.net>
Fri, 7 Apr 2000 22:10:04 +0000 (22:10 +0000)
committerZeev Suraski <zeev@php.net>
Fri, 7 Apr 2000 22:10:04 +0000 (22:10 +0000)
main/fopen_wrappers.c

index ea6891f8a2f2bed941468ae96a012c4a4b159c2d..1d6797997a74dbc66557c58fa718783e6429e966 100644 (file)
@@ -199,12 +199,22 @@ PHPAPI FILE *php_fopen_wrapper(char *path, char *mode, int options, int *issock,
        if (options & USE_PATH && PG(include_path) != NULL) {
                return php_fopen_with_path(path, mode, PG(include_path), opened_path);
        } else {
-               if(!strcmp(mode,"r") || !strcmp(mode,"r+")) cm=0;
+               FILE *fp;
+
+               if (!strcmp(mode,"r") || !strcmp(mode,"r+")) {
+                       cm=0;
+               }
                if (options & ENFORCE_SAFE_MODE && PG(safe_mode) && (!php_checkuid(path, cm))) {
                        return NULL;
                }
-               if (php_check_open_basedir(path)) return NULL;
-               return PHP_FOPEN(path, mode);
+               if (php_check_open_basedir(path)) {
+                       return NULL;
+               }
+               fp = PHP_FOPEN(path, mode);
+               if (fp && opened_path) {
+                       *opened_path = expand_filepath(path);
+               }
+               return fp;
        }
 }