summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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.