From f795004753bc5b61e35cc2444aec48ee8a7fe1be Mon Sep 17 00:00:00 2001 From: Guenter Hipler Date: Wed, 14 Dec 2016 22:19:45 +0100 Subject: [PATCH] bool return value wasn't correctly evaluated --- .../src/Swissbib/View/Helper/NationalLicences.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/module/Swissbib/src/Swissbib/View/Helper/NationalLicences.php b/module/Swissbib/src/Swissbib/View/Helper/NationalLicences.php index 66163940186..e060b81754e 100644 --- a/module/Swissbib/src/Swissbib/View/Helper/NationalLicences.php +++ b/module/Swissbib/src/Swissbib/View/Helper/NationalLicences.php @@ -33,6 +33,8 @@ use Zend\View\Helper\AbstractHelper; use Zend\Http\PhpEnvironment\RemoteAddress; use Swissbib\TargetsProxy\IpMatcher; +use Zend\View\HelperPluginManager; +use VuFind\RecordDriver\SolrDefault; /** * Return URL for NationalLicence online access if applicable. Otherwise 'false'. @@ -46,6 +48,9 @@ */ class NationalLicences extends AbstractHelper { + /** + * @var HelperPluginManager + */ protected $sm; protected $config; protected $record; @@ -59,7 +64,7 @@ class NationalLicences extends AbstractHelper /** * NationalLicences constructor. * - * @param ServiceManager $sm ServiceManager + * @param $sm HelperPluginManager */ public function __construct($sm) { @@ -260,8 +265,8 @@ public function __construct($sm) public function isUserInIpRange() { $ipAddress = $this->remoteAddress->getIpAddress(); - $isMatchingIp = $this->ipMatcher->isMatching($ipAddress, $this->validIps); - return $isMatchingIp; + return $this->ipMatcher->isMatching($ipAddress, $this->validIps); + //return boolval($isMatchingIp); } /** @@ -271,7 +276,7 @@ public function isUserInIpRange() * * @return bool|String */ - public function getUrl(\VuFind\RecordDriver\SolrDefault $record) + public function getUrl(SolrDefault $record) { if (!($record instanceof \Swissbib\RecordDriver\SolrMarc)) { return false;