Skip to content
This repository has been archived by the owner on Jan 25, 2021. It is now read-only.

Commit

Permalink
bool return value wasn't correctly evaluated
Browse files Browse the repository at this point in the history
  • Loading branch information
Guenter Hipler authored and Lionel Walter committed Dec 15, 2016
1 parent e29f3ad commit f795004
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions module/Swissbib/src/Swissbib/View/Helper/NationalLicences.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'.
Expand All @@ -46,6 +48,9 @@
*/
class NationalLicences extends AbstractHelper
{
/**
* @var HelperPluginManager
*/
protected $sm;
protected $config;
protected $record;
Expand All @@ -59,7 +64,7 @@ class NationalLicences extends AbstractHelper
/**
* NationalLicences constructor.
*
* @param ServiceManager $sm ServiceManager
* @param $sm HelperPluginManager
*/
public function __construct($sm)
{
Expand Down Expand Up @@ -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);
}

/**
Expand All @@ -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;
Expand Down

0 comments on commit f795004

Please sign in to comment.