Accept . _ and 0-9 plugin names
authorChocobozzz <me@florianbigard.com>
Mon, 6 Jan 2020 15:20:01 +0000 (16:20 +0100)
committerChocobozzz <me@florianbigard.com>
Mon, 6 Jan 2020 15:20:01 +0000 (16:20 +0100)
server/helpers/custom-validators/plugins.ts

index 2e317574232dae9357c5e8d9febde464a1f10b74..332418b49cc566574546c50052d9d1e6a1895f60 100644 (file)
@@ -20,7 +20,7 @@ function isPluginNameValid (value: string) {
 function isNpmPluginNameValid (value: string) {
   return exists(value) &&
     validator.isLength(value, PLUGINS_CONSTRAINTS_FIELDS.NAME) &&
-    validator.matches(value, /^[a-z\-]+$/) &&
+    validator.matches(value, /^[a-z\-._0-9]+$/) &&
     (value.startsWith('peertube-plugin-') || value.startsWith('peertube-theme-'))
 }