forked from gitea/gitea

Backport #26374 by @CaiCandong fix #26360 Before:  After:  Co-authored-by: CaiCandong <50507092+CaiCandong@users.noreply.github.com>