From dfbf06274c0ba6c67caf6d144c2c4a2bf678009e Mon Sep 17 00:00:00 2001 From: Sebastian Serth Date: Thu, 24 Nov 2022 17:16:18 +0100 Subject: [PATCH] Specify class for html_escape --- app/controllers/execution_environments_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/execution_environments_controller.rb b/app/controllers/execution_environments_controller.rb index 9c4d3f87..e88701ee 100644 --- a/app/controllers/execution_environments_controller.rb +++ b/app/controllers/execution_environments_controller.rb @@ -152,7 +152,7 @@ class ExecutionEnvironmentsController < ApplicationController @docker_images ||= ExecutionEnvironment.pluck(:docker_image) @docker_images += Runner.strategy_class.available_images rescue Runner::Error => e - flash.now[:warning] = html_escape e.message + flash.now[:warning] = ERB::Util.html_escape e.message ensure @docker_images = @docker_images.sort.uniq end @@ -189,7 +189,7 @@ class ExecutionEnvironmentsController < ApplicationController Runner.strategy_class.sync_environment(@execution_environment) rescue Runner::Error => e Rails.logger.warn { "Runner error while synchronizing execution environment with id #{@execution_environment.id}: #{e.message}" } - redirect_to @execution_environment, alert: t('execution_environments.index.synchronize.failure', error: html_escape(e.message)) + redirect_to @execution_environment, alert: t('execution_environments.index.synchronize.failure', error: ERB::Util.html_escape(e.message)) else redirect_to @execution_environment, notice: t('execution_environments.index.synchronize.success') end