Although use is being called in an eval it will still be executed
at compile time so that an error can cause the script to abort before
the eval is executed. The eval expression syntax is not checked
so eval block should be preferred.
Use require/import which execute at runtime which is the intention
here.
---
 opac/opac-detail.pl      |    5 ++++-
 opac/opac-showreviews.pl |    5 ++++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl
index e18e046..009e276 100755
--- a/opac/opac-detail.pl
+++ b/opac/opac-detail.pl
@@ -299,7 +299,10 @@ $template->param(
 );
 
 my $libravatar_enabled = 0;
-eval 'use Libravatar::URL';
+eval {
+    require Libravatar::URL;
+    Libravatar::URL->import();
+};
 if (!$@ and C4::Context->preference('ShowReviewer') and 
C4::Context->preference('ShowReviewerPhoto')) {
     $libravatar_enabled = 1;
 }
diff --git a/opac/opac-showreviews.pl b/opac/opac-showreviews.pl
index 3a74270..6402831 100755
--- a/opac/opac-showreviews.pl
+++ b/opac/opac-showreviews.pl
@@ -66,7 +66,10 @@ if($format eq "rss"){
 }
 
 my $libravatar_enabled = 0;
-eval 'use Libravatar::URL';
+eval {
+    require Libravatar::URL;
+    Libravatar::URL->import();
+};
 if (!$@ and C4::Context->preference('ShowReviewer') and 
C4::Context->preference('ShowReviewerPhoto')) {
     $libravatar_enabled = 1;
 }
-- 
1.7.6

_______________________________________________
Koha-patches mailing list
[email protected]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-patches
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to