php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #47085 rename() returns true even if the file in PHAR does not exist
Submitted: 2009-01-13 11:27 UTC Modified: 2009-02-03 18:30 UTC
From: vrana@php.net Assigned: cellog
Status: Closed Package: PHAR related
PHP Version: 5.3.0alpha3 OS: Windows
Private report: No CVE-ID:
 [2009-01-13 11:27 UTC] vrana@php.net
Description:
------------
rename() returns true with phar:// stream wrapper even if the oldfile doesn't exist.

Reproduce code:
---------------
<?php
rename("phar://a.phar/x", "phar://a.phar/y");
var_dump(rename("phar://a.phar/x", "phar://a.phar/y"));
?>


Expected result:
----------------
bool(false) and some warning

Actual result:
--------------
bool(true)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-02-03 17:10 UTC] cellog@php.net
didn't realize this one was out there, I'll take a look
 [2009-02-03 18:30 UTC] cellog@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.

fixed and added a new test (tests/bug47085.phpt).

This one was easy - I simply hadn't implemented the error on failed rename (oops)
 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Sat Apr 19 12:01:52 2014 UTC