<commit_before># frozen_string_literal: true

class ApplicationController < ActionController::Base
  include TenantSite
  include Localizable

  protect_from_forgery with: :exception

  helper_method :cfp_only?

  layout :layout_by_resource

  def default_url_options(options = {})
    { lang: current_locale }.merge(options)
  end

  def cfp_only?
    current_site.cfp_only_mode == 'true'
  end

  def render_404
    render file: 'public/404.html', status: :not_found, layout: false
  end

  private
<commit_msg>Prepend CSRF protected callback<commit_after># frozen_string_literal: true

class ApplicationController < ActionController::Base
  include TenantSite
  include Localizable

  protect_from_forgery prepend: true, with: :exception

  helper_method :cfp_only?

  layout :layout_by_resource

  def default_url_options(options = {})
    { lang: current_locale }.merge(options)
  end

  def cfp_only?
    current_site.cfp_only_mode == 'true'
  end

  def render_404
    render file: 'public/404.html', status: :not_found, layout: false
  end

  private

{'fraction_non_alphanumeric': 0.07743153918791312, 'fraction_numerical': 0.0113314447592068, 'mean_word_length': 4.578947368421052, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1775699', 'n_tokens_mistral': 354, 'n_tokens_neox': 333, 'n_words': 83}