<commit_before>class Select2AutocompletesController < ApplicationController
  def search
    begin
      if params[:class_name].present?
        adapter = "::#{params[:class_name].camelize}SearchAdapter".constantize
      elsif params[:default_class_name].present?
        adapter = ::AutoSelect2::Select2SearchAdapter::Default
      else
        render json: {error: "not enough search parameters'"}.to_json,
               status: 500
        return
      end
    rescue NameError<commit_msg>security fix<commit_after>class Select2AutocompletesController < ApplicationController
  def search
    begin
      if params[:class_name].present?
        adapter = "::#{params[:class_name].camelize}SearchAdapter".constantize
      else
        render json: {error: "not enough search parameters'"}.to_json,
               status: 500
        return
      end
    rescue NameError
{'fraction_non_alphanumeric': 0.08685714285714285, 'fraction_numerical': 0.011428571428571429, 'mean_word_length': 3.0934579439252334, 'pattern_counts': {'":': 2, '<': 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': '3308692', 'n_tokens_mistral': 231, 'n_tokens_neox': 228, 'n_words': 52}