From e69afba14e76e1f54bac644f78afcb66ef3179cc 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. --- .../opac-tmpl/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 f40024f..19ee4b5 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 f29e170..3504ba1 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}; -- 1.9.1