devshort

private self-hosted shortlink service
git clone https://git.clttr.info/devshort.git
Log (Feed) | Files | Refs (Tags) | README | LICENSE

commit 488b4f78c329c8e3289a2033265b7e14fd1601db
parent 77c7140bc76d98f5c1499346c7f2951e8af237f1
Author: Florian <flokX@users.noreply.github.com>
Date:   Mon, 27 Jan 2020 13:19:47 +0100

Merge pull request #20 from guzzisti/caseinsensitive_urls

lowercase urls on creation and redirect check
Diffstat:
Madmin.php | 2+-
Mredirect.php | 2+-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/admin.php b/admin.php @@ -29,7 +29,7 @@ if (isset($_GET["delete"]) || isset($_GET["add"])) { unset($config_content["shortlinks"][$data["name"]]); unset($stats_content[$data["name"]]); } else if (isset($_GET["add"])) { - $filtered = array("name" => filter_var($data["name"], FILTER_SANITIZE_STRING), + $filtered = array("name" => strtolower(filter_var($data["name"], FILTER_SANITIZE_STRING)), "url" => filter_var($data["url"], FILTER_SANITIZE_URL)); if (!filter_var($filtered["url"], FILTER_VALIDATE_URL)) { echo "{\"status\": \"unvalid-url\"}"; diff --git a/redirect.php b/redirect.php @@ -2,7 +2,7 @@ // All relevant changes can be made in the data file. Please read the docs: https://github.com/flokX/devShort/wiki -$short = htmlspecialchars($_GET["short"]); +$short = strtolower(htmlspecialchars($_GET["short"])); $return_404 = array("favicon.ico", "assets/vendor/bootstrap/bootstrap.min.css.map", "assets/vendor/frappe-charts/frappe-charts.min.iife.js.map"); if (in_array($short, $return_404)) {