Skip to content
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

better bug fix #2698

Merged
merged 1 commit into from Sep 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions library/clinical_rules.php
Expand Up @@ -2117,6 +2117,8 @@ function exist_lifestyle_item($patient_id, $lifestyle, $status, $dateTarget)
$dateTarget = ($dateTarget) ? $dateTarget : date('Y-m-d H:i:s');

// Collect pertinent history data
// If illegal value in $lifestyle, then will die and report error (to prevent security vulnerabilities)
escape_sql_column_name($lifestyle, ['history_data']);
$history = getHistoryData($patient_id, $lifestyle, '', $dateTarget);

// See if match
Expand Down
3 changes: 3 additions & 0 deletions library/patient.inc
Expand Up @@ -425,6 +425,9 @@ function getEthnoRacials()
return $returnval;
}

// To prevent sql injection on this function, if a variable is used for $given parameter, then
// it needs to be escaped via whitelisting prior to using this function; see lines 2020-2121 of
// library/clinical_rules.php script for example of this.
function getHistoryData($pid, $given = "*", $dateStart = '', $dateEnd = '')
{

Expand Down