fix(UrlShortner): wrong array filter

This commit is contained in:
Matthieu Bessat 2021-10-25 11:36:16 +02:00
parent f8eddfd1d5
commit dcdb1b23d7

View file

@ -52,7 +52,7 @@ if (strpos($_SERVER['REQUEST_URI'], '/admin') === 0) {
http_response_code(400); http_response_code(400);
exit(); exit();
} }
$urls = array_filter([], fn ($u) => $u['slug'] !== $_GET['slug']); $urls = array_filter($urls, fn ($u) => $u['slug'] !== $_GET['slug']);
echo "The urls with this slug were deleted"; echo "The urls with this slug were deleted";
saveUrls($urls); saveUrls($urls);