@@ -128,10 +128,10 @@ function doSubs($s)
128
128
$ nextLocation = 0 ;
129
129
$ groupLevel = 0 ;
130
130
$ groupCount = 0 ;
131
-
131
+
132
132
while (($ keyLocation = strpos ($ s , '{ ' , $ nextLocation )) !== false ) {
133
133
$ nextLocation = $ keyLocation + 1 ;
134
-
134
+
135
135
if (keySearch ($ s , '{PatientSignature} ' )) {
136
136
$ fn = $ GLOBALS ['web_root ' ] . '/portal/sign/assets/signhere.png ' ;
137
137
$ sigfld = '<span> ' ;
@@ -231,7 +231,7 @@ function doSubs($s)
231
231
$ patientid = $ ptrow ['pid ' ];
232
232
$ DOS = substr ($ enrow ['date ' ], 0 , 10 );
233
233
// Prefer appointment comment if one is present.
234
- $ evlist = fetchEvents ($ DOS , $ DOS , " AND pc_pid = ' $ patientid ' " );
234
+ $ evlist = fetchEvents ($ DOS , $ DOS , " AND pc_pid = ? " , null , false , 0 , array ( $ patientid ) );
235
235
foreach ($ evlist as $ tmp ) {
236
236
if ($ tmp ['pc_pid ' ] == $ pid && ! empty ($ tmp ['pc_hometext ' ])) {
237
237
$ cc = $ tmp ['pc_hometext ' ];
@@ -345,7 +345,7 @@ function doSubs($s)
345
345
$ s = keyReplace ($ s , dataFixup ($ data , $ title ));
346
346
}
347
347
} // End if { character found.
348
-
348
+
349
349
return $ s ;
350
350
}
351
351
// Get patient demographic info.
@@ -368,9 +368,12 @@ function doSubs($s)
368
368
}
369
369
370
370
$ templatedir = $ GLOBALS ['OE_SITE_DIR ' ] . '/documents/onsite_portal_documents/templates ' ;
371
+
372
+ check_file_dir_name ($ form_filename );
371
373
$ templatepath = "$ templatedir/ $ form_filename " ;
372
374
// test if this is folder with template, if not, must be for a specific patient
373
375
if (! file_exists ($ templatepath )) {
376
+ check_file_dir_name ($ pid );
374
377
$ templatepath = "$ templatedir/ " . $ pid . "/ $ form_filename " ;
375
378
}
376
379
0 commit comments