Skip to content

Deprecated/Removed constant used #176

@famfo

Description

@famfo

After upgrading from v4.x to v5.x, davis no longer started due to:

Uncaught Error: Undefined constant Symfony\Component\HttpFoundation\Request::HEADER_X_FORWARDED_ALL in public/index.php:24

HEADER_X_FORWARDED_ALL seems to be deprecated and now removed, I had to replace it with HEADER_X_FORWARDED_FOR in my installation. HEADER_X_FORWARDED_ALL seems to include HEADER_X_FORWARDED_FOR, HEADER_X_FORWARDED_HOST, HEADER_X_FORWARDED_PORT and HEADER_X_FORWARDED_PROTO.

Here is my patch for this, I am not familiar with PHP and the other headers though, that's why I'm not opening a PR.

 if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? false) {
-    Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST);
+    Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_FOR ^ Request::HEADER_X_FORWARDED_HOST);
 }

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions