Fix url/redirect and locale handling for js blockbypass

indiachan-spamvector
Thomas Lynch 1 year ago
parent 0a5b74ea31
commit 0a637c5cb8
  1. 6
      lib/middleware/captcha/blockbypass.js
  2. 2
      views/includes/head.pug

@ -12,7 +12,7 @@ module.exports = {
check: async (req, res, next) => {
const { __ } = res.locals;
const { __, locale } = res.locals;
const { secureCookies, blockBypass } = config.get;
//bypass captcha permission
@ -28,7 +28,7 @@ module.exports = {
return dynamicResponse(req, res, 403, 'message', {
'title': __('Forbidden'),
'message': __('Please complete a block bypass to continue'),
'frame': '/bypass_minimal.html',
'frame': `/bypass_minimal.html?language=${encodeURIComponent(locale)}`,
'link': {
'href': '/bypass.html',
'text': __('Get block bypass'),
@ -72,7 +72,7 @@ module.exports = {
return dynamicResponse(req, res, 403, 'message', {
'title': __('Forbidden'),
'message': __('Block bypass expired or exceeded max uses'),
'frame': '/bypass_minimal.html',
'frame': `/bypass_minimal.html?language=${encodeURIComponent(locale)}`,
'link': {
'href': '/bypass.html',
'text': __('Get block bypass'),

@ -33,7 +33,7 @@ if isBoard && board.settings.customCss
include ../../gulp/res/icons/html_code.html
//- language pack
- const languageScript = isBoard ? board.settings.language : globalLanguage;
- const languageScript = isBoard ? board.settings.language : (locale || globalLanguage);
script(src=`/js/lang/${languageScript}.js?v=${commit}`)
//- main script

Loading…
Cancel
Save