Version 5.0.13

This commit is contained in:
Neo committed 2025-12-19 19:04:57 -08:00
1 parent b89858b2ff
commit 5efe744c5f
1407 files changed
+69690 -30177

No files matched your search

+20 -5
View File
@@ -184,6 +184,16 @@ class Request extends Singleton
return ( isset( $_SERVER['HTTP_X_REQUESTED_WITH'] ) and $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest' );
}
/**
* Should we bypass the ajax redirect system? By default ,ajax redirects send a JSON to the browser, and ips JS redirects the entire page
*
* @return bool
*/
public function bypassAjaxRedirect() : bool
{
return boolval( isset( $_SERVER['HTTP_X_BYPASS_AJAX_REDIRECT'] ) and $_SERVER['HTTP_X_BYPASS_AJAX_REDIRECT'] );
}
/**
* Is this an SSL/Secure request?
*
@@ -237,9 +247,9 @@ class Request extends Singleton
$url = $this->isSecure() ? 'https' : 'http';
$url .= '://';
$ruleMatched = FALSE;
/* Nginx uses HTTP_X_FORWARDED_SERVER. @see <a href='https://plone.lucidsolutions.co.nz/web/reverseproxyandcache/setting-nginx-http-x-forward-headers-for-reverse-proxy'>Nginx Reverse Proxy</a> */
if ( !CIC )
if ( !CIC OR \IPS\IN_DEV ) // We may also need this for Ngrok testing
{
if ( !empty( $_SERVER['HTTP_X_FORWARDED_SERVER'] ) )
{
@@ -479,9 +489,14 @@ class Request extends Singleton
/* Check wildcard cookies */
foreach( static::getEssentialCookies() as $c )
{
if( mb_substr( $c, -1, 1 ) === '*' AND rtrim( $name, '*' ) === $name )
if ( str_ends_with($c, '*' ) )
{
return FALSE;
$prefix = mb_substr($c, 0, -1);
if( str_starts_with($name, $prefix ) )
{
return false;
}
}
}
@@ -610,7 +625,7 @@ class Request extends Singleton
*/
public static function isCliEnvironment(): bool
{
return php_sapi_name() == 'cli';
return ( php_sapi_name() == 'cli' or ( defined( 'IS_CLI' ) and IS_CLI === true ) );
}
/**