azlux / simple-url-shortener Goto Github PK
View Code? Open in Web Editor NEWurl shortener written in php (with MySQL or SQLite) with history by users
Home Page: https://u.azlux.fr
License: MIT License
url shortener written in php (with MySQL or SQLite) with history by users
Home Page: https://u.azlux.fr
License: MIT License
If I may make a suggestion, where you refer to "Sign In" it would be better to say "Sign Up" since sign in means the same as log in, which is confusing. As I say, just a suggestion.
In the config.php file you can‘t change the URL_SIZE. I changed 5 characters to an other number but then the shortener doesn‘t work. There is a white page at shorten.php
Hello,
I've installed the software but it does not seems to work properly:
https://go.josephcosta.org/yUtA8
Also after login I have a white page.
You refer to an .htaccess file wich I can not find in the repository, could you please add it or give instructions in the README.md > Apache configuration (.htaccess) :?
Best regards
Joseph
Throughout the HTML code you use absolute URLs, e.g.
Line 81 in d35d4e5
This breaks using SUS in a subdirectory, like "https://xyz.com/go/". So I propose to change this to relative URLs, like
<img src="assets/img/delete-icon.png"/>
Hi,
Loving this shortnener and it's really helped with some projects I'm working on for work. When setting this up in my env, I noted that the application isn't escaping html special characters nor stripping tags within the shorten.php
file. This lead to me being able carry our a stored XSS on my own shortener.
Test case:
By adding the following to a new url to shorten, arbitrary JavaScript will be executed when viewing created links: https://google.com"><script>alert(0)</script>
Affected Code (lines 112-114):
$url = $_POST['url'];
$comment = (!empty($_POST['comment'])) ? $_POST['comment'] : NULL;
$custom = (!empty($_POST['custom'])) ? $_POST['custom'] : NULL;
I appended htmlspecialchars and strip_tags to the variables being accepted, which let to arbitrary JavaScript no longer executing. I'm sure there is probably a better way to do this, however, it is a quick fix.
Fixed Code:
$url = htmlspecialchars(strip_tags($_POST['url']));
$comment = (!empty($_POST['comment'])) ? htmlspecialchars(strip_tags($_POST['comment'])) : NULL;
$custom = (!empty($_POST['custom'])) ? htmlspecialchars(strip_tags($_POST['custom'])) : NULL;
I am happy to fork and submit a PR if that's easier.
Thanks,
0x0Banana
A couple of issues:
color: #878787;
hides the text when using dark mode. I have removed that line and it seems fine.I´m running an Apache Webserver on PHP version 7.2 and when trying to register the admin user it just gives the following exception:
Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 1 no such table: users in /www/htdocs/login.php:17 Stack trace: #0 /www/htdocs/login.php(17): PDO->query('SELECT count(*)...') #1 {main} thrown in /www/htdocs/login.php on line 17
The installation was done multiple times following your installation instructions.
Thank you for your help.
Thanks for this script! I have an issue, though. After running installation.php I am take to the home page - but where do I do to create a user??
Answer to this issue if you want to help me for this project.
Please add the preferred topic (At the moment, I mostly need UI help) :
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.