Version 4.7.0

This commit is contained in:
Neo committed 2025-12-19 16:00:35 -08:00
1 parent 517a5e1f70
commit 8ba7d43898
1933 files changed
+65613 -11332

No files matched your search

+25 -7
View File
@@ -177,11 +177,12 @@ class _Request extends \IPS\Patterns\Singleton
/**
* Is this request from the mobile app?
*
* @deprecated 4.6.11 - Will be removed in future version
* @return bool
*/
public function isApp()
{
return isset( $_SERVER['HTTP_X_IPS_APP'] );
return FALSE;
}
/**
@@ -525,9 +526,10 @@ class _Request extends \IPS\Patterns\Singleton
* @param string $title Lang string key for title
* @param string $message Lang string key for confirm message
* @param string $submit Lang string key for submit button
* @param string $css CSS classes for the message
* @return bool
*/
public function confirmedDelete( $title = 'delete_confirm', $message = 'delete_confirm_detail', $submit = 'delete' )
public function confirmedDelete( $title = 'delete_confirm', $message = 'delete_confirm_detail', $submit = 'delete', string $css = 'ipsMessage ipsMessage_warning' )
{
/* The confirmation dialogs will send form_submitted=1, as will displaying a form, so we check for this.
If the admin (or user) simply visited a delete URL directly, this would not be included in the request. */
@@ -535,12 +537,21 @@ class _Request extends \IPS\Patterns\Singleton
{
$form = new \IPS\Helpers\Form( 'form', $submit );
$form->hiddenValues['wasConfirmed'] = 1;
$form->addMessage( $message, 'ipsMessage ipsMessage_warning' );
$form->class = 'ipsForm_vertical';
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack( $title );
/* We call sendOutput() to show the form now */
\IPS\Output::i()->output = $form;
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack( $title );
if( \IPS\Dispatcher::hasInstance() and \IPS\Dispatcher::i()->controllerLocation === 'front' )
{
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'global', 'core' )->confirmDelete( $message, $form, $title );
}
else
{
$form->addMessage( $message, $css);
\IPS\Output::i()->output = $form;
}
if ( \IPS\Request::i()->isAjax() )
{
\IPS\Output::i()->sendOutput( \IPS\Theme::i()->getTemplate( 'global', 'core', 'front' )->genericBlock( $form, \IPS\Output::i()->title ), 200, 'text/html' );
@@ -617,6 +628,12 @@ class _Request extends \IPS\Patterns\Singleton
/* Failed to create? Nope. */
return NULL;
}
/* Exclude Service Worker */
if( isset( $ref->queryString['app'] ) AND $ref->queryString['app'] == 'core' AND $ref->queryString['controller'] == 'serviceworker' )
{
return NULL;
}
/* Return if URL is internal and not an open redirect, or if we're allowing external referrer references */
if ( ( ( $ref instanceof \IPS\Http\Url\Internal ) AND !$ref->openRedirect() ) OR $allowExternal )
@@ -676,7 +693,8 @@ class _Request extends \IPS\Patterns\Singleton
$authorizationHeader = NULL;
foreach ( $_SERVER as $k => $v )
{
if ( mb_substr( $k, -18 ) == 'HTTP_AUTHORIZATION' or mb_substr( $k, -20 ) == 'HTTP_X_AUTHORIZATION' )
// There could be more than one header with such suffix ( ( REDIRECT_HTTP_AUTHORIZATION + REDIRECT_REDIRECT_HTTP_AUTHORIZATION ) ) , so let's search for one with a value
if ( ( mb_substr( $k, -18 ) == 'HTTP_AUTHORIZATION' or mb_substr( $k, -20 ) == 'HTTP_X_AUTHORIZATION' ) AND $v !== '' )
{
return $v;
}