From dcdb1b23d74668668baa38e6809d073eccb8e490 Mon Sep 17 00:00:00 2001 From: Matthieu Bessat Date: Mon, 25 Oct 2021 11:36:16 +0200 Subject: [PATCH] fix(UrlShortner): wrong array filter --- modules/urlshortner/urlshortner.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/urlshortner/urlshortner.php b/modules/urlshortner/urlshortner.php index 5ea16f5..0ff3b9b 100644 --- a/modules/urlshortner/urlshortner.php +++ b/modules/urlshortner/urlshortner.php @@ -52,7 +52,7 @@ if (strpos($_SERVER['REQUEST_URI'], '/admin') === 0) { http_response_code(400); 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"; saveUrls($urls);