<commit_before><?php

/**
 * @package boot
 */

/**
 * Redirects the browser to a specified location. Safer than using a
 * direct header() call
 *
 *  @param string $url
 */
function redirect ($url)
{
    // Just make sure.
    $url = str_replace('Location:', null, $url);

    if (headers_sent($filename, $line)) {
        echo "<h1>Error: Cannot redirect to <a href=\"$url\">$url</a></h1><p>Output has already started in $filename on line $line</p>";
        exit;
    }

    // convert idn back to ascii for redirect

    if (function_exists('idn_to_ascii')) {
        $root = parse_url(URL);
        $host = $root['host'];
        $url  = str_replace($host, idn_to_ascii($host), $url);
    }

    header('Status: 302 Found');
    header('Expires: Mon, 12 Dec 1982 06:00:00 GMT');<commit_msg>Cleanup session cookies when redirecting<commit_after><?php

/**
 * @package boot
 */

/**
 * Redirects the browser to a specified location. Safer than using a
 * direct header() call
 *
 *  @param string $url
 */
function redirect ($url)
{
    // Just make sure.
    $url = str_replace('Location:', null, $url);

    if (headers_sent($filename, $line)) {
        echo "<h1>Error: Cannot redirect to <a href=\"$url\">$url</a></h1><p>Output has already started in $filename on line $line</p>";
        exit;
    }

    // convert idn back to ascii for redirect

    if (function_exists('idn_to_ascii')) {
        $root = parse_url(URL);
        $host = $root['host'];
        $url  = str_replace($host, idn_to_ascii($host), $url);
    }

    cleanup_session_cookies();
    header('Status: 302 Found');
    header('Expires: Mon, 12 Dec 1982 06:00:00 GMT');
{'fraction_non_alphanumeric': 0.1618181818181818, 'fraction_numerical': 0.020606060606060607, 'mean_word_length': 3.0072815533980584, 'pattern_counts': {'":': 0, '<': 17, '<?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': '3814922', 'n_tokens_mistral': 574, 'n_tokens_neox': 533, 'n_words': 158}