From f1ae79dd64ce98bc4ca23bc66726f458dab11080 Mon Sep 17 00:00:00 2001 From: dweller Date: Mon, 26 Feb 2024 17:58:42 +0200 Subject: fix section in lmmtfy URL --- search.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/search.php b/search.php index c0e357f..784e614 100644 --- a/search.php +++ b/search.php @@ -73,7 +73,10 @@ . escapeshellarg($query), $lines, $ret); if($ret === 0) { - $url = "$root/?query=". urlencode($query) ."&section=1&action=lmmtfy"; + preg_match('/\.+\((.+)\)\<\/td>/i', $lines[4], $sect); + + $url = "$root/?query=". urlencode($query) ."&section=". urlencode($sect[1]) + ."&action=lmmtfy"; /* HACK: fucking mandoc just generates tons of useless
s that make stuff * look horrible. So I just remove it here. -- cgit v1.2.3