Merge branch 'master' into WebGUI8. Merged up to 7.10.4
This commit is contained in:
commit
5f3014aaee
66 changed files with 3078 additions and 997 deletions
|
|
@ -409,20 +409,18 @@ sub processReplacements {
|
|||
my $session = shift;
|
||||
my ($content) = @_;
|
||||
my $replacements = $session->stow->get("replacements");
|
||||
if (defined $replacements) {
|
||||
foreach my $searchFor (keys %{$replacements}) {
|
||||
my $replaceWith = $replacements->{$searchFor};
|
||||
$content =~ s/\Q$searchFor/$replaceWith/gs;
|
||||
}
|
||||
} else {
|
||||
if (! defined $replacements) {
|
||||
my $sth = $session->dbSlave->read("select searchFor,replaceWith from replacements");
|
||||
while (my ($searchFor,$replaceWith) = $sth->array) {
|
||||
while (my ($searchFor,$replaceWith) = $sth->array) {
|
||||
$replacements->{$searchFor} = $replaceWith;
|
||||
$content =~ s/\Q$searchFor/$replaceWith/gs;
|
||||
}
|
||||
$sth->finish;
|
||||
$session->stow->set("replacements",$replacements);
|
||||
}
|
||||
$sth->finish;
|
||||
$session->stow->set("replacements",$replacements);
|
||||
}
|
||||
foreach my $searchFor (keys %{$replacements}) {
|
||||
my $replaceWith = $replacements->{$searchFor};
|
||||
$content =~ s/\b\Q$searchFor\E\b/$replaceWith/gs;
|
||||
}
|
||||
return $content;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue