Version 4.1.19

This commit is contained in:
Neo committed 2025-12-19 05:38:56 -08:00
1 parent 28bd025b35
commit 2bd5025018
2674 files changed
+233518 -77766

No files matched your search

+39 -9
View File
@@ -2,9 +2,9 @@
/**
* @brief Fraud Rule Node
* @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 11 Mar 2014
* @version SVN_VERSION_NUMBER
@@ -428,7 +428,7 @@ class _Rule extends \IPS\Node\Model
}
/* Country */
if ( $this->country != '*' )
if ( $this->country != '*' and $transaction->invoice->billaddress )
{
if ( !in_array( $transaction->invoice->billaddress->country, explode(',', $this->country ) ) )
{
@@ -468,15 +468,15 @@ class _Rule extends \IPS\Node\Model
{
/* If there was an error, we cannot check any of these */
$maxMind = $transaction->fraud;
if ( $maxMind->err )
if ( $maxMind->error() )
{
return FALSE;
}
/* Score */
if ( $this->maxmind )
{
if ( !$this->_checkCondition( $maxMind->score, $this->maxmind, $this->maxmind_unit ) )
{
if ( !$this->_checkCondition( $maxMind->riskScore !== NULL ? $maxMind->riskScore : round( $maxMind->score * 10 ), $this->maxmind, $this->maxmind_unit ) )
{
return FALSE;
}
@@ -551,14 +551,44 @@ class _Rule extends \IPS\Node\Model
*/
protected function _checkCondition( $a, $operator, $b )
{
if ( $a instanceof \IPS\Math\Number and !( $b instanceof \IPS\Math\Number ) )
{
$b = new \IPS\Math\Number( "{$b}" );
}
if ( !( $a instanceof \IPS\Math\Number ) and $b instanceof \IPS\Math\Number )
{
$a = new \IPS\Math\Number( "{$a}" );
}
switch ( $operator )
{
case 'g':
return $a > $b;
if ( $a instanceof \IPS\Math\Number )
{
return $a->compare( $b ) === 1;
}
else
{
return $a > $b;
}
case 'e':
return $a == $b;
if ( $a instanceof \IPS\Math\Number )
{
return $a->compare( $b ) === 0;
}
else
{
return $a == $b;
}
case 'l':
return $a < $b;
if ( $a instanceof \IPS\Math\Number )
{
return $a->compare( $b ) === -1;
}
else
{
return $a < $b;
}
case 'c':
return mb_strpos( $a, $b ) !== FALSE;
case 'mm':