process short urls as php

fixes #1
This commit is contained in:
xfnw 2022-03-03 17:36:54 -05:00
parent ac3b26f9f5
commit 05a3b84fcb

View file

@ -292,12 +292,12 @@ if ($uploadOk == 0) {
$url = $_POST['shorten'];
$target_name = substr(md5($url), 1, $hl);
$target_file = $target_dir . $target_name . "." . "php";
$target_file = $target_dir . $target_name . ".php";
if (file_exists($target_file)) {
do {
$target_name = $randchars[array_rand($randchars)] . $target_name;
$target_file = $target_dir . $target_name;
$target_file = $target_dir . $target_name . ".php";
} while (file_exists($target_file));
}
@ -340,4 +340,3 @@ html, body {
</div>
</body>
</html>