<commit_before># Filters added to this controller will be run for all controllers in the application.
# Likewise, all the methods added will be available for all controllers.
class CMSController < ActionController::Base
  extend ActiveSupport::Memoizable
  #include ExceptionNotifiable
  include RoleRequirementSystem

  protect_from_forgery # See ActionController::RequestForgeryProtection for details
  filter_parameter_logging :password, :password_confirmation

  helper :cms_engine, :all
  
  before_filter :set_charset

  #Check to make sure we are in production mode
  unless ActionController::Base.consider_all_requests_local
    #Ensure that any extra functionality we have built in is caught by the 404, making sure the user never sees an ugly 404
    rescue_from ActiveRecord::RecordNotFound, ActionController::RoutingError, ActionController::UnknownController, ActionController::UnknownAction, :with => :render_not_found
    rescue_from RuntimeError, ArgumentError, Exception, :with => :render_internal_error
  end
  
  def render_not_found
    render :template => 'public/404', :status => :not_found
  end
  
  def render_internal_error(exception)
    log_error(exception)
    begin
      notify_hoptoad(exception)
    end
    render :template => 'public/500', :status => :internal_server_error
  end

  def set_charset
    headers["Content-Type"] = "text/html; charset=UTF-8" 
  end

 
  
  protected
  
    def logged_in?
      !!current_user
    end
    
    def current_user_session
      return @current_user_session if defined?(@current_user_session)
      @current_user_session = UserSession.find
    end<commit_msg>changed cms-controller<commit_after># Filters added to this controller will be run for all controllers in the application.
# Likewise, all the methods added will be available for all controllers.
class CMSController < ActionController::Base
  extend ActiveSupport::Memoizable
  #include ExceptionNotifiable
  include RoleRequirementSystem

  protect_from_forgery # See ActionController::RequestForgeryProtection for details
  filter_parameter_logging :password, :password_confirmation

  helper :cms_engine, :all
  
  before_filter :set_charset

  #Check to make sure we are in production mode
  if ActionController::Base.consider_all_requests_local
    #Ensure that any extra functionality we have built in is caught by the 404, making sure the user never sees an ugly 404
    rescue_from ActiveRecord::RecordNotFound, ActionController::RoutingError, ActionController::UnknownController, ActionController::UnknownAction, :with => :render_not_found
    rescue_from RuntimeError, ArgumentError, Exception, :with => :render_internal_error
  end
  
  def render_not_found
    render :template => 'public/404', :status => :not_found
  end
  
  def render_internal_error(exception)
    log_error(exception)
    render :template => 'public/500', :status => :internal_server_error
  end

  def set_charset
    headers["Content-Type"] = "text/html; charset=UTF-8" 
  end

 
  
  protected
  
    def logged_in?
      !!current_user
    end
    
    def current_user_session
      return @current_user_session if defined?(@current_user_session)
      @current_user_session = UserSession.find
    end
{'fraction_non_alphanumeric': 0.0641860465116279, 'fraction_numerical': 0.00806201550387597, 'mean_word_length': 4.63986013986014, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, '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': '105740', 'n_tokens_mistral': 910, 'n_tokens_neox': 864, 'n_words': 269}