mirror of
https://codeberg.org/Codeberg/pages-server.git
synced 2025-01-19 08:57:55 +00:00
strtolower(owner)
This commit is contained in:
parent
3ea456d4d7
commit
d0ea43788d
1 changed files with 4 additions and 3 deletions
|
@ -18,9 +18,8 @@ if (preg_match("/\/[a-zA-Z0-9_ +\-\/\.]+\z/", $request_url) != 1) {
|
||||||
|
|
||||||
$parts = explode("/", $request_url);
|
$parts = explode("/", $request_url);
|
||||||
array_shift($parts); # remove empty first
|
array_shift($parts); # remove empty first
|
||||||
|
$owner = strtolower(array_shift($parts));
|
||||||
$git_root = "/data/git/gitea-repositories/" . array_shift($parts) . "/pages.git";
|
$git_root = "/data/git/gitea-repositories/$owner/pages.git";
|
||||||
|
|
||||||
$file_url = implode("/", $parts);
|
$file_url = implode("/", $parts);
|
||||||
|
|
||||||
if (!is_dir($git_root)) {
|
if (!is_dir($git_root)) {
|
||||||
|
@ -37,6 +36,8 @@ if ($retval != 0) {
|
||||||
}
|
}
|
||||||
|
|
||||||
$ext = pathinfo($file_url, PATHINFO_EXTENSION);
|
$ext = pathinfo($file_url, PATHINFO_EXTENSION);
|
||||||
|
$ext = strtolower($ext);
|
||||||
|
|
||||||
if ($ext == "svg") {
|
if ($ext == "svg") {
|
||||||
header("Content-Type: image/svg+xml");
|
header("Content-Type: image/svg+xml");
|
||||||
} elseif ($ext == "jpg") {
|
} elseif ($ext == "jpg") {
|
||||||
|
|
Loading…
Reference in a new issue