mirror of
https://github.com/go-gitea/gitea
synced 2025-07-05 18:17:19 +00:00
Should also support upper-case README files (#20581)
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
@ -328,11 +328,13 @@ func IsReadmeFile(name string) bool {
|
||||
// the length of the provided extension list.
|
||||
// Note that the '.' should be provided in ext, e.g ".md"
|
||||
func IsReadmeFileExtension(name string, ext ...string) (int, bool) {
|
||||
name = strings.ToLower(name)
|
||||
if len(name) < 6 || name[:6] != "readme" {
|
||||
return 0, false
|
||||
}
|
||||
|
||||
for i, extension := range ext {
|
||||
extension = strings.ToLower(extension)
|
||||
if name[6:] == extension {
|
||||
return i, true
|
||||
}
|
||||
|
Reference in New Issue
Block a user