🎉 Hello world
This commit is contained in:
20
choix.php
Normal file
20
choix.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
if (empty($_GET['element']) || empty($_GET['hash'])) {
|
||||
die('non');
|
||||
}
|
||||
|
||||
$element_type = $_GET['element'];
|
||||
$hash = strtolower($_GET['hash']);
|
||||
|
||||
$file = hexdec($hash[0]);
|
||||
$color = substr($hash, 1);
|
||||
|
||||
$element = sprintf('elements/%s/%s.svg', $element_type, $file);
|
||||
while (!file_exists($element)) {
|
||||
$file--;
|
||||
$element = sprintf('elements/%s/%s.svg', $element_type, $file);
|
||||
}
|
||||
|
||||
$svg = file_get_contents($element);
|
||||
$svg = str_replace('class="colored"', 'fill="#'.$color.'"', $svg);
|
||||
echo $svg;
|
Reference in New Issue
Block a user