X-Git-Url: https://git.cweiske.de/phorkie.git/blobdiff_plain/1ef220ba41f37c0e6654277e3d0a4a5e4d451de2..fce55a36d47a9783e631a78925f2ad1b28dbe555:/src/phorkie/File.php diff --git a/src/phorkie/File.php b/src/phorkie/File.php index c86e5e0..331f2e5 100644 --- a/src/phorkie/File.php +++ b/src/phorkie/File.php @@ -148,6 +148,13 @@ class File public function isText() { $ext = $this->getExt(); + if ($ext == '') { + //no file extension? then consider the size + $size = filesize($this->getFullPath()); + //files <= 4kiB are considered to be text + return $size <= 4096; + } + if (!isset($GLOBALS['phorkie']['languages'][$ext]['mime'])) { return false; }