X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fhelpers%2Fcustom-validators%2Fplugins.ts;h=63af91a44a7ec5dcef814fb7ef1da4d68c842234;hb=8d5e65349deebd499c0be10fe02d535a77d58ddb;hp=b5e32abc26839c70eba277499b7488409ddd3bb1;hpb=d75db01f14138ea660c4c519e37ab05228b39d13;p=github%2FChocobozzz%2FPeerTube.git 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) { } function isPluginHomepage (value: string) { - return isUrlValid(value) + return exists(value) && (!value || isUrlValid(value)) +} + +function isPluginBugs (value: string) { + return exists(value) && (!value || isUrlValid(value)) } function areStaticDirectoriesValid (staticDirs: any) { @@ -85,7 +89,7 @@ function isPackageJSONValid (packageJSON: PluginPackageJson, pluginType: PluginT isPluginEngineValid(packageJSON.engine) && isPluginHomepage(packageJSON.homepage) && exists(packageJSON.author) && - isUrlValid(packageJSON.bugs) && + isPluginBugs(packageJSON.bugs) && (pluginType === PluginType.THEME || isSafePath(packageJSON.library)) && areStaticDirectoriesValid(packageJSON.staticDirs) && areCSSPathsValid(packageJSON.css) &&