Revision b5157f97
Von Moritz Bunkus vor mehr als 17 Jahren hinzugefügt
SL/BP.pm | ||
---|---|---|
263 | 263 |
sub print_spool { |
264 | 264 |
$main::lxdebug->enter_sub(); |
265 | 265 |
|
266 |
my ($self, $myconfig, $form, $spool) = @_; |
|
266 |
my ($self, $myconfig, $form, $spool, $output) = @_;
|
|
267 | 267 |
|
268 | 268 |
# connect to database |
269 | 269 |
my $dbh = $form->dbconnect($myconfig); |
... | ... | |
275 | 275 |
|
276 | 276 |
foreach my $i (1 .. $form->{rowcount}) { |
277 | 277 |
if ($form->{"checked_$i"}) { |
278 |
open(OUT, $form->{OUT}) or $form->error("$form->{OUT} : $!"); |
|
278 |
# $output is safe ( = does not come directly from the browser). |
|
279 |
open(OUT, $output) or $form->error("$output : $!"); |
|
279 | 280 |
|
281 |
$form->{"spoolfile_$i"} =~ s|.*/||; |
|
280 | 282 |
$spoolfile = qq|$spool/$form->{"spoolfile_$i"}|; |
281 | 283 |
|
282 | 284 |
# send file to printer |
bin/mozilla/bp.pl | ||
---|---|---|
325 | 325 |
|
326 | 326 |
for $i (1 .. $form->{rowcount}) { |
327 | 327 |
if ($form->{"checked_$i"}) { |
328 |
$form->{OUT} = "| $selected_printer"; |
|
329 | 328 |
$form->info($locale->text('Printing ... ')); |
330 | 329 |
|
331 |
if (BP->print_spool(\%myconfig, \%$form, $spool)) { |
|
330 |
if (BP->print_spool(\%myconfig, \%$form, $spool, "| $selected_printer")) {
|
|
332 | 331 |
print $locale->text('done'); |
333 | 332 |
$form->redirect($locale->text('Marked entries printed!')); |
334 | 333 |
} |
Auch abrufbar als: Unified diff
Keine direkt vom Browser stammenden Strings bei open() verwenden.