Version 5.0.6

This commit is contained in:
Neo committed 2025-12-19 18:55:49 -08:00
1 parent a3a4a9ccbd
commit b89858b2ff
1214 files changed
+92828 -14859

No files matched your search

+39 -20
View File
@@ -162,6 +162,13 @@ class Front extends Standard
}
catch( OutOfRangeException $e )
{
/* If we have the converter app, check for redirects */
if( Application::appIsEnabled('convert') )
{
$application = Application::load( 'convert' );
$application::checkRedirects();
}
/* Display a 404 */
$this->application = Application::load('core');
$this->setDefaultModule();
@@ -174,6 +181,19 @@ class Front extends Standard
Output::i()->error( 'requested_route_404', '1S160/2', 404, '' );
}
/* Loader extension */
foreach( Application::allExtensions( 'core', 'Loader' ) as $loader )
{
foreach( $loader->js() as $js )
{
Output::i()->jsFiles = array_merge( Output::i()->jsFiles, $js );
}
foreach( $loader->css() as $css )
{
Output::i()->cssFiles = array_merge( Output::i()->cssFiles, $css );
}
}
/* Check if we're a low quality (no search engine bot) user */
if ( ! Member::loggedIn()->member_id and \IPS\Session\Front::i()->userAgent->isLowValue() )
{
@@ -798,10 +818,14 @@ class Front extends Standard
*/
protected function adsTxt() : void
{
if ( Settings::i()->ads_txt_enabled )
if ( (int) Settings::i()->ads_txt_enabled == 1 )
{
Output::i()->sendOutput( Settings::i()->ads_txt, 200, 'text/plain' );
}
elseif( (int) Settings::i()->ads_txt_enabled == 2 AND !empty( Settings::i()->ads_txt_redirect_url ) )
{
Output::i()->redirect( Url::external( Settings::i()->ads_txt_redirect_url ) );
}
throw new OutOfRangeException;
}
/**
@@ -841,6 +865,9 @@ Disallow: {$path}*ref=
Disallow: {$path}*?forumId*
Disallow: {$path}*?&controller=embed
# Block CDN endpoints
Disallow: /cdn-cgi/
# Sitemap URL
Sitemap: {$sitemapUrl}
FILE;
@@ -868,6 +895,10 @@ FILE;
Output::i()->jsFiles = array_merge( Output::i()->jsFiles, Output::i()->js( 'front.js' ) );
Output::i()->jsFiles = array_merge( Output::i()->jsFiles, Output::i()->js( 'front_core.js', 'core', 'front' ) );
if(Theme::i()->getLayoutValue( 'global_view_mode' ) == 'default' ){
Output::i()->jsFiles = array_merge( Output::i()->jsFiles, Output::i()->js( 'static/ui/navigationMoreMenu.js', 'core', 'interface' ) );
}
/* Can we edit widget layouts? */
if( Member::loggedIn()->modPermission('can_manage_sidebar') )
{
@@ -880,15 +911,6 @@ FILE;
{
Output::i()->jsFiles = array_merge( Output::i()->jsFiles, Output::i()->js( 'front_system.js', 'core', 'front' ) );
}
/* Loader extension */
foreach( Application::allExtensions( 'core', 'Loader' ) as $loader )
{
foreach( $loader->js() as $js )
{
Output::i()->jsFiles = array_merge( Output::i()->jsFiles, $js );
}
}
}
}
@@ -921,15 +943,6 @@ FILE;
{
Output::i()->cssFiles = array_merge( Output::i()->cssFiles, Theme::i()->css( 'styles/caching_log.css', 'core', 'front' ) );
}
/* Loader extension */
foreach( Application::allExtensions( 'core', 'Loader' ) as $loader )
{
foreach( $loader->css() as $css )
{
Output::i()->cssFiles = array_merge( Output::i()->cssFiles, $css );
}
}
}
}
@@ -964,8 +977,14 @@ FILE;
return;
}
/* If a member is forced to reset their password, let them */
if( Member::loggedIn()->members_bitoptions['password_reset_forced'] AND !Member::loggedIn()->members_pass_hash )
{
return;
}
/* Don't get in the way of the ModCP, registering, logging in, etc */
$ignoreControllers = [ 'modcp', 'register', 'login', 'redirect', 'cookie' ];
$ignoreControllers = [ 'modcp', 'register', 'login', 'redirect', 'cookies', 'lostpass' ];
if( !Request::i()->isAjax() and !in_array( $this->controller, $ignoreControllers ) AND $alert = Alert::getNextAlertForMember( Member::loggedIn() ) )
{
$alert->viewed( Member::loggedIn() );