fix(shortener): php7 compat and fix sample nginx configuration

This commit is contained in:
Ashhhleyyy 2023-03-17 12:15:16 +00:00
parent 03bded49ff
commit 298db8edfc
Signed by: ash
GPG key ID: 83B789081A0878FB
2 changed files with 2 additions and 6 deletions

View file

@ -14,11 +14,7 @@ server {
}
location / {
try_files @ashdotley;
}
location @ashdotley {
rewrite ^/(.*) /index.php?id=$1&$args last;
rewrite ^/(.*) /index.php?l=$1&$args;
}
location ~ ^/index.php$ {

View file

@ -1,7 +1,7 @@
<?php
if (isset($_GET['l'])) {
$l = $_GET['l'];
if (str_contains($l, '/') || str_contains($l, '~') || str_contains($l, '.')) {
if (strpos($l, '/') !== false || strpos($l, '~') !== false || strpos($l, '.') !== false) {
http_response_code(400);
echo "hehe no you don't";
die;