Sanitize word input to prevent errors

This commit is contained in:
Skylar Ittner 2021-10-20 00:32:46 -06:00
parent 812d25c5d5
commit 9e81263f32

View File

@ -32,6 +32,8 @@ try {
if (!empty($_GET["words"])) { if (!empty($_GET["words"])) {
// convert words to coordinates // convert words to coordinates
$words = urldecode($_GET["words"]); $words = urldecode($_GET["words"]);
$words = trim(strtolower($words));
$words = preg_replace('/\s+/', ' ', $words);
$coords = FixPhrase::decode($words); $coords = FixPhrase::decode($words);
$output = [ $output = [