<commit_before><?php
require("../res/config.php");
$url = $db->real_escape_string($_POST["url"]);
$name = $db->real_escape_string($_POST["name"]);
$content = $db->real_escape_string($_POST["content"]);
$op = 0;

$re = "/^^(>[a-zA-Z0-9_ \~\!\@\#\$\%\^\&\*\(\)\+\-\=\`\{\}\|\[\]\\\:\"\;\'\?\,\.\/]*$)/mi";
$re2 = "/(<.*(.*)>)(.*)(<\\/.*>)$/mi";
$re1 = "/(<a href=\"(.*)\">(.*)(.*))*$/mi";
$re3 = "/^(>>(\\d+))*/mi";
$subst = "<p class=\"quote\">$1</p>";
$subst2 = "$3";
$subst1 = "$1";

if ($_FILES["image"]["name"] != "" or $_POST["content"] != "" and strlen($_POST["content"]) <= 2000) {
  if($_POST['type'] == "thread") {
    $db->real_query("SELECT id FROM posts_".$url." ORDER BY id DESC LIMIT 1");
    $res = $db->use_result();
    while ($row = $res->fetch_assoc()) {
      $id = $row['id'];
    }
    $id++;
    $id = $db->real_escape_string($id);

    $db->query("INSERT INTO posts_".$url." (name, content, op, timestamp)
    VALUES ('$name', '$content', '$id', now())");<commit_msg>comments<commit_after><?php
require("../res/config.php");
$url = $db->real_escape_string($_POST["url"]);
$name = $db->real_escape_string($_POST["name"]);
$content = $db->real_escape_string($_POST["content"]);
$op = 0;

// Regex patterns to allow post filtering, greentext, and post linking.
$re = "/^^(>[a-zA-Z0-9_ \~\!\@\#\$\%\^\&\*\(\)\+\-\=\`\{\}\|\[\]\\\:\"\;\'\?\,\.\/]*$)/mi";
$re2 = "/(<.*(.*)>)(.*)(<\\/.*>)$/mi";
$re1 = "/(<a href=\"(.*)\">(.*)(.*))*$/mi";
$re3 = "/^(>>(\\d+))*/mi";
$subst = "<p class=\"quote\">$1</p>";
$subst2 = "$3";
$subst1 = "$1";

if ($_FILES["image"]["name"] != "" or $_POST["content"] != "" and strlen($_POST["content"]) <= 2000) {
  if($_POST['type'] == "thread") {
    $db->real_query("SELECT id FROM posts_".$url." ORDER BY id DESC LIMIT 1");
    $res = $db->use_result();
    while ($row = $res->fetch_assoc()) {
      $id = $row['id'];
    }
    $id++;
    $id = $db->real_escape_string($id);

    $db->query("INSERT INTO posts_".$url." (name, content, op, timestamp)
    VALUES ('$name', '$content', '$id', now())");
{'fraction_non_alphanumeric': 0.36785539814362483, 'fraction_numerical': 0.015632633121641426, 'mean_word_length': 3.6439909297052155, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 35, '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': '4353241', 'n_tokens_mistral': 871, 'n_tokens_neox': 836, 'n_words': 145}