feat: re
This commit is contained in:
1 parent
091c012427
commit
bce27c50bb
1 file changed
+4
-4
@@ -242,14 +242,14 @@ export class PluginLoader {
|
|||||||
* @returns 拒绝原因;通过校验返回 null
|
* @returns 拒绝原因;通过校验返回 null
|
||||||
*/
|
*/
|
||||||
private getRejectReason (pluginId: string, pluginDir: string): string | null {
|
private getRejectReason (pluginId: string, pluginDir: string): string | null {
|
||||||
if (!this.isOfficialPlugin(pluginId)) {
|
|
||||||
return 'non-official plugin (not in whitelist)';
|
|
||||||
}
|
|
||||||
const hit = this.scanSensitiveWords(pluginDir);
|
const hit = this.scanSensitiveWords(pluginDir);
|
||||||
|
if (this.isOfficialPlugin(pluginId)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
if (hit) {
|
if (hit) {
|
||||||
return `sensitive keyword "${hit}"`;
|
return `sensitive keyword "${hit}"`;
|
||||||
}
|
}
|
||||||
return null;
|
return "not in official plugin whitelist";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in new issue
Block a user