<commit_before><?php header("Content-type: image/svg+xml"); ?>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>

<?php

/* this just feels wrong */
$rgb = explode(',',$_GET['rgb']);
$r = $rgb[0];
if ($r<60) { $foamRgb = "159,129,112"; }
elseif ($r<190) { $foamRgb = "255,250,205"; }
else { $foamRgb = "255,255,255"; }

?>

<svg xmlns="http://www.w3.org/2000/svg" version="1.1" x="0px" y="0px" viewBox="0 0 256 256" style="enable-background:new 0 0 256 256;" xml:space="preserve">
<style type="text/css"><![CDATA[
  #container { fill: #ffffff;
           opacity: 0.3;
  }
  #outline { fill: none;
           stroke: #ffffff;
           stroke-opacity: 0.8;
           stroke-width: 3;
  }
  #liquid { fill: rgb(<?php echo $_GET['rgb'] ?>);
            <?php if(isset($_GET['empty'])) { echo "opacity: 0.0;"; }?>
            stroke: #ffffff;
            stroke-opacity: 1;
            stroke-width: 2;
  }
  #foam { fill: rgb(<?php echo $foamRgb; ?>);
          opacity: <?php echo isset($_GET['empty']) ? "0.0" : "1";  ?>;
  }
]]></style>
<?php readfile("svg_paths/".$_GET['container'].".paths"); ?>
</svg><commit_msg>Input sanitization in svg generator<commit_after><?php header("Content-type: image/svg+xml"); ?>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>

<?php

/* this just feels wrong */
$rgb = explode(',',$_GET['rgb']);
$r = $rgb[0];
if ($r<60) { $foamRgb = "159,129,112"; }
elseif ($r<190) { $foamRgb = "255,250,205"; }
else { $foamRgb = "255,255,255"; }

$fn = preg_replace('/\W+/','',$_GET['container']);
?>

<svg xmlns="http://www.w3.org/2000/svg" version="1.1" x="0px" y="0px" viewBox="0 0 256 256" style="enable-background:new 0 0 256 256;" xml:space="preserve">
<style type="text/css"><![CDATA[
  #container { fill: #ffffff;
           opacity: 0.3;
  }
  #outline { fill: none;
           stroke: #ffffff;
           stroke-opacity: 0.8;
           stroke-width: 3;
  }
  #liquid { fill: rgb(<?php echo $_GET['rgb'] ?>);
            <?php if(isset($_GET['empty'])) { echo "opacity: 0.0;"; }?>
            stroke: #ffffff;
            stroke-opacity: 1;
            stroke-width: 2;
  }
  #foam { fill: rgb(<?php echo $foamRgb; ?>);
          opacity: <?php echo isset($_GET['empty']) ? "0.0" : "1";  ?>;
  }
]]></style>
<?php readfile("svg_paths/$fn.paths"); ?>
</svg>
{'fraction_non_alphanumeric': 0.24152910512597742, 'fraction_numerical': 0.0634231103388358, 'mean_word_length': 3.17967332123412, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 2, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 8}, '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': '6051582', 'n_tokens_mistral': 974, 'n_tokens_neox': 863, 'n_words': 183}