felipe Fri May 16 12:44:11 2008 UTC
Modified files: (Branch: PHP_5_3)
/php-src/ext/standard file.c
Log:
- Changed 'Z' to 's' (parameter parsing), the code didn't check if the
parameter is a string.
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/file.c?r1=1.409.2.6.2.28.2.13&r2=1.409.2.6.2.28.2.14&diff_format=u
Index: php-src/ext/standard/file.c
diff -u php-src/ext/standard/file.c:1.409.2.6.2.28.2.13
php-src/ext/standard/file.c:1.409.2.6.2.28.2.14
--- php-src/ext/standard/file.c:1.409.2.6.2.28.2.13 Sun May 4 21:17:32 2008
+++ php-src/ext/standard/file.c Fri May 16 12:44:11 2008
@@ -21,7 +21,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: file.c,v 1.409.2.6.2.28.2.13 2008/05/04 21:17:32 colder Exp $ */
+/* $Id: file.c,v 1.409.2.6.2.28.2.14 2008/05/16 12:44:11 felipe Exp $ */
/* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */
@@ -1717,24 +1717,26 @@
Copy a file */
PHP_FUNCTION(copy)
{
- zval **source, **target, *zcontext = NULL;
+ char *source, *target;
+ int source_len, target_len;
+ zval *zcontext = NULL;
php_stream_context *context;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ZZ|r", &source,
&target, &zcontext) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|r", &source,
&source_len, &target, &target_len, &zcontext) == FAILURE) {
return;
}
- if (PG(safe_mode) &&(!php_checkuid(Z_STRVAL_PP(source), NULL,
CHECKUID_CHECK_FILE_AND_DIR))) {
+ if (PG(safe_mode) &&(!php_checkuid(source, NULL,
CHECKUID_CHECK_FILE_AND_DIR))) {
RETURN_FALSE;
}
- if (php_check_open_basedir(Z_STRVAL_PP(source) TSRMLS_CC)) {
+ if (php_check_open_basedir(source TSRMLS_CC)) {
RETURN_FALSE;
}
context = php_stream_context_from_zval(zcontext, 0);
- if (php_copy_file(Z_STRVAL_PP(source), Z_STRVAL_PP(target) TSRMLS_CC)
== SUCCESS) {
+ if (php_copy_file(source, target TSRMLS_CC) == SUCCESS) {
RETURN_TRUE;
} else {
RETURN_FALSE;
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php