@@ -115,7 +115,7 @@ protected $value;
115
115
### Methods
116
116
117
117
``` php
118
- public function __construct( string $name, mixed $value = null, int $expire = int, string $path = string, bool $secure = null , string $domain = null , bool $httpOnly = null , array $options = [] );
118
+ public function __construct( string $name, mixed $value = null, int $expire = int, string $path = string, bool $secure = bool , string $domain = string , bool $httpOnly = bool , array $options = [] );
119
119
```
120
120
Phalcon\Http\Cookie constructor.
121
121
@@ -717,6 +717,11 @@ private $rawBody = ;
717
717
*/
718
718
private $strictHostCheck = false;
719
719
720
+ /**
721
+ * @var array
722
+ */
723
+ private $trustedProxies;
724
+
720
725
```
721
726
722
727
### Methods
@@ -772,11 +777,11 @@ _SERVER["HTTP_ACCEPT_LANGUAGE"]
772
777
773
778
774
779
``` php
775
- public function getClientAddress( bool $trustForwardedHeader = bool ): string | bool ;
780
+ public function getClientAddress( bool $trustForwardedHeader = bool ): string | false ;
776
781
```
777
- Gets most possible client IPv4 Address. This method searches in
782
+ Gets most possible client IP Address. This method searches in
778
783
` $_SERVER["REMOTE_ADDR"] ` and optionally in
779
- ` $_SERVER["HTTP_X_FORWARDED_FOR"] `
784
+ ` $_SERVER["HTTP_X_FORWARDED_FOR"] ` and returns the first non-private or non-reserved IP address
780
785
781
786
782
787
``` php
@@ -832,7 +837,7 @@ Retrieves a query/get value always sanitized with the preset filters
832
837
``` php
833
838
public function getHTTPReferer(): string;
834
839
```
835
- Gets web page that refers active request. ie: https ://www.google.com
840
+ Gets web page that refers active request. ie: http ://www.google.com
836
841
837
842
838
843
``` php
@@ -980,13 +985,13 @@ Note: This method relies on the `$_SERVER["HTTP_ACCEPT_LANGUAGE"]` header.
980
985
``` php
981
986
public function getPut( string $name = null, mixed $filters = null, mixed $defaultValue = null, bool $notAllowEmpty = bool, bool $noRecursive = bool ): mixed;
982
987
```
983
- Gets a variable from put request
988
+ Gets a variable from the PUT request
984
989
985
990
``` php
986
- // Returns value from $_PUT["user_email"] without sanitizing
991
+ // Returns value from PUT stream without sanitizing
987
992
$userEmail = $request->getPut("user_email");
988
993
989
- // Returns value from $_PUT["user_email"] with sanitizing
994
+ // Returns value from PUT stream with sanitizing
990
995
$userEmail = $request->getPut("user_email", "email");
991
996
```
992
997
@@ -1247,6 +1252,12 @@ Sets if the `Request::getHttpHost` method must be use strict validation
1247
1252
of host name or not
1248
1253
1249
1254
1255
+ ``` php
1256
+ public function setTrustedProxies( array $trustedProxies ): RequestInterface;
1257
+ ```
1258
+ Set trusted proxy
1259
+
1260
+
1250
1261
``` php
1251
1262
final protected function getBestQuality( array $qualityParts, string $name ): string;
1252
1263
```
@@ -1272,6 +1283,12 @@ final protected function hasFileHelper( mixed $data, bool $onlySuccessful ): lon
1272
1283
Recursively counts file in an array of files
1273
1284
1274
1285
1286
+ ``` php
1287
+ protected function isIpAddressInCIDR( string $ip, string $cidr ): bool;
1288
+ ```
1289
+ Check if an IP address exists in CIDR range
1290
+
1291
+
1275
1292
``` php
1276
1293
protected function resolveAuthorizationHeaders(): array;
1277
1294
```
@@ -1642,7 +1659,7 @@ $_SERVER["PHP_AUTH_DIGEST"]
1642
1659
``` php
1643
1660
public function getHTTPReferer(): string;
1644
1661
```
1645
- Gets web page that refers active request. ie: https ://www.google.com
1662
+ Gets web page that refers active request. ie: http ://www.google.com
1646
1663
1647
1664
1648
1665
``` php
@@ -1756,13 +1773,13 @@ $userEmail = $request->getPost("user_email", "email");
1756
1773
``` php
1757
1774
public function getPut( string $name = null, mixed $filters = null, mixed $defaultValue = null, bool $notAllowEmpty = bool, bool $noRecursive = bool ): mixed;
1758
1775
```
1759
- Gets a variable from put request
1776
+ Gets a variable from the PUT request
1760
1777
1761
1778
``` php
1762
- // Returns value from $_PUT["user_email"] without sanitizing
1779
+ // Returns value from PUT stream without sanitizing
1763
1780
$userEmail = $request->getPut("user_email");
1764
1781
1765
- // Returns value from $_PUT["user_email"] with sanitizing
1782
+ // Returns value from PUT stream with sanitizing
1766
1783
$userEmail = $request->getPut("user_email", "email");
1767
1784
```
1768
1785
@@ -2531,7 +2548,7 @@ Cookies aren't sent if headers are sent in the current request
2531
2548
2532
2549
2533
2550
``` php
2534
- public function set( string $name, mixed $value = null, int $expire = int, string $path = string, bool $secure = null , string $domain = null , bool $httpOnly = null , array $options = [] ): CookiesInterface;
2551
+ public function set( string $name, mixed $value = null, int $expire = int, string $path = string, bool $secure = bool , string $domain = string , bool $httpOnly = bool , array $options = [] ): CookiesInterface;
2535
2552
```
2536
2553
Sets a cookie to be sent at the end of the request.
2537
2554
@@ -2637,7 +2654,7 @@ Sends the cookies to the client
2637
2654
2638
2655
2639
2656
``` php
2640
- public function set( string $name, mixed $value = null, int $expire = int, string $path = string, bool $secure = null , string $domain = null , bool $httpOnly = null , array $options = [] ): CookiesInterface;
2657
+ public function set( string $name, mixed $value = null, int $expire = int, string $path = string, bool $secure = bool , string $domain = string , bool $httpOnly = bool , array $options = [] ): CookiesInterface;
2641
2658
```
2642
2659
Sets a cookie to be sent at the end of the request
2643
2660
0 commit comments