git.cweiske.de
/
phorkie.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Avoid leaking file descriptor when looking for binary files
[phorkie.git]
/
src
/
phorkie
/
File.php
diff --git
a/src/phorkie/File.php
b/src/phorkie/File.php
index cf5daae30ac89f99df85a98ebff366c9e8a40686..97ae47e934e14d974ab062d0882ec478a603bfd8 100644
(file)
--- a/
src/phorkie/File.php
+++ b/
src/phorkie/File.php
@@
-200,9
+200,12
@@
class File
while (false !== ($char = fgetc($fp)) && ++$pos < 100) {
$data .= $char;
if (!$hasMb && ord($char) > 128) {
+ fclose($fp);
return false;
}
}
+ fclose($fp);
+
if (!$hasMb) {
return true;
}