From d1708202116435ccc2c7e77937f667177a015121 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 26 May 2015 13:05:51 +0200 Subject: [PATCH] Bug 14266: Trim the email address in the pl script The original concern of bug 14266 was to provide a compatibility for The form is not submited, no alert/message is displayed (same as before this patch). 3/ Share a list and provide an email address with spaces before and after 4/ Submit => You should receive the email Signed-off-by: Indranil Das Gupta (L2C2 Technologies) Test output compliant with expected test plan outcome. Signed-off-by: Kyle M Hall Signed-off-by: Tomas Cohen Arazi (cherry picked from commit c7a8e4dd25768870de74a5a96c63a92ff1c7fcc8) Signed-off-by: Chris Cormack --- .../bootstrap/en/modules/opac-shareshelf.tt | 17 +++++++++++++++-- opac/opac-shareshelf.pl | 6 ++++++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shareshelf.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shareshelf.tt index f40024fb97..19ee4b5b76 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shareshelf.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shareshelf.tt @@ -44,7 +44,7 @@ [% ELSIF op=='invite' %]
-
+
    @@ -89,4 +89,17 @@
[% INCLUDE 'opac-bottom.inc' %] -[% BLOCK jsinclude %][% END %] +[% BLOCK jsinclude %] + +[% END %] diff --git a/opac/opac-shareshelf.pl b/opac/opac-shareshelf.pl index f29e170b4f..3504ba1995 100755 --- a/opac/opac-shareshelf.pl +++ b/opac/opac-shareshelf.pl @@ -60,6 +60,12 @@ sub _init { $param->{fail_addr} = []; $param->{errcode} = check_common_errors($param); + # trim email address + if ( $param->{addrlist} ) { + $param->{addrlist} =~ s|^\s+||; + $param->{addrlist} =~ s|\s+$||; + } + #get some list details my @temp; @temp = GetShelf( $param->{shelfnumber} ) if !$param->{errcode}; -- 2.39.5