[#5658] Fix redirect and path validation
3 files changed