fix(shortener): php7 compat and fix sample nginx configuration
This commit is contained in:
parent
03bded49ff
commit
298db8edfc
2 changed files with 2 additions and 6 deletions
|
@ -14,11 +14,7 @@ server {
|
||||||
}
|
}
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
try_files @ashdotley;
|
rewrite ^/(.*) /index.php?l=$1&$args;
|
||||||
}
|
|
||||||
|
|
||||||
location @ashdotley {
|
|
||||||
rewrite ^/(.*) /index.php?id=$1&$args last;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
location ~ ^/index.php$ {
|
location ~ ^/index.php$ {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
if (isset($_GET['l'])) {
|
if (isset($_GET['l'])) {
|
||||||
$l = $_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);
|
http_response_code(400);
|
||||||
echo "hehe no you don't";
|
echo "hehe no you don't";
|
||||||
die;
|
die;
|
||||||
|
|
Loading…
Reference in a new issue