alpha
Login
or
Join now
4uffin.bsky.social
/
core
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
My own copy of Tangled :)
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
Overview
Issues
Pulls
Pipelines
appview: harder repo name validation
author
Anirudh Oppiliappan
date
1 year ago
(Mar 12, 2025, 9:24 PM +0200)
commit
49651a73
49651a734d98d631895dc96df458e56af9a878c9
parent
5bf2f448
5bf2f44866e6c06def22420d1213874529627a44
+13
-1
1 changed file
Expand all
Collapse all
Unified
Split
appview
state
state.go
+13
-1
appview/state/state.go
Reviewed
···
572
572
573
573
repoName := r.FormValue("name")
574
574
if repoName == "" {
575
575
-
s.pages.Notice(w, "repo", "Invalid repo name.")
575
575
+
s.pages.Notice(w, "repo", "Repository name cannot be empty.")
576
576
return
577
577
+
}
578
578
+
579
579
+
// Check for valid repository name (GitHub-like rules)
580
580
+
// No spaces, only alphanumeric characters, dashes, and underscores
581
581
+
for _, char := range repoName {
582
582
+
if !((char >= 'a' && char <= 'z') ||
583
583
+
(char >= 'A' && char <= 'Z') ||
584
584
+
(char >= '0' && char <= '9') ||
585
585
+
char == '-' || char == '_' || char == '.') {
586
586
+
s.pages.Notice(w, "repo", "Repository name can only contain alphanumeric characters, periods, hyphens, and underscores.")
587
587
+
return
588
588
+
}
577
589
}
578
590
579
591
defaultBranch := r.FormValue("branch")