Specify class for html_escape

This commit is contained in:
Sebastian Serth
2022-11-24 17:16:18 +01:00
parent 138b2cf17f
commit dfbf06274c

View File

@ -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