@@ -33,7 +33,7 @@ function return_error($str) {
33
33
function get_output_file ($ instance_name , $ file_num , $ auth_str ) {
34
34
$ result = BoincResult::lookup_name (BoincDb::escape_string ($ instance_name ));
35
35
if (!$ result ) {
36
- return_error ("no job instance $ instance_name" );
36
+ return_error ("no job instance " . htmlspecialchars ( $ instance_name) );
37
37
}
38
38
$ workunit = BoincWorkunit::lookup_id ($ result ->workunitid );
39
39
if (!$ workunit ) {
@@ -124,7 +124,7 @@ function get_wu_output_file($wu_name, $file_num, $auth_str) {
124
124
$ wu_name = BoincDb::escape_string ($ wu_name );
125
125
$ wu = BoincWorkunit::lookup ("name=' $ wu_name' " );
126
126
if (!$ wu ) {
127
- return_error ("no workunit $ wu_name" );
127
+ return_error ("no workunit " . htmlspecialchars ( $ wu_name) );
128
128
}
129
129
$ batch = BoincBatch::lookup_id ($ wu ->batch );
130
130
if (!$ batch ) {
@@ -140,15 +140,15 @@ function get_wu_output_file($wu_name, $file_num, $auth_str) {
140
140
$ fanout = parse_config (get_config (), "<uldl_dir_fanout> " );
141
141
$ upload_dir = parse_config (get_config (), "<upload_dir> " );
142
142
if (!$ wu ->canonical_resultid ) {
143
- return_error ("no canonical result for wu $ wu ->name " );
143
+ return_error ("no canonical result for wu " . htmlspecialchars ( $ wu ->name ) );
144
144
}
145
145
$ result = BoincResult::lookup_id ($ wu ->canonical_resultid );
146
146
$ names = get_outfile_names ($ result );
147
147
$ path = dir_hier_path ($ names [$ file_num ], $ upload_dir , $ fanout );
148
148
if (file_exists ($ path )) {
149
149
do_download ($ path );
150
150
} else {
151
- return_error ("no such file: $ path" );
151
+ return_error ("no such file: " . htmlspecialchars ( $ path) );
152
152
}
153
153
}
154
154
@@ -179,7 +179,7 @@ function get_wu_output_files($wu_id, $auth_str) {
179
179
$ upload_dir = parse_config (get_config (), "<upload_dir> " );
180
180
181
181
if (!$ wu ->canonical_resultid ) {
182
- return_error ("no canonical result for wu $ wu ->name " );
182
+ return_error ("no canonical result for wu " . htmlspecialchars ( $ wu ->name ) );
183
183
}
184
184
$ result = BoincResult::lookup_id ($ wu ->canonical_resultid );
185
185
$ names = get_outfile_names ($ result );
0 commit comments