Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/UserEditor.php
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,8 @@ function StyleSheetOptions($currentStyle)
ksort($type);
reset($type);
while ($current_type = current($type)) {
$id = key($type);
// Sanitize the array key to prevent SQL injection
$id = InputUtils::filterInt(key($type));
Comment on lines +273 to +274
Copy link

Copilot AI Nov 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While InputUtils::filterInt() correctly sanitizes the array key to prevent SQL injection, this fix is incomplete. The sanitized $id variable is subsequently used in raw SQL queries (lines 296-297, 306-307, 340-342) via RunQuery(), which violates ChurchCRM's coding standard requiring Propel ORM for all database operations.

The entire settings save block should be refactored to use UserConfigQuery instead of raw SQL. This would eliminate SQL injection risks entirely through parameterized queries and improve code maintainability.

Copilot generated this review using guidance from repository custom instructions.
// Filter Input
if ($current_type === 'text' || $current_type === 'textarea') {
$value = InputUtils::legacyFilterInput($new_value[$id]);
Expand Down
Loading