diff --git a/index.php b/index.php index b27cd7a..ee68ef1 100755 --- a/index.php +++ b/index.php @@ -41,33 +41,50 @@ if ( if (strlen($_POST['txt']) >= 1 AND strlen($_POST['txt']) <= 4096) $params['txt'] = $_POST['txt']; else + { + http_response_code(400); exit("Wrong value for txt"); + } if ($_POST['redondancy'] === "L" OR $_POST['redondancy'] === "M" OR $_POST['redondancy'] === "Q" OR $_POST['redondancy'] === "H") $params['redondancy'] = $_POST['redondancy']; else + { + http_response_code(400); exit("Wrong value for redondancy"); + } if (is_numeric($_POST['margin']) AND $_POST['margin'] >= 0 AND $_POST['margin'] <= 128) $params['margin'] = $_POST['margin']; else + { + http_response_code(400); exit("Wrong value for margin"); + } if (is_numeric($_POST['size']) AND $_POST['size'] >= 1 AND $_POST['size'] <= 128) $params['size'] = $_POST['size']; else + { + http_response_code(400); exit("Wrong value for size"); + } if (preg_match("/^#[abcdefABCDEF0-9]{6}$/", $_POST['bgColor'])) $params['bgColor'] = $_POST['bgColor']; else + { + http_response_code(400); exit("Wrong value for bgColor"); + } if (preg_match("/^#[abcdefABCDEF0-9]{6}$/", $_POST['mainColor'])) $params['mainColor'] = $_POST['mainColor']; else + { + http_response_code(400); exit("Wrong value for mainColor"); - + } } ?>