Skip to content

Commit

Permalink
mod_base: Fix an issue where controller_page could enter in a redirec…
Browse files Browse the repository at this point in the history
…t loop.

This could happen if a resource has a page path with a space (encoded as %20).
The reconstitution of the page path did not account for non url-safe characters.
  • Loading branch information
mworrell committed Dec 3, 2022
1 parent f87f4e0 commit f3c6ea9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion apps/zotonic_mod_base/src/controllers/controller_page.erl
Expand Up @@ -175,7 +175,7 @@ do_temporary_redirect(Location, Context) ->
current_path(Context) ->
case z_context:get_q(<<"zotonic_dispatch_path">>, Context, []) of
[] -> <<"/">>;
DP -> z_convert:to_binary([[ $/, P ] || P <- DP ])
DP -> z_convert:to_binary([[ $/, z_url:url_path_encode(P) ] || P <- DP ])
end.

is_canonical(Id, Context) ->
Expand Down

0 comments on commit f3c6ea9

Please sign in to comment.