Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F3921637
D426.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D426.diff
View Options
diff --git a/app/Enums/TrustProxyConfigurationMode.php b/app/Enums/TrustProxyConfigurationMode.php
--- a/app/Enums/TrustProxyConfigurationMode.php
+++ b/app/Enums/TrustProxyConfigurationMode.php
@@ -8,9 +8,7 @@
* @method static TrustProxyConfigurationMode ENUM()
*/
class TrustProxyConfigurationMode extends Enum {
- const __default = self::TrustNone;
-
- const TrustNone = 0;
- const TrustSome = 1;
- const TrustAll = 2;
+ const TRUST_NONE = 0;
+ const TRUST_SOME = 1;
+ const TRUST_ALL = 2;
}
diff --git a/app/Http/Middleware/TrustProxy.php b/app/Http/Middleware/TrustProxy.php
--- a/app/Http/Middleware/TrustProxy.php
+++ b/app/Http/Middleware/TrustProxy.php
@@ -22,14 +22,14 @@
$proxy = Config::get('app.proxy');
switch ($mode = self::getConfigurationMode($proxy)) {
- case TrustProxyConfigurationMode::TrustNone:
+ case TrustProxyConfigurationMode::TRUST_NONE:
break;
- case TrustProxyConfigurationMode::TrustSome:
+ case TrustProxyConfigurationMode::TRUST_SOME:
$request->setTrustedProxies($proxy);
break;
- case TrustProxyConfigurationMode::TrustAll:
+ case TrustProxyConfigurationMode::TRUST_ALL:
$remoteAddr = $request->server->get('REMOTE_ADDR');
$request->setTrustedProxies([ '127.0.0.1', $remoteAddr ]);
break;
@@ -46,13 +46,13 @@
*/
public static function getConfigurationMode ($configValue) {
if (!is_array($configValue) || !count($configValue)) {
- return TrustProxyConfigurationMode::TrustNone;
+ return TrustProxyConfigurationMode::TRUST_NONE;
}
if (in_array('*', $configValue)) {
- return TrustProxyConfigurationMode::TrustAll;
+ return TrustProxyConfigurationMode::TRUST_ALL;
}
- return TrustProxyConfigurationMode::TrustSome;
+ return TrustProxyConfigurationMode::TRUST_SOME;
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Dec 21, 22:16 (19 h, 57 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2309924
Default Alt Text
D426.diff (1 KB)
Attached To
Mode
D426: Enum class follows PSR-1
Attached
Detach File
Event Timeline
Log In to Comment