Version 4.1.19
This commit is contained in:
1 parent
28bd025b35
commit
2bd5025018
2674 files changed
+233518
-77766
No files matched your search
@@ -2,9 +2,9 @@
|
||||
/**
|
||||
* @brief MaxMind Response
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @package IPS Community Suite
|
||||
* @subpackage Nexus
|
||||
* @since 07 Mar 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
@@ -32,10 +32,10 @@ class _Response
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param \IPS\Http\Response
|
||||
* @param string|NULL $data Data from MaxMind
|
||||
* @return void
|
||||
*/
|
||||
public function __construct( \IPS\Http\Response $data = NULL )
|
||||
public function __construct( $data = NULL )
|
||||
{
|
||||
if ( $data )
|
||||
{
|
||||
@@ -94,4 +94,41 @@ class _Response
|
||||
{
|
||||
return ( 100 - 10 ) / 3 * $this->proxyScore + ( $this->proxyScore > 3 ? ( 10 * ( $this->proxyScore - 3 ) ) : 0 );
|
||||
}
|
||||
|
||||
/**
|
||||
* minFraud error codes
|
||||
*
|
||||
* @see https://dev.maxmind.com/minfraud/#Error_Reporting
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected static $responseErrors = array( 'INVALID_LICENSE_KEY', 'IP_REQUIRED', 'IP_NOT_FOUND ', 'MAX_REQUESTS_REACHED', 'LICENSE_REQUIRED ');
|
||||
|
||||
/**
|
||||
* Does the response include an error?
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function error()
|
||||
{
|
||||
if ( $this->err AND in_array($this->err, static::$responseErrors ) )
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Does the response include a warning?
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function warning()
|
||||
{
|
||||
if ( $this->err AND !in_array($this->err, static::$responseErrors ) )
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user