Version 5.0.0 beta 1
This commit is contained in:
1 parent
25ddeb65d6
commit
15c7beabc5
6736 files changed
+627902
-497943
No files matched your search
@@ -11,37 +11,46 @@
|
||||
namespace IPS\core\modules\setup\upgrade;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
|
||||
use IPS\Db;
|
||||
use IPS\Dispatcher\Controller;
|
||||
use IPS\Http\Url;
|
||||
use IPS\Output;
|
||||
use UnderflowException;
|
||||
use function defined;
|
||||
use function is_array;
|
||||
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
header( ( $_SERVER['SERVER_PROTOCOL'] ?? 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Upgrader: Continue Upgrade
|
||||
*/
|
||||
class _continueupgrade extends \IPS\Dispatcher\Controller
|
||||
class continueupgrade extends Controller
|
||||
{
|
||||
/**
|
||||
* Show Form
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function manage()
|
||||
public function manage() : void
|
||||
{
|
||||
/* Best check for the upgrade file first */
|
||||
try
|
||||
{
|
||||
$json = json_decode( \IPS\Db::i()->select( 'upgrade_data', 'upgrade_temp' )->first(), TRUE );
|
||||
$json = json_decode( Db::i()->select( 'upgrade_data', 'upgrade_temp' )->first(), TRUE );
|
||||
}
|
||||
catch( \UnderflowException $e )
|
||||
catch( UnderflowException $e )
|
||||
{
|
||||
$json = NULL;
|
||||
}
|
||||
|
||||
if ( \is_array( $json ) and isset( $json['session'] ) and isset( $json['data'] ) )
|
||||
if ( is_array( $json ) and isset( $json['session'] ) and isset( $json['data'] ) )
|
||||
{
|
||||
$url = \IPS\Http\Url::internal( "controller=upgrade" )->setQueryString( 'key', $_SESSION['uniqueKey'] );
|
||||
$url = Url::internal( "controller=upgrade" )->setQueryString( 'key', $_SESSION['uniqueKey'] );
|
||||
|
||||
/* Update session */
|
||||
foreach( $json['session'] as $k => $v )
|
||||
@@ -54,11 +63,11 @@ class _continueupgrade extends \IPS\Dispatcher\Controller
|
||||
|
||||
/* Populate the MR data */
|
||||
$_SESSION[ 'mr-' . md5( $url ) ] = json_encode( $json['data'] );
|
||||
\IPS\Output::i()->redirect( $url );
|
||||
Output::i()->redirect( $url );
|
||||
}
|
||||
else
|
||||
{
|
||||
\IPS\Output::i()->error( 'cannot_continue_upgrade', '', 403, '' );
|
||||
Output::i()->error( 'cannot_continue_upgrade', '', 403, '' );
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user