From: Zeev Suraski Date: Fri, 7 Apr 2000 22:10:04 +0000 (+0000) Subject: Add a missing expand_filepath() X-Git-Tag: php-4.0RC2~437 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a0ba44495980e76c4bdad7590bdbb02b7e3c257b;p=php Add a missing expand_filepath() --- diff --git a/main/fopen_wrappers.c b/main/fopen_wrappers.c index ea6891f8a2..1d6797997a 100644 --- a/main/fopen_wrappers.c +++ b/main/fopen_wrappers.c @@ -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; } }