Backport #29953 by @HEREYUA Fix: [#29933](https://github.com/go-gitea/gitea/issues/29933) **Before**  **After**  Co-authored-by: HEREYUA <37935145+HEREYUA@users.noreply.github.com> Co-authored-by: silverwind <me@silverwind.io>