Ark
Backport #23749 Fix https://github.com/go-gitea/gitea/issues/23715 Backported manually and tested manually.