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;
}
}