Version 4.7.6

This commit is contained in:
Neo committed 2025-12-19 16:05:19 -08:00
1 parent 8ba7d43898
commit 7b7404e741
1085 files changed
+30590 -7837

No files matched your search

+3 -30
View File
@@ -729,7 +729,7 @@ class _Output
$faulty = \IPS\Member::loggedIn()->language()->addToStack( 'faulty_app', FALSE, array( 'sprintf' => array( $app->_title, \IPS\Http\Url::internal( 'app=core&module=applications&controller=applications', 'admin' ) ) ) );
}
}
/* Send default Cache Headers if this is a front-end page. */
$allowGuestCache = FALSE;
if ( !isset( $httpHeaders['Cache-Control'] ) AND ( $httpStatusCode == 404 OR $httpStatusCode == 403 ) )
@@ -737,13 +737,12 @@ class _Output
if ( \IPS\CACHE_PAGE_TIMEOUT AND $this->pageCaching AND \IPS\Dispatcher::hasInstance() AND \IPS\Dispatcher::i()->controllerLocation === 'front' AND !\IPS\Member::loggedIn()->member_id )
{
$httpHeaders += static::getCacheHeaders( time(), \IPS\CACHE_PAGE_TIMEOUT );
$allowGuestCache = TRUE;
}
}
/* Send output */
\IPS\Output::i()->sidebar['enabled'] = FALSE;
$this->sendOutput( \IPS\Theme::i()->getTemplate( 'global', 'core' )->globalTemplate( $title, \IPS\Theme::i()->getTemplate( 'global', 'core' )->error( $title, $message, $code, $extra, $member, $faulty, $httpStatusCode ), array( 'app' => \IPS\Dispatcher::i()->application ? \IPS\Dispatcher::i()->application->directory : NULL, 'module' => \IPS\Dispatcher::i()->module ? \IPS\Dispatcher::i()->module->key : NULL, 'controller' => \IPS\Dispatcher::i()->controller ) ), $httpStatusCode, 'text/html', $httpHeaders, $allowGuestCache, FALSE );
$this->sendOutput( \IPS\Theme::i()->getTemplate( 'global', 'core' )->globalTemplate( $title, \IPS\Theme::i()->getTemplate( 'global', 'core' )->error( $title, $message, $code, $extra, $member, $faulty, $httpStatusCode ), array( 'app' => \IPS\Dispatcher::i()->application ? \IPS\Dispatcher::i()->application->directory : NULL, 'module' => \IPS\Dispatcher::i()->module ? \IPS\Dispatcher::i()->module->key : NULL, 'controller' => \IPS\Dispatcher::i()->controller ) ), $httpStatusCode, 'text/html', $httpHeaders, FALSE, FALSE );
}
/**
@@ -833,16 +832,6 @@ class _Output
$output = $this->replaceEmojiWithImages( $output );
}
/* Do we want to preload anything? Only send preload headers for full page requests with a text/html response that have output. */
if( !$pageIsCached AND !\IPS\IN_DEV AND $output AND !\IPS\Request::i()->isAjax() AND $contentType == 'text/html' )
{
if( $urls = $this->getPreloadUrls() AND \count( $urls ) )
{
/* Send a link header for preloading */
//$httpHeaders['Link'] = implode( ', ', $urls );
}
}
/* Combine some common checks for re-use */
$canCache = function( $contentType, $obj ) {
if( $obj->pageCaching and
@@ -856,7 +845,6 @@ class _Output
return FALSE;
};
/* Full page caching for guests */
if (
\IPS\CACHE_PAGE_TIMEOUT and // Page caching is enabled
$cacheThisPage and // Some pages can specify not to be cached (for example, when displaying a cached page, you don't want it recached)
@@ -865,21 +853,6 @@ class _Output
!isset( \IPS\Request::i()->csrfKey ) and // CSRF key isn't present (which would be like a POST request)
!\IPS\Member::loggedIn()->member_id // User is not logged in
) {
/* Store copy of cached page if output caching is enabled */
if( !empty( \IPS\OUTPUT_CACHE_METHOD ) AND \IPS\OUTPUT_CACHE_METHOD !== 'None' )
{
$theme = isset( \IPS\Request::i()->cookie['theme'] ) ? \IPS\Request::i()->cookie['theme'] : '';
\IPS\Output\Cache::i()->set( 'page_' . md5( (string) \IPS\Request::i()->url() ) . '_' . \IPS\Member::loggedIn()->language()->id . '_' . $theme,
str_replace( \IPS\Session::i()->csrfKey, '{{csrfKey}}', $output ),
array(
'code' => $httpStatusCode,
'contentType' => $contentType,
'httpHeaders' => array_merge( $httpHeaders, array( 'X-IPS-Cached-Response' => \IPS\DateTime::create()->rfc1123() ) ),
'lastUpdated' => time()
), \IPS\DateTime::create()->add( new \DateInterval( 'PT' . \IPS\CACHE_PAGE_TIMEOUT . 'S' ) ), TRUE );
}
/* Add caching headers */
if( !isset( $httpHeaders['Cache-Control'] ) )
{
@@ -1278,7 +1251,7 @@ class _Output
$image = str_replace( '00', '', $image );
}
return '<img src="https://twemoji.maxcdn.com/2/72x72/' . $image . '.png" class="ipsEmoji" alt="' . $matches[1] . '">';
return '<img src="https://cdn.jsdelivr.net/gh/twitter/twemoji@14.0.2/assets/72x72/' . $image . '.png" class="ipsEmoji" alt="' . $matches[1] . '">';
}, $output );
}
return $output;