Version 5.0.0 beta 4

This commit is contained in:
Neo committed 2025-12-19 16:57:00 -08:00
1 parent e86153356a
commit 2f24f9de48
276 files changed
+8614 -6044

No files matched your search

+29 -1
View File
@@ -86,6 +86,11 @@ class Front extends Standard
*/
protected ?string $_controller = NULL;
/**
* @var int|null $currentPage
*/
public int|null $currentPage = null;
/**
* Init
*
@@ -109,7 +114,7 @@ class Front extends Standard
header( "{$headerKey}: {$headerValue}" );
}
if ( CIC and ! Session::loggedIn() and ! Session::i()->userAgent->spider )
if ( CIC and ! Session::loggedIn() and ! Session::i()->userAgent->bot )
{
/* The software is unavailable, but the site is up so we do not want to affect our cloud downtime statistics and trigger monitoring alarms
if we are not a search engine */
@@ -140,6 +145,16 @@ class Front extends Standard
/* Base JS */
static::baseJs();
/* Get the current page, if any */
if ( isset( Request::i()->page ) )
{
$this->currentPage = Request::i()->page;
}
else if ( isset( Request::i()->url()->hiddenQueryString['page'] ) and $page = Request::i()->url()->hiddenQueryString['page'] )
{
$this->currentPage = $page;
}
/* Check friendly URL and whether it is correct */
try
{
@@ -159,6 +174,19 @@ class Front extends Standard
Output::i()->error( 'requested_route_404', '1S160/2', 404, '' );
}
/* Check if we're a low quality (no search engine bot) user */
if ( ! Member::loggedIn()->member_id and \IPS\Session\Front::i()->userAgent->isLowValue() )
{
/* We want to restrict the number of 301s low quality bots get */
foreach( [ 'findComment', 'findReview', 'getNewComment', 'getLastComment'] as $do )
{
if ( isset( Request::i()->do ) and Request::i()->do === $do ) // baby shark
{
unset( Request::i()->do );
}
}
}
/* Run global init */
try
{