mirror of
https://github.com/klaussilveira/gitlist.git
synced 2025-11-17 19:20:56 +01:00
Removed unknownAsBin parameter of isBinary() in Util/Repository.php
This commit is contained in:
@@ -137,16 +137,13 @@ class Repository
|
|||||||
* Returns whether the file is binary.
|
* Returns whether the file is binary.
|
||||||
*
|
*
|
||||||
* @param string $file
|
* @param string $file
|
||||||
* @param boolean $unknownAsBin if the file-type is unknown tread it as binary
|
|
||||||
*
|
*
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
public function isBinary($file, $unknownAsBin = false)
|
public function isBinary($file)
|
||||||
{
|
{
|
||||||
if (($pos = strrpos($file, '.')) !== false) {
|
if (($pos = strrpos($file, '.')) !== false) {
|
||||||
$fileType = substr($file, $pos + 1);
|
$fileType = substr($file, $pos + 1);
|
||||||
} elseif ($unknownAsBin) {
|
|
||||||
return true;
|
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -155,17 +152,11 @@ class Repository
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($this->app['binary_filetypes'])) {
|
if (!empty($this->app['binary_filetypes']) && array_key_exists($fileType, $this->app['binary_filetypes'])) {
|
||||||
if (array_key_exists($fileType, $this->app['binary_filetypes'])) {
|
return $this->app['binary_filetypes'][$fileType];
|
||||||
return $this->app['binary_filetypes'][$fileType];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($unknownAsBin) {
|
return false;
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getReadme($repo, $branch = 'master')
|
public function getReadme($repo, $branch = 'master')
|
||||||
|
|||||||
Reference in New Issue
Block a user