Version 4.5.0

This commit is contained in:
Neo committed 2025-12-19 05:51:58 -08:00
1 parent 1a0c7fd3c2
commit f79dcf067a
3791 files changed
+248032 -76372

No files matched your search

@@ -12,7 +12,7 @@
namespace IPS\nexus\Invoice;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
@@ -41,7 +41,7 @@ class _ItemsIterator extends \ArrayIterator
*/
public function arrayToObject( $data )
{
if ( is_object( $data ) )
if ( \is_object( $data ) )
{
return $data;
}
@@ -56,12 +56,12 @@ class _ItemsIterator extends \ArrayIterator
if ( static::$classnames === NULL )
{
static::$classnames = array();
foreach ( \IPS\Application::allExtensions( 'nexus', 'Item', TRUE, NULL, NULL, FALSE ) as $ext )
foreach ( \IPS\Application::allExtensions( 'nexus', 'Item', FALSE, NULL, NULL, FALSE ) as $ext )
{
static::$classnames[ $ext::$application ][ $ext::$type ] = $ext;
}
}
if ( $data['app'] === 'nexus' and in_array( $data['type'], array( 'product', 'hosting', 'ad' ) ) )
if ( $data['app'] === 'nexus' and \in_array( $data['type'], array( 'product', 'hosting', 'ad' ) ) )
{
$data['type'] = 'package';
}
@@ -151,6 +151,10 @@ class _ItemsIterator extends \ArrayIterator
if ( isset( $data['renew_term'] ) and $data['renew_term'] )
{
$obj->renewalTerm = new \IPS\nexus\Purchase\RenewalTerm( new \IPS\nexus\Money( $data['renew_cost'], $this->currency ), new \DateInterval( 'P' . $data['renew_term'] . mb_strtoupper( $data['renew_units'] ) ), $obj->tax, FALSE, isset( $data['grace_period'] ) ? new \DateInterval( 'PT' . $data['grace_period'] . 'S' ) : NULL );
if ( isset( $data['initial_interval_term'] ) and $data['initial_interval_term'] )
{
$obj->initialInterval = new \DateInterval( 'P' . $data['initial_interval_term'] . mb_strtoupper( $data['initial_interval_unit'] ) );
}
}
/* Expire Date */
@@ -189,7 +193,11 @@ class _ItemsIterator extends \ArrayIterator
{
if ( $data['assocBought'] )
{
$obj->parent = \IPS\nexus\Purchase::load( $data['assoc'] );
try
{
$obj->parent = \IPS\nexus\Purchase::load( $data['assoc'] );
}
catch ( \OutOfRangeException $e ) { }
}
else
{