-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Prevent NPE on partial match of compare URL and allow short SHA1 compare URLs #18472
Conversation
- Don't panic when the full regex isn't matched and allow the usage of a shorter sha1 being used. - Resolves go-gitea#18471
8adabdd
to
21442e8
Compare
Regression #17924 |
Codecov Report
@@ Coverage Diff @@
## main #18472 +/- ##
=======================================
Coverage 46.26% 46.27%
=======================================
Files 842 842
Lines 121181 121185 +4
=======================================
+ Hits 56068 56073 +5
+ Misses 58307 58299 -8
- Partials 6806 6813 +7
Continue to review full report at Codecov.
|
Oh actually @Gusted it would be good to add a test case for something where there would only be a partial match |
Unfortunately go-gitea#18472 only fixed part of the ways a nil pointer can occur in the compare url. We also need to ensure that the match array has all the matches present. Fix go-gitea#18471 Related go-gitea#18472 Signed-off-by: Andrew Thornton <art27@cantab.net>
Backport go-gitea#18490 Unfortunately go-gitea#18472 only fixed part of the ways a nil pointer can occur in the compare url. We also need to ensure that the match array has all the matches present. Fix go-gitea#18471 Related go-gitea#18472 Signed-off-by: Andrew Thornton <art27@cantab.net>
…are URLs (go-gitea#18472) * Don't panic & allow shorter sha1 - Don't panic when the full regex isn't matched and allow the usage of a shorter sha1 being used. - Resolves go-gitea#18471 * Update modules/markup/html.go Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Fix #18471