diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/font.php | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/font.php b/src/font.php index de39569..d12ceb8 100644 --- a/src/font.php +++ b/src/font.php @@ -15,10 +15,16 @@ if ($file === false || !file_exists($file)) { $real = realpath($file); $allowed = ['/usr/share/fonts', '/usr/local/share/fonts']; -$ok = false; + +foreach (glob('/home/*', GLOB_ONLYDIR) as $home) { + $allowed[] = $home . '/.local/share/fonts'; + $allowed[] = $home . '/.fonts'; +} + +$ok = false; foreach ($allowed as $dir) { - if (str_starts_with($real, $dir)) { + if (str_starts_with($real, realpath($dir) ?: $dir)) { $ok = true; break; } |
