summaryrefslogtreecommitdiff
path: root/search.php
diff options
context:
space:
mode:
authordweller <dweller@cabin.digital>2024-02-26 17:58:42 +0200
committerdweller <dweller@cabin.digital>2024-02-26 17:58:42 +0200
commitf1ae79dd64ce98bc4ca23bc66726f458dab11080 (patch)
treee064093b923179beb7b7966632cbdfdfb2ce9938 /search.php
parentc56a1fe7639c56e51a5213329ac0dc787ff96291 (diff)
fix section in lmmtfy URL
Diffstat (limited to '')
-rw-r--r--search.php5
1 files changed, 4 insertions, 1 deletions
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) ."&ampsection=1&action=lmmtfy";
+ preg_match('/\<td.*\>.+\((.+)\)\<\/td>/i', $lines[4], $sect);
+
+ $url = "$root/?query=". urlencode($query) ."&ampsection=". urlencode($sect[1])
+ ."&action=lmmtfy";
/* HACK: fucking mandoc just generates tons of useless <br>s that make <code> stuff
* look horrible. So I just remove it here.