Skip to content

Commit

Permalink
Explicitly check for %09 in route, closes #5415
Browse files Browse the repository at this point in the history
  • Loading branch information
josevalim committed Dec 19, 2023
1 parent 8953b6f commit 4ca6ca2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/phoenix/controller.ex
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ defmodule Phoenix.Controller do
end
end

@invalid_local_url_chars ["\\", "/%", "/\t"]
@invalid_local_url_chars ["\\", "/%09", "/\t"]
defp validate_local_url("//" <> _ = to), do: raise_invalid_url(to)

defp validate_local_url("/" <> _ = to) do
Expand Down Expand Up @@ -1033,7 +1033,7 @@ defmodule Phoenix.Controller do
defp assigns_layout(conn, _assigns, format) do
case conn.private[:phoenix_layout] do
%{^format => bad_value, _: good_value} when good_value != false ->
IO.warn """
IO.warn("""
conflicting layouts found. A layout has been set with format, such as:
put_layout(conn, #{format}: #{inspect(bad_value)})
Expand All @@ -1049,7 +1049,7 @@ defmodule Phoenix.Controller do
to use layouts with formats:
use Phoenix.Controller, layouts: [#{format}: #{inspect(bad_value)}]
"""
""")

if format in layout_formats(conn), do: good_value, else: false

Expand Down

0 comments on commit 4ca6ca2

Please sign in to comment.