diff --git a/src/misc/aiscript/evaluator.ts b/src/misc/aiscript/evaluator.ts index c65fd26afb98..c5feae4504f7 100644 --- a/src/misc/aiscript/evaluator.ts +++ b/src/misc/aiscript/evaluator.ts @@ -30,7 +30,7 @@ export class ASEvaluator { this.envVars = { AI: 'kawaii', VERSION: version, - URL: opts.page ? `${opts.url}/@${opts.page.user.username}/pages/${opts.page.name}` : '', + URL: opts.page ? `${opts.url}/@${opts.page.user.username}/pages/${encodeURIComponent(opts.page.name)}` : '', LOGIN: opts.visitor != null, NAME: opts.visitor ? opts.visitor.name || opts.visitor.username : '', USERNAME: opts.visitor ? opts.visitor.username : '',