summaryrefslogtreecommitdiff
path: root/ext/standard/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/standard/file.c')
-rw-r--r--ext/standard/file.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/standard/file.c b/ext/standard/file.c
index e46fe8a26e..5e95f1e09d 100644
--- a/ext/standard/file.c
+++ b/ext/standard/file.c
@@ -1903,13 +1903,13 @@ PHPAPI int php_copy_file_ex(char *src, char *dest, int src_chk TSRMLS_DC)
default: /* failed to stat file, does not exist? */
return ret;
}
- if (php_stream_stat_path_ex(dest, PHP_STREAM_URL_STAT_QUIET, &dest_s, NULL) != 0) {
- goto safe_to_copy;
- }
if (S_ISDIR(src_s.sb.st_mode)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "The first argument to copy() function cannot be a directory");
return FAILURE;
}
+ if (php_stream_stat_path_ex(dest, PHP_STREAM_URL_STAT_QUIET, &dest_s, NULL) != 0) {
+ goto safe_to_copy;
+ }
if (!src_s.sb.st_ino || !dest_s.sb.st_ino) {
goto no_stat;
}