8000 [HttpFoundation] reverted variable rename · symfony/symfony@9ce892c · GitHub
[go: up one dir, main page]

Skip to content

Commit 9ce892c

Browse files
committed
[HttpFoundation] reverted variable rename
1 parent e5536f0 commit 9ce892c

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/Symfony/Component/HttpFoundation/Request.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class Request
2525
const HEADER_CLIENT_PROTO = 'client_proto';
2626
const HEADER_CLIENT_PORT = 'client_port';
2727

28-
protected static $trustProxyData = false;
28+
protected static $trustProxy = false;
2929

3030
protected static $trustedProxies = array();
3131

@@ -382,7 +382,7 @@ public function overrideGlobals()
382382
*/
383383
public static function trustProxyData()
384384
{
385-
self::$trustProxyData = true;
385+
self::$trustProxy = true;
386386
}
387387

388388
/**
@@ -397,7 +397,7 @@ public static function trustProxyData()
397397
public static function setTrustedProxies(array $proxies)
398398
{
399399
self::$trustedProxies = $proxies;
400-
self::$trustProxyData = $proxies ? true : false;
400+
self::$trustProxy = $proxies ? true : false;
401401
}
402402

403403
/**
@@ -522,7 +522,7 @@ public function getClientIp($proxy = false)
522522
{
523523
$ip = $this->server->get('REMOTE_ADDR');
524524

525-
if (!$proxy && !self::$trustProxyData) {
525+
if (!$proxy && !self::$trustProxy) {
526526
return $ip;
527527
}
528528

@@ -533,7 +533,7 @@ public function getClientIp($proxy = false)
533533
$clientIps = array_map('trim', explode(',', $this->headers->get(self::$trustedHeaders[self::HEADER_CLIENT_IP])));
534534
$clientIps[] = $ip;
535535

536-
$trustedProxies = ($proxy || self::$trustProxyData) && !self::$trustedProxies ? array($ip) : self::$trustedProxies;
536+
$trustedProxies = ($proxy || self::$trustProxy) && !self::$trustedProxies ? array($ip) : self::$trustedProxies;
537537
$clientIps = array_diff($clientIps, $trustedProxies);
538538

539539
return array_pop($clientIps);
@@ -647,7 +647,7 @@ public function getScheme()
647647
*/
648648
public function getPort()
649649
{
650-
if (self::$trustProxyData && self::$trustedHeaders[self::HEADER_CLIENT_PORT] && $port = $this->headers->get(self::$trustedHeaders[self::HEADER_CLIENT_PORT])) {
650+
if (self::$trustProxy && self::$trustedHeaders[self::HEADER_CLIENT_PORT] && $port = $this->headers->get(self::$trustedHeaders[self::HEADER_CLIENT_PORT])) {
651651
return $port;
652652
}
653653

@@ -776,7 +776,7 @@ public function getQueryString()
776776
*/
777777
public function isSecure()
778778
{
779-
if (self::$trustProxyData && self::$trustedHeaders[self::HEADER_CLIENT_PROTO] && $proto = $this->headers->get(self::$trustedHeaders[self::HEADER_CLIENT_PROTO])) {
779+
if (self::$trustProxy && self::$trustedHeaders[self::HEADER_CLIENT_PROTO] && $proto = $this->headers->get(self::$trustedHeaders[self::HEADER_CLIENT_PROTO])) {
780780
return in_array(strtolower($proto), array('https', 'on', '1'));
781781
}
782782

@@ -800,7 +800,7 @@ public function isSecure()
800800
*/
801801
public function getHost()
802802
{
803-
if (self::$trustProxyData && self::$trustedHeaders[self::HEADER_CLIENT_HOST] && $host = $this->headers->get(self::$trustedHeaders[self::HEADER_CLIENT_HOST])) {
803+
if (self::$trustProxy && self::$trustedHeaders[self::HEADER_CLIENT_HOST] && $host = $this->headers->get(self::$trustedHeaders[self::HEADER_CLIENT_HOST])) {
804804
$elements = explode(',', $host);
805805

806806
$host = trim($elements[count($elements) - 1]);

0 commit comments

Comments
 (0)
0