Sometimes finfo_open chokes on the magic file and floods warnings
Sometimes finfo_open chokes on the magic file and floods warnings

All sorts of junk "invalid offset" and "invalid type" messages, suppress
them

--- a/include/git/Blob.class.php
+++ b/include/git/Blob.class.php
@@ -266,7 +266,7 @@
 			}
 		}
 
-		$finfo = finfo_open(FILEINFO_MIME, $magicdb);
+		$finfo = @finfo_open(FILEINFO_MIME, $magicdb);
 		if ($finfo) {
 			$mime = finfo_buffer($finfo, $this->data, FILEINFO_MIME);
 			if ($mime && strpos($mime, '/')) {

comments