<commit_before><?php
$userAgent = $_SERVER['HTTP_USER_AGENT'];
$userAddr = $_SERVER['REMOTE_ADDR'];
$userPort = $_SERVER['REMOTE_PORT'];
$referer = $_SERVER['HTTP_REFERER'];
$file = $_GET['f'];
$mime = $_GET['m'];
if (empty($file) || empty($mime)) {
  die('Bad request');
} else {
  $path = realpath(__DIR__)."/".$file;
  $root = realpath(__DIR__)."/";
  if (strpos($path,$root)!=0 || !file_exists($path)) {
    die('Not found');
  } else {
    $time = time();
    $info = array(
      'remotePort'=>$userPort,
      'remoteAddr'=>$userAddr,
      'referer'=>$referer,
      'userAgent'=>$userAgent,
      'path'=>$_SERVER['REQUEST_URI']
    );
    $jo = array(
      'time'=>$time,
      'event'=>'php.send',
      'component'=>'php',<commit_msg>extra urldecode of filename to cope with embedded :s<commit_after><?php
$userAgent = $_SERVER['HTTP_USER_AGENT'];
$userAddr = $_SERVER['REMOTE_ADDR'];
$userPort = $_SERVER['REMOTE_PORT'];
$referer = $_SERVER['HTTP_REFERER'];
// extra decode for embedded :, etc.
$file = urldecode($_GET['f']);
$mime = $_GET['m'];
if (empty($file) || empty($mime)) {
  die('Bad request');
} else {
  $path = realpath(__DIR__)."/".$file;
  $root = realpath(__DIR__)."/";
  if (strpos($path,$root)!=0 || !file_exists($path)) {
    die('Not found: '.$file);
  } else {
    $time = time();
    $info = array(
      'remotePort'=>$userPort,
      'remoteAddr'=>$userAddr,
      'referer'=>$referer,
      'userAgent'=>$userAgent,
      'path'=>$_SERVER['REQUEST_URI']
    );
    $jo = array(
      'time'=>$time,
      'event'=>'php.send',
      'component'=>'php',
{'fraction_non_alphanumeric': 0.23473882945248584, 'fraction_numerical': 0.0012586532410320957, 'mean_word_length': 4.079872204472843, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 19, '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': '2942703', 'n_tokens_mistral': 585, 'n_tokens_neox': 582, 'n_words': 99}