summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/font.php10
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)) {
15 15
16$real = realpath($file); 16$real = realpath($file);
17$allowed = ['/usr/share/fonts', '/usr/local/share/fonts']; 17$allowed = ['/usr/share/fonts', '/usr/local/share/fonts'];
18$ok = false; 18
19foreach (glob('/home/*', GLOB_ONLYDIR) as $home) {
20 $allowed[] = $home . '/.local/share/fonts';
21 $allowed[] = $home . '/.fonts';
22}
23
24$ok = false;
19 25
20foreach ($allowed as $dir) { 26foreach ($allowed as $dir) {
21 if (str_starts_with($real, $dir)) { 27 if (str_starts_with($real, realpath($dir) ?: $dir)) {
22 $ok = true; 28 $ok = true;
23 break; 29 break;
24 } 30 }