Bug 19911: Do not escape html characters when saving passwords

When the password is not generated automatically, we should not escape
the html characters. Otherwise it will be changed without any warnings.

Signed-off-by: Arturo <alongoria@sll.texas.gov>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
This commit is contained in:
Jonathan Druart 2018-01-04 11:00:35 -03:00 committed by Nick Clemens
parent d735b4957b
commit 25b2cd2d72
1 changed files with 9 additions and 4 deletions

View File

@ -441,10 +441,15 @@ sub ParseCgiForBorrower {
my $scrubber = C4::Scrubber->new();
my %borrower;
foreach ( $cgi->param ) {
if ( $_ =~ '^borrower_' ) {
my ($key) = substr( $_, 9 );
$borrower{$key} = $scrubber->scrub( scalar $cgi->param($_) );
foreach my $field ( $cgi->param ) {
if ( $field =~ '^borrower_' ) {
my ($key) = substr( $field, 9 );
if ( $field !~ '^borrower_password' ) {
$borrower{$key} = $scrubber->scrub( scalar $cgi->param($field) );
} else {
# Allow html characters for passwords
$borrower{$key} = $cgi->param($field);
}
}
}