Skip to content

Commit

Permalink
Fix creating a FileSystem iterator from a non-string arg
Browse files Browse the repository at this point in the history
Summary:
Used by parts of symfony that composer users when creating zips/tars/phars

refs #7869

Depends on D5202473

Reviewed By: paulbiss

Differential Revision: D5202739

fbshipit-source-id: b0a935bb56ec41425fefad6aa87be7a28fc3a4ec
  • Loading branch information
fredemmott authored and hhvm-bot committed Jun 8, 2017
1 parent af3471b commit 6bad26b
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion hphp/system/php/spl/iterators/FilesystemIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class FilesystemIterator extends DirectoryIterator {
* @return mixed No value is returned.
*/
public function __construct($path, $flags = null) {
parent::__construct($path);
parent::__construct((string) $path);
if ($flags === null) {
$flags = FilesystemIterator::KEY_AS_PATHNAME |
FilesystemIterator::CURRENT_AS_FILEINFO |
Expand Down
12 changes: 6 additions & 6 deletions hphp/test/frameworks/results/composer_php7.expect
Original file line number Diff line number Diff line change
Expand Up @@ -1095,13 +1095,13 @@ Composer\Test\Json\JsonValidationExceptionTest::testGetErrors with data set #1
Composer\Test\Json\JsonValidationExceptionTest::testGetErrorsWhenNoErrorsProvided
.
Composer\Test\Package\Archiver\ArchivableFilesFinderTest::testGitExcludes
E
.
Composer\Test\Package\Archiver\ArchivableFilesFinderTest::testHgExcludes
E
F
Composer\Test\Package\Archiver\ArchivableFilesFinderTest::testManualExcludes
E
.
Composer\Test\Package\Archiver\ArchivableFilesFinderTest::testSkipExcludes
E
.
Composer\Test\Package\Archiver\ArchiveManagerTest::testArchiveCustomFileName
E
Composer\Test\Package\Archiver\ArchiveManagerTest::testArchiveTar
Expand All @@ -1125,9 +1125,9 @@ Composer\Test\Package\Archiver\HgExcludeFilterTest::testPatternEscape with data
Composer\Test\Package\Archiver\PharArchiverTest::testTarArchive
E
Composer\Test\Package\Archiver\PharArchiverTest::testZipArchive
E
.
Composer\Test\Package\Archiver\ZipArchiverTest::testZipArchive
E
.
Composer\Test\Package\BasePackageTest::testFormatVersionForDevPackage with data set #0
.
Composer\Test\Package\BasePackageTest::testFormatVersionForDevPackage with data set #1
Expand Down
5 changes: 5 additions & 0 deletions hphp/test/slow/ext_spl_iterators/iterator_of_object.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?php

$info = new SplFileInfo(sys_get_temp_dir());
$it = new FilesystemIterator($info);
var_dump($it->getPath() === sys_get_temp_dir());
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bool(true)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
hhvm.php7.all

0 comments on commit 6bad26b

Please sign in to comment.