From 938dbe404046d93e28cfdf9f1d338481effaaed1 Mon Sep 17 00:00:00 2001 From: Miraty Date: Sun, 9 Oct 2022 23:32:04 +0200 Subject: [PATCH] ht: limit directory size to 64 chars --- fn/ht.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fn/ht.php b/fn/ht.php index 27f5a59..42b99d1 100644 --- a/fn/ht.php +++ b/fn/ht.php @@ -16,7 +16,7 @@ function listFsDirs($username) { $absoluteDirs = glob(CONF['ht']['ht_path'] . "/" . $username . "/*/", GLOB_ONLYDIR); $dirs = []; foreach ($absoluteDirs as $absoluteDir) - if (preg_match("/^[\p{L}\p{N}_-]+$/u", basename($absoluteDir))) + if (preg_match('/^[\p{L}\p{N}_-]{1,64}$/u', basename($absoluteDir))) array_push($dirs, basename($absoluteDir)); return $dirs; }