-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Unescape wiki filename string #8374
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
Conversation
Hmm... This builds on my machine. I'll have to figure out what I did wrong to make the test build fail... Sorry about that |
Well, now I'm not too sure what... Maybe someone has a suggestion |
You can test it yourself using:
Or even better:
(that would run all unit tests, but not the integration tests). |
When WikiNameToFilename() passes the name through url.QueseryEscape(), it no longer matches the filename in cases where there are special characters in the name. Adding url.QueryUnescape() restores any special characters in the filename so that these pages can be found.
@guillep2k Thanks for the tip! I think I've worked out a better solution. Basically the issue is that when |
Codecov Report
@@ Coverage Diff @@
## master #8374 +/- ##
==========================================
- Coverage 41.8% 41.79% -0.01%
==========================================
Files 496 496
Lines 65586 65586
==========================================
- Hits 27418 27412 -6
- Misses 34655 34659 +4
- Partials 3513 3515 +2
Continue to review full report at Codecov.
|
No worries. |
@Tekaoh could you add a unit test? |
@lunny I wouldn't know how, or even really what that means lol... I just took a try at fixing the bug I found. My commit fixes it, but I'm not entirely sure about all the correct procedures... |
@Tekaoh You can find many example on https://github.com/go-gitea/gitea/blob/master/models/wiki_test.go#L33 and I think it's not complicated. |
I did some deeper digging and found that this PR is not going to be a good solution. I am therefore going to just close it for now and have another pass at it. Please see my explanation at #8284 (comment) |
This pull request allows wiki pages with special characters in the title to be accessed.
Fixes #8284