tony2001 Fri Aug 10 08:58:12 2007 UTC
Modified files:
/php-src/ext/standard file.c
Log:
MFB: Fixed bug #42243 (copy() does not ouput an error when the first arg is a
dir)
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/file.c?r1=1.495&r2=1.496&diff_format=u
Index: php-src/ext/standard/file.c
diff -u php-src/ext/standard/file.c:1.495 php-src/ext/standard/file.c:1.496
--- php-src/ext/standard/file.c:1.495 Sat Jul 14 08:38:19 2007
+++ php-src/ext/standard/file.c Fri Aug 10 08:58:12 2007
@@ -21,7 +21,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: file.c,v 1.495 2007/07/14 08:38:19 tony2001 Exp $ */
+/* $Id: file.c,v 1.496 2007/08/10 08:58:12 tony2001 Exp $ */
/* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */
@@ -1903,6 +1903,10 @@
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 (!src_s.sb.st_ino || !dest_s.sb.st_ino) {
goto no_stat;
}
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php