mirror of
https://github.com/itflow-org/itflow
synced 2026-07-23 08:50:42 +00:00
Replace Function sanitizeInput() with just escapeSql() and update all instances throughout
This commit is contained in:
@@ -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()';
|
||||
|
||||
@@ -11,7 +11,7 @@ function lookupUserPermission($module) {
|
||||
return 3;
|
||||
}
|
||||
|
||||
$module = sanitizeInput($module);
|
||||
$module = escapeSql($module);
|
||||
|
||||
$sql = mysqli_query(
|
||||
$mysqli,
|
||||
|
||||
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user