Skip to content

Url::fromHttp() global state dependency #4

@AnrDaemon

Description

@AnrDaemon

Url::fromHttp() rely on the $_SERVER superglobal variable to provide request information.

It should either receive the provider array as part of the arguments or rely on the filter_input_array(INPUT_SERVER) as being authoritative.

Perhaps, change signature to

function fromHttp(array $overrides = [], $trust_x_forwarded_headers = true, array $src = []) 
{
  $src = $src ?: \filter_input_array(INPUT_SERVER);
  //…
}

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions