<commit_before><!DOCTYPE html>

<html>

    <head>
    </head>

    <body>

        <?php

        require_once("../article.php");

        //first we perform checks and get the values from POST

        $day = $_POST['day'];
        $month = $_POST['month'];
        $year = $_POST['year'];

        //put items straight into an array b/c it is easier to unpack

        if (checkdate($month, $day, $year)) {
            //date okay so we can put them in array
            $date = strtotime("$day-$month-$year");
            $variables = array('title' => htmlspecialchars($_POST['title']),
                               'author' => htmlspecialchars($_POST['author']),
                               'content' => htmlspecialchars($_POST['content']),
                               'islive' => htmlspecialchars($_POST['islive']),
                               'date' => $date);
            
            $article = new Article('news');
            $article->unpackArray($variables);
            $article->nicePrinter();
            //we're gonna change page so store article
            session_start();
            $_SESSION['article'] = $article;

        } else {
            //send them back to the editor with a message - send via SESSION
            session_start();
            $_SESSION = $_POST;
            header("Location: editor.php");
        }
        
        ?>
        
        <br>

        <form action = 'submit.php'>
            <input type = 'submit' value = 'Submit to Database' />
        </form>

        <form action = 'editor.php'>
            <input type = 'submit' value = 'Back to Editor' />
        </form><commit_msg>Added defaults<commit_after><!DOCTYPE html>

<html>

    <head>
    </head>

    <body>

        <?php

        require_once("../article.php");

        //first we perform checks and get the values from POST

        $day = $_POST['day'];
        $month = $_POST['month'];
        $year = $_POST['year'];

        //put items straight into an array b/c it is easier to unpack

        if (checkdate($month, $day, $year)) {
            //date okay so we can put them in array
            $date = strtotime("$day-$month-$year");
            $variables = array('title' => htmlspecialchars($_POST['title']),
                               'author' => htmlspecialchars($_POST['author']),
                               'content' => htmlspecialchars($_POST['content']),
                               'islive' => htmlspecialchars($_POST['islive']),
                               'date' => $date);
            
            $article = new Article($tab='news');
            $article->unpackArray($variables);
            $article->nicePrinter();
            //we're gonna change page so store article
            session_start();
            $_SESSION['article'] = $article;

        } else {
            //send them back to the editor with a message - send via SESSION
            session_start();
            $_SESSION = $_POST;
            header("Location: editor.php");
        }
        
        ?>
        
        <br>

        <form action = 'submit.php'>
            <input type = 'submit' value = 'Submit to Database' />
        </form>

        <form action = 'editor.php'>
            <input type = 'submit' value = 'Back to Editor' />
        </form>
{'fraction_non_alphanumeric': 0.14035087719298245, 'fraction_numerical': 0.0, 'mean_word_length': 1.5053030303030304, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 43, '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': '5786659', 'n_tokens_mistral': 869, 'n_tokens_neox': 836, 'n_words': 238}