Fix bind_param type mismatches and integer validation
- TemplateModel.php: fix bind_param "ssssiii" -> "sssssii" (5 strings not 4) - manage_workflows.php: fix bind_param 'ssiiii' -> 'ssiiiii' (4 int columns) - download_attachment.php, delete_attachment.php, get_template.php: replace is_numeric() with strict int cast+equality check to reject floats and scientific notation - manage_recurring.php: validate JSON input before accessing schedule_type key Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -70,6 +70,10 @@ try {
|
||||
echo json_encode($result);
|
||||
} else {
|
||||
$data = json_decode(file_get_contents('php://input'), true);
|
||||
if (!is_array($data) || empty($data['schedule_type']) || empty($data['title_template'])) {
|
||||
echo json_encode(['success' => false, 'error' => 'schedule_type and title_template are required']);
|
||||
exit;
|
||||
}
|
||||
|
||||
// Calculate next run time
|
||||
$nextRun = calculateNextRun(
|
||||
@@ -94,6 +98,10 @@ try {
|
||||
}
|
||||
|
||||
$data = json_decode(file_get_contents('php://input'), true);
|
||||
if (!is_array($data) || empty($data['schedule_type'])) {
|
||||
echo json_encode(['success' => false, 'error' => 'Invalid request data']);
|
||||
exit;
|
||||
}
|
||||
|
||||
// Recalculate next run time if schedule changed
|
||||
$nextRun = calculateNextRun(
|
||||
|
||||
Reference in New Issue
Block a user