Replace Function sanitizeInput() with just escapeSql() and update all instances throughout

This commit is contained in:
johnnyq
2026-07-14 17:17:50 -04:00
parent 7bc47a58fe
commit b57ddc0e5c
148 changed files with 1945 additions and 1945 deletions

View File

@@ -160,7 +160,7 @@ function getFieldById($table, $id, $field, $escape_method = 'sql') {
if (stripos($columns[$field]['type'], 'int') !== false) {
return (int)$value;
} else {
return sanitizeInput($value); // Escape for SQL using a custom function
return escapeSql($value); // Escape for SQL using a custom function
}
}
}
@@ -271,7 +271,7 @@ function addToMailQueue($data) {
// Check if 'email_queued_at' is set and not empty
if (isset($email['queued_at']) && !empty($email['queued_at'])) {
$queued_at = "'" . sanitizeInput($email['queued_at']) . "'";
$queued_at = "'" . escapeSql($email['queued_at']) . "'";
} else {
// Use the current date and time if 'email_queued_at' is not set or empty
$queued_at = 'CURRENT_TIMESTAMP()';

View File

@@ -11,7 +11,7 @@ function lookupUserPermission($module) {
return 3;
}
$module = sanitizeInput($module);
$module = escapeSql($module);
$sql = mysqli_query(
$mysqli,

View File

@@ -9,7 +9,7 @@ function escapeHtml($unsanitizedInput) {
return htmlspecialchars($unsanitizedInput ?? '', ENT_QUOTES, 'UTF-8');
}
function sanitizeInput($input) {
function escapeSql($input) {
global $mysqli;
if (!empty($input)) {