-
Notifications
You must be signed in to change notification settings - Fork 469
Cleanup post data in EventAttendance #6989
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good fix unsure if we should make sure it > 0 and not empty before we move forward
@@ -24,7 +25,8 @@ | |||
ORDER BY t1.per_LastName, t1.per_ID"; | |||
$sPageTitle = gettext('Event Attendees'); | |||
} elseif ($_POST['Choice'] == 'Nonattendees') { | |||
$aSQL = 'SELECT DISTINCT(person_id) FROM event_attend WHERE event_id = ' . $_POST['Event']; | |||
$iEventId = InputUtils::legacyFilterInput($_POST['Event'], 'int'); | |||
$aSQL = 'SELECT DISTINCT(person_id) FROM event_attend WHERE event_id = ' . $iEventId; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we change this to a prepared statement somehow? I dont want to add more manually crafted sql (security nightmare)
Either query this from the orm and it'll implicitly build the prepared statement or use prepared statements from mysqli/PDO
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let us fix one thing at a time... I'm ok with this but I pulled the cleanup for more locations
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like the issue said, we should also make sure the query is using a prepared statement
Description & Issue number it closes
Fixes #6988
Screenshots (if appropriate)
None.
How to test the changes?
Visual inspection.
Type of change
How Has This Been Tested?
Visual inspection and manual injected of extra data in URL.
Checklist: