Skip to content

Commit

Permalink
some security fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
bradymiller committed Mar 7, 2015
1 parent 2afa8fc commit cd804e3
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion interface/reports/appointments_report.php
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ function refreshme() {
?>
</td>

<td class="detail">&nbsp;<?php echo $appointment['pc_hometext'] ?></td>
<td class="detail">&nbsp;<?php echo text($appointment['pc_hometext']) ?></td>

</tr>

Expand Down
4 changes: 2 additions & 2 deletions interface/reports/appt_encounter_report.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ function endDoctor(&$docrow) {
$query .= "e.pc_eventDate = '$form_from_date' ";
}
if ($form_facility !== '') {
$query .= "AND e.pc_facility = '$form_facility' ";
$query .= "AND e.pc_facility = '" . add_escape_custom($form_facility) . "' ";
}
// $query .= "AND ( e.pc_catid = 5 OR e.pc_catid = 9 OR e.pc_catid = 10 ) " .
$query .= "AND e.pc_pid != '' AND e.pc_apptstatus != '?' " .
Expand Down Expand Up @@ -134,7 +134,7 @@ function endDoctor(&$docrow) {
$query .= "fe.date >= '$form_from_date 00:00:00' AND fe.date <= '$form_from_date 23:59:59' ";
}
if ($form_facility !== '') {
$query .= "AND fe.facility_id = '$form_facility' ";
$query .= "AND fe.facility_id = '" . add_escape_custom($form_facility) . "' ";
}
$query .= ") ORDER BY docname, IFNULL(pc_eventDate, encdate), pc_startTime";

Expand Down
4 changes: 2 additions & 2 deletions interface/usergroup/facility_admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ function displayAlert()
<input type=hidden name=mode value="facility">
<input type=hidden name=newmode value="admin_facility"> <!-- Diffrentiate Admin and add post backs -->
<input type=hidden name=fid value="<?php echo $my_fid;?>">
<?php $facility = sqlQuery("select * from facility where id='$my_fid'"); ?>
<?php $facility = sqlQuery("select * from facility where id=?", array($my_fid)); ?>

<table border=0 cellpadding=0 cellspacing=1 style="width:630px;">
<tr>
Expand Down Expand Up @@ -191,7 +191,7 @@ function displayAlert()
</tr>
<?php
$disabled='';
$resPBE=sqlStatement("select * from facility where primary_business_entity='1' and id!='".$my_fid."'");
$resPBE=sqlStatement("select * from facility where primary_business_entity='1' and id!=?", array($my_fid));
if(sqlNumRows($resPBE)>0)
$disabled='disabled';
?>
Expand Down
2 changes: 1 addition & 1 deletion interface/usergroup/user_admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ function authorized_clicked() {
?>
</table>

<INPUT TYPE="HIDDEN" NAME="id" VALUE="<?php echo $_GET["id"]; ?>">
<INPUT TYPE="HIDDEN" NAME="id" VALUE="<?php echo attr($_GET["id"]); ?>">
<INPUT TYPE="HIDDEN" NAME="mode" VALUE="update">
<INPUT TYPE="HIDDEN" NAME="privatemode" VALUE="user_admin">

Expand Down
8 changes: 4 additions & 4 deletions library/appointments.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ function fetchAllEvents( $from_date, $to_date, $provider_id = null, $facility_id

$facility_filter = '';
if ( $facility_id ) {
$event_facility_filter = " AND e.pc_facility = '$facility_id'";
$provider_facility_filter = " AND u.facility_id = '$facility_id'";
$event_facility_filter = " AND e.pc_facility = '" . add_escape_custom($facility_id) . "'"; //escape $facility_id
$provider_facility_filter = " AND u.facility_id = '" . add_escape_custom($facility_id) . "'"; //escape $facility_id
$facility_filter = $event_facility_filter . $provider_facility_filter;
}

Expand All @@ -104,8 +104,8 @@ function fetchAppointments( $from_date, $to_date, $patient_id = null, $provider_

$facility_filter = '';
if ( $facility_id ) {
$event_facility_filter = " AND e.pc_facility = '$facility_id'";
$provider_facility_filter = " AND u.facility_id = '$facility_id'";
$event_facility_filter = " AND e.pc_facility = '" . add_escape_custom($facility_id) . "'"; // escape $facility_id
$provider_facility_filter = " AND u.facility_id = '" . add_escape_custom($facility_id) . "'"; // escape $facility_id
$facility_filter = $event_facility_filter . $provider_facility_filter;
}

Expand Down

0 comments on commit cd804e3

Please sign in to comment.