ShowHiddenThings: fix discovery keyword filter bypass

This commit is contained in:
Vendicated 2024-09-20 02:03:42 +02:00
parent 755e869db7
commit f7587d9b2e
No known key found for this signature in database
GPG key ID: D66986BAF75ECF18

View file

@ -112,12 +112,12 @@ export default definePlugin({
}, },
// patch request that queries if term is allowed // patch request that queries if term is allowed
{ {
find: ".GUILD_DISCOVERY_VALID_TERM", find: ".GUILD_DISCOVERY_VALID_TERM,query:",
predicate: () => settings.store.disableDisallowedDiscoveryFilters, predicate: () => settings.store.disableDisallowedDiscoveryFilters,
all: true, all: true,
replacement: { replacement: {
match: /\i\.\i\.get\(\{url:\i\.\i\.GUILD_DISCOVERY_VALID_TERM,query:\{term:\i\},oldFormErrors:!0\}\);/g, match: /\i\.\i\.get\(\{url:\i\.\i\.GUILD_DISCOVERY_VALID_TERM,query:\{term:\i\},oldFormErrors:!0\}\)/g,
replace: "Promise.resolve({ body: { valid: true } });" replace: "Promise.resolve({ body: { valid: true } })"
} }
} }
], ],