while ($ref = $sth->fetchrow_hashref(NAME_lc)) {
foreach my $key (split(/:/, $ref->{link})) {
- if ($key =~ /$module/) {
+ if ($key =~ /\Q$module\E/) {
# cross reference for keys
$xkeyref{ $ref->{accno} } = $key;
while ($ref = $sth->fetchrow_hashref(NAME_lc)) {
foreach my $key (split(/:/, $ref->{link})) {
- if ($key =~ /$module/) {
+ if ($key =~ /\Q$module\E/) {
# cross reference for keys
$xkeyref{ $ref->{accno} } = $key;
}
$sth->finish();
- my $printed = ($self->{printed} =~ /$self->{formname}/) ? "1" : "0";
- my $emailed = ($self->{emailed} =~ /$self->{formname}/) ? "1" : "0";
+ my $printed = ($self->{printed} =~ /\Q$self->{formname}\E/) ? "1" : "0";
+ my $emailed = ($self->{emailed} =~ /\Q$self->{formname}\E/) ? "1" : "0";
my %queued = split / /, $self->{queued};
my @values;
my %queued = split / /, $self->{queued};
foreach my $formname (keys %queued) {
- $printed = ($self->{printed} =~ /$self->{formname}/) ? "1" : "0";
- $emailed = ($self->{emailed} =~ /$self->{formname}/) ? "1" : "0";
+ $printed = ($self->{printed} =~ /\Q$self->{formname}\E/) ? "1" : "0";
+ $emailed = ($self->{emailed} =~ /\Q$self->{formname}\E/) ? "1" : "0";
$query = qq|INSERT INTO status (trans_id, printed, emailed, spoolfile, formname)
VALUES (?, ?, ?, ?, ?)|;
do_query($self, $dbh, $query, $self->{id}, $printed, $emailed, $queued{$formname}, $formname);
- $formnames =~ s/$self->{formname}//;
- $emailforms =~ s/$self->{formname}//;
+ $formnames =~ s/\Q$self->{formname}\E//;
+ $emailforms =~ s/\Q$self->{formname}\E//;
}
}
map { $status{$_}{emailed} = 1 } split / +/, $emailforms;
foreach my $formname (keys %status) {
- $printed = ($formnames =~ /$self->{formname}/) ? "1" : "0";
- $emailed = ($emailforms =~ /$self->{formname}/) ? "1" : "0";
+ $printed = ($formnames =~ /\Q$self->{formname}\E/) ? "1" : "0";
+ $emailed = ($emailforms =~ /\Q$self->{formname}\E/) ? "1" : "0";
$query = qq|INSERT INTO status (trans_id, printed, emailed, formname)
VALUES (?, ?, ?, ?)|;
$form->{taxaccount} = "";
while ($ptr = $stw->fetchrow_hashref(NAME_lc)) {
$form->{taxaccount} .= "$ptr->{accno} ";
- if (!($form->{taxaccount2} =~ /$ptr->{accno}/)) {
+ if (!($form->{taxaccount2} =~ /\Q$ptr->{accno}\E/)) {
$form->{"$ptr->{accno}_rate"} = $ptr->{rate};
$form->{"$ptr->{accno}_description"} = $ptr->{description};
$form->{"$ptr->{accno}_taxnumber"} = $ptr->{taxnumber};
my $sth = prepare_execute_query($form, $dbh, $query, @values);
while (my $ref = $sth->fetchrow_hashref(NAME_lc)) {
foreach my $key (split(/:/, $ref->{link})) {
- if ($key =~ /$module/) {
+ if ($key =~ /\Q$module\E/) {
if ( ($ref->{id} eq $ref->{inventory_accno_id})
|| ($ref->{id} eq $ref->{income_accno_id})
|| ($ref->{id} eq $ref->{expense_accno_id})) {
# add shipto
$form->{name} = $form->{vendor};
- $form->{name} =~ s/--$form->{vendor_id}//;
+ $form->{name} =~ s/--\Q$form->{vendor_id}\E//;
$form->add_shipto($dbh, $form->{id}, "AP");
# delete zero entries
$ref->{taxaccounts} .= "$ptr->{accno} ";
- if (!($form->{taxaccounts} =~ /$ptr->{accno}/)) {
+ if (!($form->{taxaccounts} =~ /\Q$ptr->{accno}\E/)) {
$form->{"$ptr->{accno}_rate"} = $ptr->{rate};
$form->{"$ptr->{accno}_description"} = $ptr->{taxdescription};
$form->{"$ptr->{accno}_taxnumber"} = $ptr->{taxnumber};
$ref->{taxaccounts} .= "$ptr->{accno} ";
- if (!($form->{taxaccounts} =~ /$ptr->{accno}/)) {
+ if (!($form->{taxaccounts} =~ /\Q$ptr->{accno}\E/)) {
$form->{"$ptr->{accno}_rate"} = $ptr->{rate};
$form->{"$ptr->{accno}_description"} = $ptr->{taxdescription};
$form->{"$ptr->{accno}_taxnumber"} = $ptr->{taxnumber};
foreach my $trans_id (keys %{ $form->{amount} }) {
foreach my $accno (keys %{ $form->{amount}{$trans_id} }) {
- next unless ($form->{expense_inventory} =~ /$accno/);
+ next unless ($form->{expense_inventory} =~ /\Q$accno\E/);
$form->{amount}{$trans_id}{$accno} = $form->round_amount($form->{amount}{$trans_id}{$accno}, 2);
# add shipto
$form->{name} = $form->{customer};
- $form->{name} =~ s/--$form->{customer_id}//;
+ $form->{name} =~ s/--\Q$form->{customer_id}\E//;
if (!$form->{shipto_id}) {
$form->add_shipto($dbh, $form->{id}, "AR");
}
$ref->{taxaccounts} .= "$ptr->{accno} ";
- if (!($form->{taxaccounts} =~ /$ptr->{accno}/)) {
+ if (!($form->{taxaccounts} =~ /\Q$ptr->{accno}\E/)) {
$form->{"$ptr->{accno}_rate"} = $ptr->{rate};
$form->{"$ptr->{accno}_description"} = $ptr->{taxdescription};
$form->{"$ptr->{accno}_taxnumber"} = $ptr->{taxnumber};
}
$ref->{taxaccounts} .= "$ptr->{accno} ";
- if (!($form->{taxaccounts} =~ /$ptr->{accno}/)) {
+ if (!($form->{taxaccounts} =~ /\Q$ptr->{accno}\E/)) {
$form->{"$ptr->{accno}_rate"} = $ptr->{rate};
$form->{"$ptr->{accno}_description"} = $ptr->{taxdescription};
$form->{"$ptr->{accno}_taxnumber"} = $ptr->{taxnumber};
} else {
$filename = $attachment;
# strip path
- $filename =~ s/(.*\/|$self->{fileid})//g;
+ $filename =~ s/(.*\/|\Q$self->{fileid}\E)//g;
}
my $application =
# add shipto
$form->{name} = $form->{ $form->{vc} };
- $form->{name} =~ s/--$form->{"$form->{vc}_id"}//;
+ $form->{name} =~ s/--\Q$form->{"$form->{vc}_id"}\E//;
if (!$form->{shipto_id}) {
$form->add_shipto($dbh, $form->{id}, "OE");
$ptr->{accno} = $i;
}
$ref->{taxaccounts} .= "$ptr->{accno} ";
- if (!($form->{taxaccounts} =~ /$ptr->{accno}/)) {
+ if (!($form->{taxaccounts} =~ /\Q$ptr->{accno}\E/)) {
$form->{"$ptr->{accno}_rate"} = $ptr->{rate};
$form->{"$ptr->{accno}_description"} = $ptr->{taxdescription};
$form->{"$ptr->{accno}_taxnumber"} = $ptr->{taxnumber};
my $self = shift;
my $format = shift;
- return grep { my $c = $self->{columns}->{$_}; $c && $c->{visible} && (($c->{visible} == 1) || ($c->{visible} =~ /${format}/i)) } @{ $self->{column_order} };
+ return grep { my $c = $self->{columns}->{$_}; $c && $c->{visible} && (($c->{visible} == 1) || ($c->{visible} =~ /\Q${format}\E/i)) } @{ $self->{column_order} };
}
sub html_format {
return 0;
}
- $form->{tmpfile} =~ s/$userspath\///g;
+ $form->{tmpfile} =~ s/\Q$userspath\E\///g;
for (my $run = 1; $run <= 2; $run++) {
system("latex --interaction=nonstopmode $form->{tmpfile} " .
return 0;
}
- $form->{tmpfile} =~ s/$userspath\///g;
+ $form->{tmpfile} =~ s/\Q$userspath\E\///g;
for (my $run = 1; $run <= 2; $run++) {
system("pdflatex --interaction=nonstopmode $form->{tmpfile} " .
return 0;
}
- $form->{"tmpfile"} =~ s/$userspath\///g;
+ $form->{"tmpfile"} =~ s/\Q$userspath\E\///g;
my $psfile = $form->{"tmpfile"};
$psfile =~ s/.html/.ps/;
if ($psfile eq $form->{"tmpfile"}) {
return 0;
}
- $form->{"tmpfile"} =~ s/$userspath\///g;
+ $form->{"tmpfile"} =~ s/\Q$userspath\E\///g;
my $pdffile = $form->{"tmpfile"};
$pdffile =~ s/.html/.pdf/;
if ($pdffile eq $form->{"tmpfile"}) {
foreach my $upgradescript (@upgradescripts) {
my $a = $upgradescript;
- $a =~ s/^$form->{dbdriver}-upgrade-|\.(sql|pl)$//g;
+ $a =~ s/^\Q$form->{dbdriver}\E-upgrade-|\.(sql|pl)$//g;
my $file_type = $1;
my ($mindb, $maxdb) = split /-/, $a;
truncate(CONF, 0);
while ($line = shift @config) {
- if ($line =~ /^\[$self->{login}\]/) {
+ if ($line =~ /^\[\Q$self->{login}\E\]/) {
$newmember = 0;
last;
}
open(TEMP, "$templates/$file")
or $form->error("$templates/$file : $ERRNO");
- $file =~ s/$form->{mastertemplates}-//;
+ $file =~ s/\Q$form->{mastertemplates}\E-//;
open(NEW, ">$form->{templates}/$file")
or $form->error("$form->{templates}/$file : $ERRNO");
if ($form->{id}) {
$form->{selectIC} =~ s/selected//g;
- $form->{selectIC} =~ s/ value=$form->{inventory_accno_id}/ value=$form->{inventory_accno_id} selected/;
+ $form->{selectIC} =~ s/ value=\Q$form->{inventory_accno_id}\E/ value=$form->{inventory_accno_id} selected/;
$form->{selectIC_income} =~ s/selected//g;
- $form->{selectIC_income} =~ s/ value=$form->{income_accno_id_0}/ value=$form->{income_accno_id_0} selected/;
+ $form->{selectIC_income} =~ s/ value=\Q$form->{income_accno_id_0}\E/ value=$form->{income_accno_id_0} selected/;
$form->{selectIC_expense} =~ s/selected//g;
- $form->{selectIC_expense} =~ s/ value=$form->{expense_accno_id_0}/ value=$form->{expense_accno_id_0} selected/;
+ $form->{selectIC_expense} =~ s/ value=\Q$form->{expense_accno_id_0}\E/ value=$form->{expense_accno_id_0} selected/;
}
if (!$eur) {
</tr>|;
if ($form->{id}) {
$form->{selectIC_income} =~ s/selected//g;
- $form->{selectIC_income} =~ s/ value=$form->{income_accno_id_1}/ value=$form->{income_accno_id_1} selected/;
+ $form->{selectIC_income} =~ s/ value=\Q$form->{income_accno_id_1}\E/ value=$form->{income_accno_id_1} selected/;
$form->{selectIC_expense} =~ s/selected//g;
- $form->{selectIC_expense} =~ s/ value=$form->{expense_accno_id_1}/ value=$form->{expense_accno_id_1} selected/;
+ $form->{selectIC_expense} =~ s/ value=\Q$form->{expense_accno_id_1}\E/ value=$form->{expense_accno_id_1} selected/;
}
$linkaccounts .= qq| <tr>
<th align=right>| . $locale->text('Revenues EU with UStId') . qq|</th>
if ($form->{id}) {
$form->{selectIC_income} =~ s/selected//g;
- $form->{selectIC_income} =~ s/ value=$form->{income_accno_id_2}/ value=$form->{income_accno_id_2} selected/;
+ $form->{selectIC_income} =~ s/ value=\Q$form->{income_accno_id_2}\E/ value=$form->{income_accno_id_2} selected/;
$form->{selectIC_expense} =~ s/selected//g;
- $form->{selectIC_expense} =~ s/ value=$form->{expense_accno_id_2}/ value=$form->{expense_accno_id_2} selected/;
+ $form->{selectIC_expense} =~ s/ value=\Q$form->{expense_accno_id_2}\E/ value=$form->{expense_accno_id_2} selected/;
}
$linkaccounts .= qq| <tr>
if ($form->{id}) {
$form->{selectIC_income} =~ s/selected//g;
- $form->{selectIC_income} =~ s/ value=$form->{income_accno_id_3}/ value=$form->{income_accno_id_3} selected/;
+ $form->{selectIC_income} =~ s/ value=\Q$form->{income_accno_id_3}\E/ value=$form->{income_accno_id_3} selected/;
$form->{selectIC_expense} =~ s/selected//g;
- $form->{selectIC_expense} =~ s/ value=$form->{expense_accno_id_3}/ value=$form->{expense_accno_id_3} selected/;
+ $form->{selectIC_expense} =~ s/ value=\Q$form->{expense_accno_id_3}\E/ value=$form->{expense_accno_id_3} selected/;
}
$linkaccounts .= qq| <tr>
$form->redirect($locale->text("Marked as paid"));
}
else {
- my $referer = $ENV{HTTP_REFERER};
- $referer =~ s/^(.*)action\=.*\&(.*)$/$1action\=mark_as_paid\&mark_as_paid\=1\&login\=$form->{login}\&password\=$form->{password}\&id\=$form->{id}\&$2/;
+ my $referer = $ENV{HTTP_REFERER};
+ my $login = $form->escape($form->{login});
+ my $password = $form->escape($form->{password});
+ my $id = $form->escape($form->{id});
+ $referer =~ s/^(.*)action\=.*\&(.*)$/$1action\=mark_as_paid\&mark_as_paid\=1\&login\=$login\&password\=$password\&id\=$id\&$2/;
$form->header();
print qq|<body>|;
print qq|<p><b>|.$locale->text('Mark as paid?').qq|</b></p>|;
# if this is a tax field
if ($key =~ /IC_tax/) {
- if ($key =~ /$item/) {
+ if ($key =~ /\Q$item\E/) {
$form->{taxaccounts} .= "$ref->{accno} ";
$form->{"IC_tax_$ref->{accno}_description"} =
"$ref->{accno}--$ref->{description}";
%queued = map { s|.*/|| } split / /, $form->{queued};
if ($filename = $queued{ $form->{formname} }) {
- $form->{queued} =~ s/$form->{formname} $filename//;
+ $form->{queued} =~ s/\Q$form->{formname} $filename\E//;
unlink "$spool/$filename";
$filename =~ s/\..*$//g;
} else {
sub acc_menu {
$lxdebug->enter_sub();
$mainlevel = $form->{level};
- $mainlevel =~ s/$mainlevel--//g;
+ $mainlevel =~ s/\Q$mainlevel\E--//g;
my $menu = new Menu "$menufile";
$form->{title} = $locale->text('Accounting Menu');
$item = shift @menuorder;
$label = $item;
$ml = $item;
- $label =~ s/$level--//g;
+ $label =~ s/\Q$level\E--//g;
$ml =~ s/--.*//;
if ($ml eq $mainlevel) { $zeige = 1; }
else { $zeige = 0; }
if ($menu->{$item}{submenu}) {
$menu->{$item}{$item} = !$form->{$item};
- if ($form->{level} && $item =~ /^$form->{level}/) {
+ if ($form->{level} && $item =~ /^\Q$form->{level}\E/) {
# expand menu
if ($zeige) {
sub acc_menu {
$mainlevel = $form->{level};
- $mainlevel =~ s/$mainlevel--//g;
+ $mainlevel =~ s/\Q$mainlevel\E--//g;
my $menu = new Menu "$menufile";
$| = 1;
$item = shift @menuorder;
$label = $item;
$ml = $item;
- $label =~ s/$level--//g;
+ $label =~ s/\Q$level\E--//g;
$ml =~ s/--.*//;
$label = $locale->text($label);
$label =~ s/ / /g;
$locale = Locale->new($language, "menu");
$mainlevel = $form->{level};
- $mainlevel =~ s/$mainlevel--//g;
+ $mainlevel =~ s/\Q$mainlevel\E--//g;
my $menu = new Menu "$menufile";
$| = 1;