From: Zeev Suraski Date: Mon, 10 Apr 2000 22:50:32 +0000 (+0000) Subject: Fix another missing opened_path assignment X-Git-Tag: php-4.0RC2~419 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8ec20a16ed09b37996c42edcdeb7d08d9a623150;p=php Fix another missing opened_path assignment --- diff --git a/main/fopen_wrappers.c b/main/fopen_wrappers.c index 116985675e..64d59be820 100644 --- a/main/fopen_wrappers.c +++ b/main/fopen_wrappers.c @@ -369,15 +369,23 @@ PHPAPI FILE *php_fopen_with_path(char *filename, char *mode, char *path, char ** } return fp; } else { - if (php_check_open_basedir(filename)) return NULL; - return PHP_FOPEN(filename, mode); + if (php_check_open_basedir(filename)) { + return NULL; + } + fp = PHP_FOPEN(filename, mode); + if (fp && opened_path) { + *opened_path = expand_filepath(filename); + } + return fp; } } if (!path || (path && !*path)) { if (PG(safe_mode) && (!php_checkuid(filename, cm))) { return NULL; } - if (php_check_open_basedir(filename)) return NULL; + if (php_check_open_basedir(filename)) { + return NULL; + } fp = PHP_FOPEN(filename, mode); if (fp && opened_path) { *opened_path = strdup(filename);