From 1b10dec06fbc84afe261ebe41ad924ee1dc3b44d Mon Sep 17 00:00:00 2001 From: "codeberg.org" Date: Mon, 4 May 2020 22:56:19 +0200 Subject: [PATCH] var/www/pages/index.php : use array_diff() instead of array_filter() --- var/www/pages/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/var/www/pages/index.php b/var/www/pages/index.php index c645780..a5da5c4 100644 --- a/var/www/pages/index.php +++ b/var/www/pages/index.php @@ -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");