diff options
author | Stan Hu <stanhu@gmail.com> | 2018-07-25 15:19:22 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2018-07-25 15:19:22 +0300 |
commit | ff3291e56dfeebb35d7afdf7a4ec7b23c76cacc7 (patch) | |
tree | a77d160d698b03fb9de9643b77d85779e155bf75 /app/controllers/import | |
parent | 537f87a169576544b26347b5b3a6ab22d2cbfc00 (diff) |
Tighten up regular expression for project names
Diffstat (limited to 'app/controllers/import')
-rw-r--r-- | app/controllers/import/bitbucket_server_controller.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/controllers/import/bitbucket_server_controller.rb b/app/controllers/import/bitbucket_server_controller.rb index d8464d29501..77b7a0bb50c 100644 --- a/app/controllers/import/bitbucket_server_controller.rb +++ b/app/controllers/import/bitbucket_server_controller.rb @@ -4,14 +4,14 @@ class Import::BitbucketServerController < Import::BaseController before_action :validate_import_params, only: [:create] # As a basic sanity check to prevent URL injection, restrict project - # repostiory input and repository slugs to allowed characters. For Bitbucket: + # repository input and repository slugs to allowed characters. For Bitbucket: # # Project keys must start with a letter and may only consist of ASCII letters, numbers and underscores (A-Z, a-z, 0-9, _). # # Repository names are limited to 128 characters. They must start with a # letter or number and may contain spaces, hyphens, underscores, and periods. # (https://community.atlassian.com/t5/Answers-Developer-Questions/stash-repository-names/qaq-p/499054) - VALID_BITBUCKET_CHARS = /\A[a-zA-z0-9\-_\.\s]*$/ + VALID_BITBUCKET_CHARS = /\A[a-zA-z0-9\-_\.\s]+\z/ SERVER_ERRORS = [SocketError, OpenSSL::SSL::SSLError, |