polr
polr copied to clipboard
Prevent reserved url endings like /admin
Expected Behavior
I expect Polr to prevent creation of reserved url endings like /admin
or /login
so the created URL will always be redirected to the target page.
Current Behavior
Currently, Polr directs me to the login page instead of the target page. The creator of the link is not informed about that issue.
Possible Solution
Showing a bark (notification window top right) telling the user /admin
could not be taken as link ending
Steps to Reproduce (for bugs)
- Create short url to example.org with custom ending
admin
- Open an incognito window
- Open newly created link
- See login window of polr instead of example.org
Context
This may confuse users (however, creating a link with the ending admin or login is stupid but probably someone will do it anyways)
Your Environment
- Version or latest commit hash (
git rev-parse HEAD
): 2.2.0 - Environment name and version (e.g. Chrome 39, PHP 7.0, etc): PHP 7.x (not sure)
- Instance link (optional):
To the list you can add all of the public directory :
/js
/css
/img
Which leads to content forbidden.
I'm looking into this and will submit a PR soon.
Oh great news !