aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/custom-validators
diff options
context:
space:
mode:
Diffstat (limited to 'server/helpers/custom-validators')
-rw-r--r--server/helpers/custom-validators/plugins.ts8
1 files changed, 6 insertions, 2 deletions
diff --git a/server/helpers/custom-validators/plugins.ts b/server/helpers/custom-validators/plugins.ts
index b5e32abc2..63af91a44 100644
--- a/server/helpers/custom-validators/plugins.ts
+++ b/server/helpers/custom-validators/plugins.ts
@@ -41,7 +41,11 @@ function isPluginEngineValid (engine: any) {
41} 41}
42 42
43function isPluginHomepage (value: string) { 43function isPluginHomepage (value: string) {
44 return isUrlValid(value) 44 return exists(value) && (!value || isUrlValid(value))
45}
46
47function isPluginBugs (value: string) {
48 return exists(value) && (!value || isUrlValid(value))
45} 49}
46 50
47function areStaticDirectoriesValid (staticDirs: any) { 51function areStaticDirectoriesValid (staticDirs: any) {
@@ -85,7 +89,7 @@ function isPackageJSONValid (packageJSON: PluginPackageJson, pluginType: PluginT
85 isPluginEngineValid(packageJSON.engine) && 89 isPluginEngineValid(packageJSON.engine) &&
86 isPluginHomepage(packageJSON.homepage) && 90 isPluginHomepage(packageJSON.homepage) &&
87 exists(packageJSON.author) && 91 exists(packageJSON.author) &&
88 isUrlValid(packageJSON.bugs) && 92 isPluginBugs(packageJSON.bugs) &&
89 (pluginType === PluginType.THEME || isSafePath(packageJSON.library)) && 93 (pluginType === PluginType.THEME || isSafePath(packageJSON.library)) &&
90 areStaticDirectoriesValid(packageJSON.staticDirs) && 94 areStaticDirectoriesValid(packageJSON.staticDirs) &&
91 areCSSPathsValid(packageJSON.css) && 95 areCSSPathsValid(packageJSON.css) &&