From 8858a05b23df2769f6e03c5b0fd7647840799fff Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Wed, 20 Dec 2017 14:15:20 +0100 Subject: [PATCH] Presenter: Neue Struktur im DBUpgrade --- SL/DBUpgrade2/Base.pm | 3 ++- sql/Pg-upgrade2/oe_ar_ap_delivery_orders_edit_notes_as_html.pl | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/SL/DBUpgrade2/Base.pm b/SL/DBUpgrade2/Base.pm index 5d0d26c9b..cd698c5e5 100644 --- a/SL/DBUpgrade2/Base.pm +++ b/SL/DBUpgrade2/Base.pm @@ -12,6 +12,7 @@ use File::Copy (); use File::Path (); use List::MoreUtils qw(uniq); use SL::DBUtils qw(selectfirst_hashref_query); +use SL::Presenter::EscapedText qw(escape); use version; use Rose::Object::MakeMethods::Generic ( @@ -152,7 +153,7 @@ sub convert_column_to_html { foreach my $row (selectall_hashref_query($::form, $self->dbh, qq|SELECT id, $column FROM $table WHERE $column IS NOT NULL|)) { next if !$row->{$column} || (($row->{$column} =~ m{^<[a-z]+>}) && ($row->{$column} =~ m{$})); - my $new_content = "" . $::request->presenter->escape($row->{$column}); + my $new_content = "" . escape($row->{$column}); $new_content =~ s{\r}{}g; $new_content =~ s{\n\n+}{

}g; $new_content =~ s{\n}{
}g; diff --git a/sql/Pg-upgrade2/oe_ar_ap_delivery_orders_edit_notes_as_html.pl b/sql/Pg-upgrade2/oe_ar_ap_delivery_orders_edit_notes_as_html.pl index 2be82f172..a5575f6d2 100644 --- a/sql/Pg-upgrade2/oe_ar_ap_delivery_orders_edit_notes_as_html.pl +++ b/sql/Pg-upgrade2/oe_ar_ap_delivery_orders_edit_notes_as_html.pl @@ -7,6 +7,7 @@ use strict; use utf8; use SL::DBUtils; +use SL::Presenter::EscapedText qw(escape); use parent qw(SL::DBUpgrade2::Base); @@ -18,7 +19,7 @@ sub convert_column { foreach my $row (selectall_hashref_query($::form, $self->dbh, qq|SELECT id, $column FROM $table WHERE $column IS NOT NULL|)) { next if !$row->{$column} || (($row->{$column} =~ m{^<[a-z]+>}) && ($row->{$column} =~ m{$})); - my $new_content = "" . $::request->presenter->escape($row->{$column}); + my $new_content = "" . escape($row->{$column}); $new_content =~ s{\r}{}g; $new_content =~ s{\n\n+}{

}g; $new_content =~ s{\n}{
}g; -- 2.20.1