<commit_before><?php
    define('MAIN', true);

    require_once "includes".DIRECTORY_SEPARATOR."common.php";

    # Prepare the controller.
    $main = MainController::current();

    # Parse the route.
    $route = Route::current($main);

    # Check if the user can view the site.
    if (!$visitor->group->can("view_site") and !in_array($route->action, array("login",
                                                                               "logout",
                                                                               "register",
                                                                               "activate",
                                                                               "lost_password",
                                                                               "reset"))) {
        if ($trigger->exists("can_not_view_site"))
            $trigger->call("can_not_view_site");
        else {
            if (logged_in())
                show_403(__("Access Denied"), __("You are not allowed to view this site.")); # Banned user.

            $_SESSION['redirect_to'] = self_url();
            Flash::notice(__("You must be logged in to view this site."), "login");
        }
    }

    # Execute the appropriate Controller responder.
    $route->init();

    # If the route failed or nothing was displayed, check for pages provided by the theme.
    if (!$route->success and !$main->displayed)
        if ($theme->file_exists("pages".DIR.$route->action))
            $main->display("pages".DIR.$route->action);
        else
            show_404();

    $trigger->call("end", $route);

    ob_end_flush();<commit_msg>Main Index: removed fallback search for named template<commit_after><?php
    define('MAIN', true);

    require_once "includes".DIRECTORY_SEPARATOR."common.php";

    # Prepare the controller.
    $main = MainController::current();

    # Parse the route.
    $route = Route::current($main);

    # Check if the user can view the site.
    if (!$visitor->group->can("view_site") and !in_array($route->action, array("login",
                                                                               "logout",
                                                                               "register",
                                                                               "activate",
                                                                               "lost_password",
                                                                               "reset"))) {
        if ($trigger->exists("can_not_view_site"))
            $trigger->call("can_not_view_site");
        else {
            if (logged_in())
                show_403(__("Access Denied"), __("You are not allowed to view this site.")); # Banned user.

            $_SESSION['redirect_to'] = self_url();
            Flash::notice(__("You must be logged in to view this site."), "login"); # Invitation to log in.
        }
    }

    # Execute the appropriate Controller responder.
    $route->init();

    # If the route failed or nothing was displayed, show a 404 page.
    if (!$route->success and !$main->displayed)
        show_404();

    $trigger->call("end", $route);

    ob_end_flush();
{'fraction_non_alphanumeric': 0.11819021237303785, 'fraction_numerical': 0.0046168051708217915, 'mean_word_length': 1.2839072382290935, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 30, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2693515', 'n_tokens_mistral': 743, 'n_tokens_neox': 715, 'n_words': 195}