cellog Tue Feb 3 18:29:25 2009 UTC
Added files: (Branch: PHP_5_3)
/php-src/ext/phar/tests bug47085.phpt
Modified files:
/php-src NEWS
/php-src/ext/phar stream.c
Log:
fix bug #47085:rename() returns true even if the file in PHAR does not exist
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.965.2.483&r2=1.2027.2.547.2.965.2.484&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.965.2.483
php-src/NEWS:1.2027.2.547.2.965.2.484
--- php-src/NEWS:1.2027.2.547.2.965.2.483 Tue Feb 3 18:17:24 2009
+++ php-src/NEWS Tue Feb 3 18:29:25 2009
@@ -3,6 +3,7 @@
?? ??? 2009, PHP 5.3.0 Beta 2
- Fixed bug #47265 (generating phar.phar failes because of safe_mode). (Greg)
- Fixed bug #47229 (preg_quote() should escape the '-' char). (Nuno)
+- Fixed bug #47085 (rename() returns true even if the file in PHAR does not
exist). (Greg)
- Fixed bug #47031 (Fix constants in DualIterator example). (Etienne)
- Fixed bug #46347 (parse_ini_file() doesn't support * in keys). (Nuno)
http://cvs.php.net/viewvc.cgi/php-src/ext/phar/stream.c?r1=1.27.2.22&r2=1.27.2.23&diff_format=u
Index: php-src/ext/phar/stream.c
diff -u php-src/ext/phar/stream.c:1.27.2.22 php-src/ext/phar/stream.c:1.27.2.23
--- php-src/ext/phar/stream.c:1.27.2.22 Wed Dec 31 11:15:42 2008
+++ php-src/ext/phar/stream.c Tue Feb 3 18:29:25 2009
@@ -888,6 +888,14 @@
is_dir = entry->is_dir;
} else {
is_dir = zend_hash_exists(&(phar->virtual_dirs),
resource_from->path+1, strlen(resource_from->path)-1);
+ if (!is_dir) {
+ /* file does not exist */
+ php_url_free(resource_from);
+ php_url_free(resource_to);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "phar
error: cannot rename \"%s\" to \"%s\" from extracted phar archive, source does
not exist", url_from, url_to);
+ return 0;
+
+ }
}
/* Rename directory. Update all nested paths */
http://cvs.php.net/viewvc.cgi/php-src/ext/phar/tests/bug47085.phpt?view=markup&rev=1.1
Index: php-src/ext/phar/tests/bug47085.phpt
+++ php-src/ext/phar/tests/bug47085.phpt
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php