Version 4.2.0
This commit is contained in:
1 parent
0dc2aee5ed
commit
96997ddd8e
2074 files changed
+125454
-55780
No files matched your search
+33
-13
@@ -1,12 +1,11 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief HTTP Request Class
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Community Suite
|
||||
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) Invision Power Services, Inc.
|
||||
* @license https://www.invisioncommunity.com/legal/standards/
|
||||
* @package Invision Community
|
||||
* @since 18 Feb 2013
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS;
|
||||
@@ -107,7 +106,7 @@ class _Request extends \IPS\Patterns\Singleton
|
||||
*
|
||||
* @param mixed $v Value
|
||||
* @param mixed $k Key
|
||||
* @return mixed
|
||||
* @return void
|
||||
*/
|
||||
protected function clean( &$v, $k )
|
||||
{
|
||||
@@ -166,9 +165,7 @@ class _Request extends \IPS\Patterns\Singleton
|
||||
* Is this an SSL/Secure request?
|
||||
*
|
||||
* @return bool
|
||||
* @see <a href='http://community.invisionpower.com/resources/bugs.html/_/ip-board/ipboard-cant-detect-https-if-behind-an-ssl-terminating-load-balancer-r42909'>Load balancer SSL</a>
|
||||
* @note A common technique to check for SSL is to look for $_SERVER['SERVER_PORT'] == 443, however this is not a correct check. Nothing requires SSL to be on port 443, or http to be on port 80.
|
||||
* @see <a href='http://community.invisionpower.com/resources/bugs.html/_/ips-4-0/ipsrequestissecure-r45082'>Zeus load balancers set HTTP_SSLSESSIONID</a>
|
||||
*/
|
||||
public function isSecure()
|
||||
{
|
||||
@@ -218,7 +215,12 @@ class _Request extends \IPS\Patterns\Singleton
|
||||
$url = $this->isSecure() ? 'https' : 'http';
|
||||
$url .= '://';
|
||||
|
||||
if ( !empty( $_SERVER['HTTP_X_FORWARDED_HOST'] ) )
|
||||
/* 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 ( !empty( $_SERVER['HTTP_X_FORWARDED_SERVER'] ) )
|
||||
{
|
||||
$url .= $_SERVER['HTTP_X_FORWARDED_SERVER'];
|
||||
}
|
||||
elseif ( !empty( $_SERVER['HTTP_X_FORWARDED_HOST'] ) )
|
||||
{
|
||||
$url .= $_SERVER['HTTP_X_FORWARDED_HOST'];
|
||||
}
|
||||
@@ -334,7 +336,7 @@ class _Request extends \IPS\Patterns\Singleton
|
||||
/**
|
||||
* Returns the cookie path
|
||||
*
|
||||
* @return string|void
|
||||
* @return string
|
||||
*/
|
||||
public static function getCookiePath()
|
||||
{
|
||||
@@ -394,6 +396,24 @@ class _Request extends \IPS\Patterns\Singleton
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear login cookies
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function clearLoginCookies()
|
||||
{
|
||||
$this->setCookie( 'member_id', NULL );
|
||||
$this->setCookie( 'login_key', NULL );
|
||||
foreach( $this->cookie as $name => $value )
|
||||
{
|
||||
if( mb_strpos( $name, "ipbforumpass_" ) !== FALSE )
|
||||
{
|
||||
$this->setCookie( $name, NULL );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Editor autosave keys to be cleared
|
||||
*/
|
||||
@@ -414,7 +434,7 @@ class _Request extends \IPS\Patterns\Singleton
|
||||
/**
|
||||
* Returns the request method
|
||||
*
|
||||
* @return boolean
|
||||
* @return string
|
||||
*/
|
||||
public function requestMethod()
|
||||
{
|
||||
@@ -461,7 +481,7 @@ class _Request extends \IPS\Patterns\Singleton
|
||||
* Is PHP running as CGI?
|
||||
*
|
||||
* @note Possible values: cgi, cgi-fcgi, fpm-fcgi
|
||||
* @return boolean
|
||||
* @return boolean
|
||||
*/
|
||||
public function isCgi()
|
||||
{
|
||||
@@ -479,7 +499,7 @@ 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
|
||||
* @return void
|
||||
* @return bool
|
||||
*/
|
||||
public function confirmedDelete( $title = 'delete_confirm', $message = 'delete_confirm_detail', $submit = 'delete' )
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user