Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Referencing to an unexists issue #20224

Open
renbaoshuo opened this issue Jul 4, 2022 · 2 comments
Open

[Bug] Referencing to an unexists issue #20224

renbaoshuo opened this issue Jul 4, 2022 · 2 comments
Labels

Comments

@renbaoshuo
Copy link
Contributor

Description

When the referenced issue does not exist, Gitea will still give a link to the non-existing issue.

Demo: https://try.gitea.io/baoshuo/issue-ref/commits/branch/main

Neither GitHub nor GitLab have this bug.

Gitea Version

1.18.0+dev-58-g9d9bf66c3

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

Snipaste_2022-07-04_10-24-15

Git Version

No response

Operating System

No response

How are you running Gitea?

https://try.gitea.io/

Database

No response

@renbaoshuo
Copy link
Contributor Author

if matchOrg == ctx.Metas["user"] && matchRepo == ctx.Metas["repo"] {
// TODO if m[4]:m[5] is not nil, then link is to a comment,
// and we should indicate that in the text somehow
replaceContent(node, m[0], m[1], createLink(link, id, "ref-issue"))
} else {
orgRepoID := matchOrg + "/" + matchRepo + id
replaceContent(node, m[0], m[1], createLink(link, orgRepoID, "ref-issue"))
}

I think there should check if the referenced issue exists.

@lunny
Copy link
Member

lunny commented Mar 2, 2024

Depends on #29222

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants