Skip to content
This repository was archived by the owner on Jan 31, 2020. It is now read-only.

Commit 8a34a5a

Browse files
committed
Merge branch 'hotfix/180'
Close #180 Fixes #170 Fixes #176
2 parents 268a704 + a56abf9 commit 8a34a5a

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@ All notable changes to this project will be documented in this file, in reverse
1818

1919
### Fixed
2020

21-
- Nothing.
21+
- [#180](https://github.com/zendframework/zend-validator/pull/180) fixes how
22+
`Zend\Validator\File\MimeType` "closes" the open FileInfo handle for the file
23+
being validated, using `unset()` instead of `finfo_close()`; this resolves a
24+
segfault that occurs on older PHP versions.
2225

2326
## 2.9.1 - 2017-05-17
2427

src/File/MimeType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ public function isValid($value, $file = null)
385385
$this->type = null;
386386
if (! empty($this->finfo)) {
387387
$this->type = finfo_file($this->finfo, $file);
388-
finfo_close($this->finfo);
388+
unset($this->finfo);
389389
}
390390
}
391391

0 commit comments

Comments
 (0)