Diff options
authorBryce Kwon <bryce@brycekwon.com>
committerBryce Kwon <bryce@brycekwon.com>
commit
parent
tree
download
Refuse pathspec magic through one helper
Diffstat (limited to 'source/ui-shared.c')
-rw-r--r--source/ui-shared.c8
1 file changed, 8 insertions, 0 deletions
diff --git a/source/ui-shared.c b/source/ui-shared.c
index cef57eb..fc4e559 100644
--- a/source/ui-shared.c
+++ b/source/ui-shared.c
@@ -1534,6 +1534,14 @@ int cgit_prepare_walk(struct rev_info *rev)
return -1;
}
+int cgit_refuse_pathspec_magic(const char *path)
+{
+ if (!path || path[0] != ':')
+ return 0;
+ cgit_print_error_page(400, "Bad Request", "Invalid path");
+ return -1;
+}
+
static void add_clone_urls(void (*fn)(const char *), char *urls, char *suffix)
{
struct strbuf **url_list = strbuf_split_str(urls, ' ', 0);