php_error_docref(NULL TSRMLS_CC, E_WARNING, "The first argument to copy() function cannot be a directory");
return FAILURE;
}
+
+ switch (php_stream_stat_path_ex(dest, PHP_STREAM_URL_STAT_QUIET, &dest_s, NULL)) {
+ case -1:
+ /* non-statable stream */
+ goto safe_to_copy;
+ break;
+ case 0:
+ break;
+ default: /* failed to stat file, does not exist? */
+ return ret;
+ }
+ if (S_ISDIR(dest_s.sb.st_mode)) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "The second 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;
}