Version 4.7.0

This commit is contained in:
Neo committed 2025-12-19 16:00:35 -08:00
1 parent 517a5e1f70
commit 8ba7d43898
1933 files changed
+65613 -11332

No files matched your search

+27 -18
View File
@@ -88,16 +88,11 @@ class _updatecheck extends \IPS\Task
try
{
$bulletins = \IPS\Http\Url::ips('bulletin')->request()->get()->decodeJson();
$knownBulletins = iterator_to_array( \IPS\Db::i()->select( 'id', 'core_ips_bulletins' ) );
foreach ( $bulletins as $id => $bulletin )
{
if ( \in_array( $id, $knownBulletins ) )
{
break;
}
\IPS\Db::i()->insert( 'core_ips_bulletins', array(
'id' => $id,
'title' => $bulletin['title'],
'body' => $bulletin['body'],
@@ -107,33 +102,47 @@ class _updatecheck extends \IPS\Task
'link' => $bulletin['link'],
'conditions' => $bulletin['conditions'],
'cached' => time(),
'minVersion' => $bulletin['minVersion'],
'maxVersion' => $bulletin['maxVersion']
) );
'min_version' => $bulletin['minVersion'],
'max_version' => $bulletin['maxVersion']
), TRUE );
/* Don't send the notification until after we insert the bulletin data */
try
{
if ( @eval( $bulletin['conditions'] ) )
if (
/* If the value is 0 for minVersion, there is no minimum version (a.k.a., display it). Same deal with maxVersion. */
( $bulletin['minVersion'] == 0 AND $bulletin['maxVersion'] == 0 )
/* If there's no minimum version, and the maximum Version is within range */
OR ( $bulletin['minVersion'] == 0 AND \IPS\Application::load('core')->long_version < $bulletin['maxVersion'] )
/* If there's no maximum version, and the minimum version is within range */
OR ( $bulletin['maxVersion'] == 0 AND \IPS\Application::load('core')->long_version > $bulletin['minVersion'] )
/* If both min and max versions are within range */
OR ( \IPS\Application::load('core')->long_version >= $bulletin['minVersion'] AND \IPS\Application::load('core')->long_version <= $bulletin['maxVersion'] )
)
{
\IPS\core\AdminNotification::send( 'core', 'Bulletin', $id, FALSE );
if ( @eval( $bulletin['conditions'] ) )
{
\IPS\core\AdminNotification::send( 'core', 'Bulletin', (string) $id, FALSE );
}
else
{
\IPS\core\AdminNotification::remove( 'core', 'Bulletin', (string) $id );
}
}
else
{
\IPS\core\AdminNotification::remove( 'core', 'Bulletin', $id );
\IPS\core\AdminNotification::remove( 'core', 'Bulletin', (string) $id );
}
}
catch ( \Exception $e )
{
\IPS\Log::log( $e, 'bulletin' );
}
catch ( \Throwable $e )
catch ( \Throwable | \Exception $e )
{
\IPS\Log::log( $e, 'bulletin' );
}
}
}
catch( \RuntimeException $e ) { }
catch( \RuntimeException $e ){ }
$updateChecked = [];
$marketplaceUpdates = [];