summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2012-10-09 13:48:22 +0100
committerDaniel Silverstone <dsilvers@digital-scurf.org>2012-10-09 13:48:22 +0100
commit56d1e0c06732fd08ccb31addc3a6cddc8d29d1d2 (patch)
treee38026215736fff21a96bd4c203b344e7b2f8857
parentcbd4cb507bcbeaa721e23baef7e5da6aa34e8214 (diff)
downloadgitano-56d1e0c06732fd08ccb31addc3a6cddc8d29d1d2.tar.gz
Ensure spaces and nulls cannot form part of a repository name
-rw-r--r--lib/gitano/repository.lua2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/gitano/repository.lua b/lib/gitano/repository.lua
index f0c05f0..a96dbc2 100644
--- a/lib/gitano/repository.lua
+++ b/lib/gitano/repository.lua
@@ -601,6 +601,8 @@ local function find_repository(config, reponame)
log.ddebug("find_repository", reponame)
-- Inject a leading '/'
reponame = "/" .. reponame
+ -- Remove any spaces, tabs, newlines or nulls
+ reponame = reponame:gsub("[%s%z]+", "")
-- Remove any '.' which follows a '/'
reponame = reponame:gsub("/%.+", "/")
-- simplify any sequence of '/' to a single '/'