Refactor input validation

This commit is contained in:
Miguel Ribeiro
2024-02-10 14:17:19 +01:00
parent 048bf2d0aa
commit e075714d12
6 changed files with 24 additions and 36 deletions
+2 -8
View File
@@ -1,15 +1,9 @@
<?php
require_once '../../includes/connect_endpoint.php';
require_once '../../includes/inputvalidation.php';
session_start();
function validate($value) {
$value = trim($value);
$value = stripslashes($value);
$value = htmlspecialchars($value);
$value = htmlentities($value);
return $value;
}
function update_exchange_rate($db) {
$query = "SELECT api_key FROM fixer";
$result = $db->query($query);