<commit_before><?php
include(__DIR__ . '/init.php');

if (!$auth) {
  http_response_code(403);
  $error = 'Access denied. Please <a title="login" href="login.php?url='.rawurlencode($site_url.'clipboard.php').'">login</a>.';
  include($include_dir.'error.php');
  exit;
}

$post = true;
$clipboard = (file_exists($clipboard_file) ? file_get_contents($clipboard_file) : '');

if (isset($_POST['d'])) {
  $clipboard = $_POST['d'];
  file_put_contents($clipboard_file, $clipboard);
  chmod($clipboard_file, 0600);
  if (isset($_GET['r']) && $_GET['r'] == 'bookmarklet') {
    header('Location: '.$site_url.'frame.php?clip=true&close=true'.(isset($_GET['url']) ? '&url='.rawurlencode(rawurldecode($_GET['url'])) : ''));
    exit;
  }
}

include($include_dir . 'head.php');
?>
<form id="post" method="POST" action="clipboard.php" enctype="multipart/form-data">
<div id="main">
<div class="content">
<textarea id="post-d" name="d" onblur="autoSave(this.value);" onpaste="pasteImage(event);"><?php echo htmlentities($clipboard); ?></textarea>
</div>
</div>
<!--end of main-->

<?php
include($include_dir . 'sidebar.php');
?>
</form>
<?php
include($include_dir . 'foot.php');
?><commit_msg>Clipboard accept GET method to append contents<commit_after><?php
include(__DIR__ . '/init.php');

if (!$auth) {
  http_response_code(403);
  $error = 'Access denied. Please <a title="login" href="login.php?url='.rawurlencode($site_url.'clipboard.php').'">login</a>.';
  include($include_dir.'error.php');
  exit;
}

$post = true;
$clipboard = (file_exists($clipboard_file) ? file_get_contents($clipboard_file) : '');

if (isset($_GET['c']) && $_GET['c']) {
  $clipboard .= "\n\n".urldecode($_GET['c']);
  file_put_contents($clipboard_file, $clipboard);
  chmod($clipboard_file, 0600);
  header('Location: clipboard.php');
  exit;
} elseif (isset($_POST['d']) && $_POST['d']) {
  $clipboard = $_POST['d'];
  file_put_contents($clipboard_file, $clipboard);
  chmod($clipboard_file, 0600);
  if (isset($_GET['r']) && $_GET['r'] == 'bookmarklet') {
    header('Location: '.$site_url.'frame.php?clip=true&close=true'.(isset($_GET['url']) ? '&url='.rawurlencode(rawurldecode($_GET['url'])) : ''));
    exit;
  }
}

include($include_dir . 'head.php');
?>
<form id="post" method="POST" action="clipboard.php" enctype="multipart/form-data">
<div id="main">
<div class="content">
<textarea id="post-d" name="d" onblur="autoSave(this.value);" onpaste="pasteImage(event);"><?php echo htmlentities($clipboard); ?></textarea>
</div>
</div>
<!--end of main-->

<?php
include($include_dir . 'sidebar.php');
?>
</form>
<?php
include($include_dir . 'foot.php');
?>
{'fraction_non_alphanumeric': 0.2420091324200913, 'fraction_numerical': 0.00684931506849315, 'mean_word_length': 6.343575418994414, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 33, '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': '5579623', 'n_tokens_mistral': 979, 'n_tokens_neox': 964, 'n_words': 153}