var/www/pages/index.php : use array_diff() instead of array_filter()

This commit is contained in:
codeberg.org 2020-05-04 22:56:19 +02:00
parent f48218397a
commit 1b10dec06f

View File

@ -38,7 +38,7 @@ $git_prefix = "/data/git/gitea-repositories";
$parts = explode("/", $request_url);
# Remove empty first, potentially empty parts between //. If URL ends on "/", last entry in array is empty too. Remove it:
$parts = array_filter($parts, function($p) { return strlen($p) > 0; });
$parts = array_diff($parts, array(""));
$owner = strtolower(array_shift($parts));
$git_root = realpath("$git_prefix/$owner/pages.git");