Location final class
Minn\Http\Location · public/minn/src/Minn/Http/Location.php · 85 lines
Where a redirect leads: a Location header made absolute against the URL that sent it.
Public
| static | sanitize(string $location): string# | A redirect's address made safe, as wp_sanitize_redirect() makes it (probe security-parity): spaces as %20, whole UTF-8 sequences URL-encoded, any other character outside the URL set dropped, and an encoded CR or LF taken out until none is left. Other encoded control characters stay, as they do on the reference. |
| static | resolve(string $base, string $location): string# | The absolute URL $location names, read against $base as RFC 3986 reads a reference: a scheme keeps it as written, "//" takes the base's scheme, a fragment or query alone keeps the base's path, and a relative path joins the base's directory with "." and ".." resolved. |
| static | sameOrigin(string $one, string $two): bool# | Whether two URLs share scheme, host, and port, so credentials may follow from one to the other. |
Internals 1
Private and protected methods: how the class does its work. Not a contract; they change whenever the code is tidied.
| private | withoutDotSegments(string $path): string# | A path with its "." and ".." segments resolved (RFC 3986 remove_dot_segments). |
Nothing matches.