mirror of
https://codeberg.org/Codeberg/pages-server.git
synced 2025-02-23 20:33:57 +00:00
var/www/pages/index.php : use array_diff() instead of array_filter()
This commit is contained in:
parent
f48218397a
commit
1b10dec06f
@ -38,7 +38,7 @@ $git_prefix = "/data/git/gitea-repositories";
|
|||||||
$parts = explode("/", $request_url);
|
$parts = explode("/", $request_url);
|
||||||
|
|
||||||
# Remove empty first, potentially empty parts between //. If URL ends on "/", last entry in array is empty too. Remove it:
|
# 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));
|
$owner = strtolower(array_shift($parts));
|
||||||
$git_root = realpath("$git_prefix/$owner/pages.git");
|
$git_root = realpath("$git_prefix/$owner/pages.git");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user