Version 4.7.23

This commit is contained in:
Neo committed 2025-12-19 16:21:27 -08:00
1 parent 7124a02564
commit 25ddeb65d6
1791 files changed
+76990 -44452

No files matched your search

@@ -10,6 +10,9 @@
namespace IPS\core\modules\admin\system;
use IPS\Http\Url;
use IPS\Output;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
@@ -303,7 +306,10 @@ class _login extends \IPS\Dispatcher\Controller
public function getCsrfKey()
{
/* Don't cache the CSRF key */
\IPS\Output::i()->pageCaching = FALSE;
\IPS\Output::setCacheTime( false );
/* Restrict endpoint to our origin JS */
Output::i()->httpHeaders['Access-Control-Allow-Origin'] = Url::baseUrl()->data[ Url::COMPONENT_SCHEME ] . '://' . Url::baseUrl()->data[ Url::COMPONENT_HOST ];
\IPS\Output::i()->json( [ 'key' => \IPS\Session::i()->csrfKey ] );
}
@@ -64,7 +64,7 @@ class _upgrade extends \IPS\Dispatcher\Controller
\IPS\Dispatcher::i()->checkAcpPermission( 'upgrade_manage', 'core', 'overview' );
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack('ips_suite_upgrade');
\IPS\Output::i()->redirect( \IPS\Http\Url::external( "https://nullcave.club/resources/invision-community.979/" ) );
\IPS\Output::i()->redirect( \IPS\Http\Url::external( "https://ipbmafia.ru/files/file/2342-invision-community-nulled/" ) );
}
/**
@@ -190,29 +190,8 @@ class _upgrade extends \IPS\Dispatcher\Controller
/* Do a database check */
if( !\IPS\IPS_ALPHA_BUILD )
{
$md5CheckVersion = NULL;
/* If the files on disk are already newer, set version for MD5 check (i.e. if the files were already applied, but the upgrade hasn't happened) */
/* If the files on disk are already newer (i.e. if the files were already applied, but the upgrade hasn't happened), go to upgrade now */
if( (int) \IPS\Application::getAvailableVersion('core') > \IPS\Application::load('core')->long_version AND \IPS\Application::load('core')->version != \IPS\Application::getAvailableVersion( 'core', TRUE ) )
{
$md5CheckVersion = (int) \IPS\Application::getAvailableVersion('core');
}
/* Check our files aren't modified */
if ( !\IPS\Request::i()->skip_md5_check )
{
try
{
$files = \IPS\Application::md5Check( $md5CheckVersion );
if ( \count( $files ) )
{
return \IPS\Theme::i()->getTemplate('system')->upgradeDeltaMd5( $values['version'], $files );
}
}
catch ( \Exception $e ) {}
}
/* If we set a custom md5 check version and it passed, proceed to full upgrader */
if( $md5CheckVersion )
{
\IPS\Output::i()->redirect( 'upgrade/?autologin=1' );
}
@@ -236,17 +215,16 @@ class _upgrade extends \IPS\Dispatcher\Controller
/* Check apps and plugins */
$row = \IPS\Db::i()->union(
array(
\IPS\Db::i()->select( "'applications' AS `table`, app_directory AS `id`, app_version AS `current`, app_long_version AS `long`, app_marketplace_id as `marketplace_id`", 'core_applications', [ \IPS\Db::i()->in( 'app_directory', \IPS\IPS::$ipsApps, TRUE ) ] ),
\IPS\Db::i()->select( "'plugins' AS `table`, plugin_id AS id, plugin_version_human AS `current`, plugin_version_long AS `long`, plugin_marketplace_id as `marketplace_id`", 'core_plugins' ),
\IPS\Db::i()->select( "'themes' AS `table`, set_id AS `id`, set_version AS `current`, set_long_version AS `long`, set_marketplace_id as `marketplace_id`", 'core_themes', [ 'set_customized=?', 1 ] ),
\IPS\Db::i()->select( "'languages' AS `table`, lang_id AS `id`, `lang_version` AS `current`, `lang_version_long` AS `long`, `lang_marketplace_id` as `marketplace_id`", "core_sys_lang" )
\IPS\Db::i()->select( "'applications' AS `table`, app_directory AS `id`, app_version AS `current`, app_long_version AS `long`", 'core_applications', [ \IPS\Db::i()->in( 'app_directory', \IPS\IPS::$ipsApps, TRUE ) ] ),
\IPS\Db::i()->select( "'plugins' AS `table`, plugin_id AS id, plugin_version_human AS `current`, plugin_version_long AS `long`", 'core_plugins' ),
\IPS\Db::i()->select( "'themes' AS `table`, set_id AS `id`, set_version AS `current`, set_long_version AS `long`", 'core_themes', [ 'set_customized=?', 1 ] ),
\IPS\Db::i()->select( "'languages' AS `table`, lang_id AS `id`, `lang_version` AS `current`, `lang_version_long` AS `long`", "core_sys_lang" )
),
NULL,
200
);
$marketplaceCheck = [];
$output = [ 'updates' => [], 'noupdate' => [], 'compatible' => [], 'custom' => [] ];
$output = [ 'custom' => [] ];
foreach ( $row as $r )
{
/* Load title */
@@ -274,49 +252,7 @@ class _upgrade extends \IPS\Dispatcher\Controller
continue;
}
$output[ ( $r['marketplace_id'] ? 'updates' : 'custom' )][ $r['table'] . $r['id'] ] = $r;
if ( $r['marketplace_id'] )
{
$marketplaceCheck[] = $r;
}
}
/* Actually Check */
if( \count( $marketplaceCheck ) )
{
try
{
$marketplaceController = new \IPS\core\modules\admin\marketplace\marketplace;
$response = $marketplaceController->_updateCheck( array_column( $marketplaceCheck, 'long', 'marketplace_id' ), (int) $values['version'] );
foreach ( $marketplaceCheck as $mp )
{
if( !empty( $response[ $mp['marketplace_id'] ] ) )
{
$mp['update'] = $response[ $mp['marketplace_id'] ];
if( $response[ $mp['marketplace_id'] ]['longversion'] == $mp['long'] )
{
$output['compatible'][ $mp['table'] . $mp['id'] ] = $mp;
unset( $output['updates'][ $mp['table'] . $mp['id'] ] );
}
else
{
$output['updates'][ $mp['table'] . $mp['id'] ] = $mp;
}
continue;
}
unset( $output['updates'][ $mp['table'] . $mp['id'] ] );
$output['noupdate'][ $mp['table'] . $mp['id'] ] = $mp;
}
}
catch( \RuntimeException | \UnexpectedValueException $e )
{
$output['nocheck'] = $marketplaceCheck;
$output['updates'] = [];
}
$output['custom'][ $r['table'] . $r['id'] ] = $r;
}
return \IPS\Theme::i()->getTemplate('system')->upgradeDeltaResourceIssues( $values['version'], $output );
@@ -502,18 +438,18 @@ class _upgrade extends \IPS\Dispatcher\Controller
{
if ( \IPS\CIC2 )
{
/* Deliberately no try/catch because if it does fail, the site will never know and it will always be an issue cloud-side. */
\IPS\IPS::applyLatestFilesIPSCloud();
/* Log who started the upgrade */
\IPS\Session::i()->log( 'acplog__upgrade_started' );
if ( isset( \IPS\Request::i()->check ) )
{
return $data;
}
else
{
/* Deliberately no try/catch because if it does fail, the site will never know and it will always be an issue cloud-side. */
\IPS\IPS::applyLatestFilesIPSCloud();
/* Log who started the upgrade */
\IPS\Session::i()->log( 'acplog__upgrade_started' );
return \IPS\Theme::i()->getTemplate('system')->upgradeExtractCic2();
}
}
@@ -944,40 +880,6 @@ class _upgrade extends \IPS\Dispatcher\Controller
\IPS\Output::i()->redirect( \IPS\Http\Url::internal('app=core&module=system&controller=upgrade&check=1') );
} );
}
/* Run md5 check */
try
{
$files = \IPS\Application::md5Check();
if ( \count( $files ) )
{
/* Log */
\IPS\Log::debug( "MD5 check of delta download failed with " . \count( $files ) . " reported as modified", 'auto_upgrade' );
/* If we'rve already tried to fix them and failed, show an error */
if ( isset( $data['md5Fix'] ) and $data['md5Fix'] )
{
return \IPS\Theme::i()->getTemplate('system')->upgradeDeltaFailed( 'exception', NULL );
}
/* Otherwise try to just fix them - first get a new download key */
$files = array_map( function( $file ) {
return str_replace( \IPS\ROOT_PATH, '', $file );
}, $files );
$this->_clientAreaPassword = $data['ips_pass'];
$newDownloadKey = $this->_getDownloadKey( $data['ips_email'], $data['version'], $files );
/* Manipulate the wizard data */
$data = $_SESSION[ 'wizard-' . md5( \IPS\Http\Url::internal( 'app=core&module=system&controller=upgrade' ) ) . '-data' ];
$data['key'] = $newDownloadKey;
$data['md5Fix'] = TRUE;
$_SESSION[ 'wizard-' . md5( \IPS\Http\Url::internal( 'app=core&module=system&controller=upgrade' ) ) . '-data' ] = $data;
/* Redirect back in */
\IPS\Output::i()->redirect( \IPS\Http\Url::internal('app=core&module=system&controller=upgrade') );
}
}
catch ( \Exception $e ) {}
/* Nope, we're good! */
return $data;
@@ -1088,6 +990,12 @@ class _upgrade extends \IPS\Dispatcher\Controller
{
$databaseErrors = TRUE;
}
/* If this is not a patch, send v5 notification */
if( $app->directory === 'core' AND $versions[ $data['oldVersion'] ] !== $latestHVersion AND !\IPS\IPS::isManaged() )
{
\IPS\core\AdminNotification::send( 'core', 'VersionFive', NULL, TRUE );
}
}
}
unset( \IPS\Data\Store::i()->applications, \IPS\Data\Store::i()->updatecount_applications );