mirror of
https://github.com/misterunknown/ifm.git
synced 2025-08-09 17:46:31 +02:00
10
src/main.php
10
src/main.php
@@ -1141,8 +1141,8 @@ f00bar;
|
||||
$tmp_d = $dir;
|
||||
$tmp_missing_parts = [];
|
||||
while (realpath($tmp_d) === false) {
|
||||
$tmp_i = pathinfo($tmp_d);
|
||||
array_push($tmp_missing_parts, $tmp_i['filename']);
|
||||
$tmp_i = pathinfo($tmp_d, PATHINFO_FILENAME);
|
||||
array_push($tmp_missing_parts, $tmp_i);
|
||||
$tmp_d = dirname($tmp_d);
|
||||
if ($tmp_d == dirname($tmp_d))
|
||||
break;
|
||||
@@ -1153,6 +1153,8 @@ f00bar;
|
||||
return false;
|
||||
elseif ($rpDir == $rpConfig)
|
||||
return true;
|
||||
elseif (!file_exists($rpDir))
|
||||
return false;
|
||||
elseif (0 === strpos($rpDir, $rpConfig))
|
||||
return true;
|
||||
else
|
||||
@@ -1160,7 +1162,7 @@ f00bar;
|
||||
}
|
||||
|
||||
private function chDirIfNecessary($d) {
|
||||
if (substr(getcwd(), strlen($this->getScriptRoot())) != $this->getValidDir($d) && !empty($d))
|
||||
if (substr(getcwd(), strlen($this->getRootDir())) != $this->getValidDir($d) && !empty($d))
|
||||
chdir($d);
|
||||
}
|
||||
|
||||
@@ -1168,7 +1170,7 @@ f00bar;
|
||||
$type = strtolower($type);
|
||||
switch ($type) {
|
||||
case "aac": case "aiff": case "mid": case "mp3": case "wav": return 'icon icon-file-audio'; break;
|
||||
case "ai": case "bmp": case "eps": case "tiff": case "gif": case "jpg": case "jpeg": case "png": case "psd": case "svg": return 'icon icon-file-image'; break;
|
||||
case "ai": case "bmp": case "eps": case "tiff": case "gif": case "jpg": case "jpeg": case "png": case "psd": case "svg": case "webp": return 'icon icon-file-image'; break;
|
||||
case "avi": case "flv": case "mp4": case "mpg": case "mkv": case "mpeg": case "webm": case "wmv": case "mov": return 'icon icon-file-video'; break;
|
||||
case "c": case "cpp": case "css": case "dat": case "h": case "html": case "java": case "js": case "php": case "py": case "sql": case "xml": case "yml": case "json": return 'icon icon-file-code'; break;
|
||||
case "doc": case "docx": case "odf": case "odt": case "rtf": return 'icon icon-file-word'; break;
|
||||
|
Reference in New Issue
Block a user