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 / {
|
||||
try_files @ashdotley;
|
||||
}
|
||||
|
||||
location @ashdotley {
|
||||
rewrite ^/(.*) /index.php?id=$1&$args last;
|
||||
rewrite ^/(.*) /index.php?l=$1&$args;
|
||||
}
|
||||
|
||||
location ~ ^/index.php$ {
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue