From eebb4c53e68749499c0808389e2e7c2f1b88d210 Mon Sep 17 00:00:00 2001 From: Shish Date: Fri, 9 Feb 2024 14:46:50 +0000 Subject: [PATCH] [link_scan] be get/post agnostic --- ext/link_scan/main.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ext/link_scan/main.php b/ext/link_scan/main.php index 386ee19f..9084f796 100644 --- a/ext/link_scan/main.php +++ b/ext/link_scan/main.php @@ -15,10 +15,11 @@ class LinkScan extends Extension { global $config, $page; - if ($event->page_matches("post/list") && isset($_POST['search'])) { + $search = @$_GET['search'] ?? @$_POST['search'] ?? ""; + if ($event->page_matches("post/list") && !empty($search)) { $trigger = $config->get_string("link_scan_trigger", "https?://"); - if (preg_match("#.*{$trigger}.*#", $_POST['search'])) { - $ids = $this->scan($_POST['search']); + if (preg_match("#.*{$trigger}.*#", $search)) { + $ids = $this->scan($search); $page->set_mode(PageMode::REDIRECT); $page->set_redirect(search_link(["id=".implode(",", $ids)])); $event->stop_processing = true;