Version 4.5.0
This commit is contained in:
1 parent
1a0c7fd3c2
commit
f79dcf067a
3791 files changed
+248032
-76372
No files matched your search
@@ -11,7 +11,7 @@
|
||||
namespace IPS;
|
||||
|
||||
/* 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;
|
||||
@@ -47,7 +47,7 @@ abstract class _Dispatcher
|
||||
{
|
||||
if( static::$instance === NULL )
|
||||
{
|
||||
$class = get_called_class();
|
||||
$class = \get_called_class();
|
||||
|
||||
if( $class == 'IPS\\Dispatcher' )
|
||||
{
|
||||
@@ -59,14 +59,14 @@ abstract class _Dispatcher
|
||||
if( static::$instance->controllerLocation != 'setup' )
|
||||
{
|
||||
$_redirect = FALSE;
|
||||
|
||||
if ( !file_exists( \IPS\ROOT_PATH . '/conf_global.php' ) )
|
||||
|
||||
if ( !file_exists( \IPS\SITE_FILES_PATH . '/conf_global.php' ) )
|
||||
{
|
||||
$_redirect = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
require \IPS\ROOT_PATH . '/conf_global.php';
|
||||
require \IPS\SITE_FILES_PATH . '/conf_global.php';
|
||||
|
||||
if( !isset( $INFO['sql_database'] ) )
|
||||
{
|
||||
@@ -94,9 +94,15 @@ abstract class _Dispatcher
|
||||
|
||||
if( $_redirect === TRUE )
|
||||
{
|
||||
/* conf_global.php does not exist, forward to installer */
|
||||
$url = ( \IPS\Request::i()->isSecure() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . rtrim( dirname( $_SERVER['SCRIPT_NAME'] ), '/' );
|
||||
\IPS\Output::i()->redirect( "{$url}/" . \IPS\CP_DIRECTORY . "/install/" );
|
||||
/* conf_global.php does not exist, forward to installer - we'll do this manually to avoid any code in Output.php that anticipates the installation already being complete (such as setting CSP header in __construct()) */
|
||||
$url = ( \IPS\Request::i()->isSecure() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . rtrim( \dirname( $_SERVER['SCRIPT_NAME'] ), '/' );
|
||||
|
||||
header( "HTTP/1.1 307 Temporary Redirect" );
|
||||
header( "Cache-Control: no-cache, no-store, must-revalidate" );
|
||||
header( "Pragma: no-cache" );
|
||||
header( "Expires: 0" );
|
||||
header( "Location: {$url}/" . \IPS\CP_DIRECTORY . "/install/" );
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -107,12 +113,12 @@ abstract class _Dispatcher
|
||||
}
|
||||
|
||||
/**
|
||||
* Controller Classname
|
||||
* @brief Controller Classname
|
||||
*/
|
||||
protected $classname;
|
||||
|
||||
/**
|
||||
* Controller instance
|
||||
* @brief Controller instance
|
||||
*/
|
||||
public $dispatcherController;
|
||||
|
||||
@@ -158,12 +164,12 @@ abstract class _Dispatcher
|
||||
/* If we're still here - output */
|
||||
if ( \IPS\Request::i()->isAjax() )
|
||||
{
|
||||
\IPS\Output::i()->sendOutput( \IPS\Theme::i()->getTemplate( 'global', 'core' )->blankTemplate( \IPS\Output::i()->output ), 200, 'text/html', \IPS\Output::i()->httpHeaders );
|
||||
\IPS\Output::i()->sendOutput( \IPS\Theme::i()->getTemplate( 'global', 'core' )->blankTemplate( \IPS\Output::i()->output ), 200, 'text/html' );
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Just prefetch this to save a query later */
|
||||
\IPS\Output::i()->sendOutput( \IPS\Theme::i()->getTemplate( 'global', 'core' )->globalTemplate( \IPS\Output::i()->title, \IPS\Output::i()->output, array( 'app' => \IPS\Dispatcher::i()->application->directory, 'module' => \IPS\Dispatcher::i()->module->key, 'controller' => \IPS\Dispatcher::i()->controller ) ), 200, 'text/html', \IPS\Output::i()->httpHeaders );
|
||||
\IPS\Output::i()->sendOutput( \IPS\Theme::i()->getTemplate( 'global', 'core' )->globalTemplate( \IPS\Output::i()->title, \IPS\Output::i()->output, array( 'app' => \IPS\Dispatcher::i()->application->directory, 'module' => \IPS\Dispatcher::i()->module->key, 'controller' => \IPS\Dispatcher::i()->controller ) ), 200, 'text/html' );
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user