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

Bad url due to question mark in Wiki page title #26389

Closed
arnaujunquera opened this issue Aug 8, 2023 · 1 comment · Fixed by #26392
Closed

Bad url due to question mark in Wiki page title #26389

arnaujunquera opened this issue Aug 8, 2023 · 1 comment · Fixed by #26392
Labels
topic/ui Change the appearance of the Gitea UI type/bug

Comments

@arnaujunquera
Copy link

arnaujunquera commented Aug 8, 2023

Description

I created a Wiki page and named it "How does it work?". When I try to edit it, it redirects me to the "pages" page instead of the editing page. I've found out this issue is caused by the question mark, as it is not encoded property (as can be seen in the screenshot).

To avoid this bug, I simply replace the question mark by "%3F".

Screenshots

image

Gitea Version

1.20.1

Can you reproduce the bug on the Gitea demo site?

Yes

Operating System

Windows

Browser Version

Chrome 115.0.5790.170

@CaiCandong
Copy link
Member

Here's an easy way to fix the bug:

ctx.Data["PageURL"] = wiki_service.WebPathToURLPath(pageName)

ctx.Data["PageURL"] = template.URL(wiki_service.WebPathToURLPath(pageName))

wxiaoguang added a commit that referenced this issue Aug 9, 2023
Fix #26389

And complete an old TODO: `ctx.Params does un-escaping,..., which is
incorrect.`
GiteaBot pushed a commit to GiteaBot/gitea that referenced this issue Aug 9, 2023
)

Fix go-gitea#26389

And complete an old TODO: `ctx.Params does un-escaping,..., which is
incorrect.`
silverwind pushed a commit that referenced this issue Aug 9, 2023
…6405)

Backport #26392 by @wxiaoguang

Fix #26389

And complete an old TODO: `ctx.Params does un-escaping,..., which is
incorrect.`

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
topic/ui Change the appearance of the Gitea UI type/bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants