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

wiki: URL encoding bug #4090

Closed
1 of 7 tasks
yasuokav opened this issue May 31, 2018 · 7 comments
Closed
1 of 7 tasks

wiki: URL encoding bug #4090

yasuokav opened this issue May 31, 2018 · 7 comments
Labels
Milestone

Comments

@yasuokav
Copy link
Contributor

yasuokav commented May 31, 2018

Description

Since #4058, the links are no longer encoded.
But the URLs(files name) of the existing pages or new pages are still encoded.

The original link is
https://try.gitea.io/yasuokav/link-test/wiki/Test%3F
but now is
https://try.gitea.io/yasuokav/link-test/wiki/Test?

Screenshots

N/A

@sapk
Copy link
Member

sapk commented May 31, 2018

I couldn't reproduce on the try.gitea.io link but maybe I didn't understand the bug.

@yasuokav
Copy link
Contributor Author

@sapk When you click "Click Me" it will lead you to https://try.gitea.io/yasuokav/link-test/wiki/_pages
instead of
https://try.gitea.io/yasuokav/link-test/wiki/Test%3F

Because the URL is no longer encoded as /yasuokav/link-test/wiki/Test%3F

<a href="/yasuokav/link-test/wiki/Test?" rel="nofollow">Click Me</a>

@sapk
Copy link
Member

sapk commented May 31, 2018

I see, but that logical the file is name : Test%3F
I would see it more like a bug fixed by #4058
In your markdown, [Click Me](Test?) should be [Click Me](Test%3F)

If I take github as a reference :
[Click Me](Test?) -> Click Me
[Click Me](Test%3F) -> Click Me

But we should notice it at the release that it could break some links.

@yasuokav
Copy link
Contributor Author

yasuokav commented May 31, 2018

@sapk Yes, you're right. But it will break some links if I use

[[Test?]]

Only [[Test%3F]] will work, but it looks bad.

Maybe we shouldn't encode the file name.

@sapk
Copy link
Member

sapk commented May 31, 2018

We need to encode the filename (in url) are those char are specials. But in case of [[Test?]] maybe url-encode the reference (link) to the page but not the title displayed.

@sapk
Copy link
Member

sapk commented May 31, 2018

I would just be encode link here before URLJoin but I will have to test this before PR.

@lunny
Copy link
Member

lunny commented Jun 15, 2018

should be closed by #4091

@lunny lunny closed this as completed Jun 15, 2018
sapk added a commit to sapk-fork/gitea that referenced this issue Jun 15, 2018
lunny pushed a commit that referenced this issue Jun 17, 2018
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants