diff options
author | dweller <dweller@cabin.digital> | 2024-02-26 17:58:42 +0200 |
---|---|---|
committer | dweller <dweller@cabin.digital> | 2024-02-26 17:58:42 +0200 |
commit | f1ae79dd64ce98bc4ca23bc66726f458dab11080 (patch) | |
tree | e064093b923179beb7b7966632cbdfdfb2ce9938 /search.php | |
parent | c56a1fe7639c56e51a5213329ac0dc787ff96291 (diff) |
fix section in lmmtfy URL
Diffstat (limited to '')
-rw-r--r-- | search.php | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -73,7 +73,10 @@ . escapeshellarg($query), $lines, $ret); if($ret === 0) { - $url = "$root/?query=". urlencode($query) ."&section=1&action=lmmtfy"; + preg_match('/\<td.*\>.+\((.+)\)\<\/td>/i', $lines[4], $sect); + + $url = "$root/?query=". urlencode($query) ."&section=". 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. |