ht: limit directory size to 64 chars

This commit is contained in:
Miraty 2022-10-09 23:32:04 +02:00
parent 1aa0d02f5e
commit 938dbe4040
1 changed files with 1 additions and 1 deletions

View File

@ -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;
}