<commit_before><?php
define('__ROOT__', dirname(__FILE__));
define('__SRC__', __ROOT__.'/_src');
define('__POST__', __ROOT__.'/_post');
define('__MD__', __ROOT__.'/php-markdown');

require_once(__ROOT__.'/config.php');
require_once(__SRC__.'/page.php');
require_once(__SRC__.'/rss.php');

function is_rss($query)
{
    return count($query) === 1 && $query[0] === "rss.php";
}

function is_main($query)
{
    return count($query) === 0;
}

function is_category($query)
{
    return count($query) === 1;
}

function is_post($query)
{
    return count($query) === 2;
}

function route()
{
    $query = $_REQUEST['q'];
    $query = split('/', $query);
    $query = array_filter($query, function($v){ return !empty($v); });

    if(is_rss($query))
    {
        \rss\echoo();
    }
    else if(is_main($query))
    {
        \page\echo_main();
    }
    else if(is_category($query))
    {
        \page\echo_category($query[0]);
    }
    else if(is_post($query))
    {
        \page\echo_post($query[0], $query[1]);
    }
    else
    {<commit_msg>Safety check<commit_after><?php
define('__ROOT__', dirname(__FILE__));
define('__SRC__', __ROOT__.'/_src');
define('__POST__', __ROOT__.'/_post');
define('__MD__', __ROOT__.'/php-markdown');

require_once(__ROOT__.'/config.php');
require_once(__SRC__.'/page.php');
require_once(__SRC__.'/rss.php');

function is_rss($query)
{
    return count($query) === 1 && $query[0] === "rss.php";
}

function is_main($query)
{
    return count($query) === 0;
}

function is_category($query)
{
    return count($query) === 1;
}

function is_post($query)
{
    return count($query) === 2;
}

function is_not_safe($query)
{
    foreach($query as $s)
    {
        if(preg_match('/../', $s) || preg_match('/~/', $s))
        {
            return true;
        }
    }
    return false;
}

function route()
{
    $query = $_REQUEST['q'];
    $query = split('/', $query);
    $query = array_filter($query, function($v){ return !empty($v); });

    if(is_not_safe($query))
    {
        \page\echo_not_found($query);
        return;
    }

    if(is_rss($query))
    {
        \rss\echoo();
    }
    else if(is_main($query))
    {
        \page\echo_main();
    }
    else if(is_category($query))
    {
        \page\echo_category($query[0]);
    }
    else if(is_post($query))
    {
        \page\echo_post($query[0], $query[1]);
    }
    else
    {
{'fraction_non_alphanumeric': 0.2103491796381994, 'fraction_numerical': 0.006731173748422381, 'mean_word_length': 3.0511073253833048, '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': '6452368', 'n_tokens_mistral': 883, 'n_tokens_neox': 869, 'n_words': 135}