Fix man module opts URL escaping
This commit is contained in:
+3
-2
@@ -213,8 +213,9 @@ if ($section{'man'}) {
|
|||||||
next if (!$all && $in{'and'} || !$any);
|
next if (!$all && $in{'and'} || !$any);
|
||||||
|
|
||||||
push(@rv, [ $text{'search_man'},
|
push(@rv, [ $text{'search_man'},
|
||||||
"view_man.cgi?page=$pp[0]&sec=$3&opts=".
|
"view_man.cgi?page=".&urlize($pp[0]).
|
||||||
$opts{'man'}, "$pp[0] ($sect)",
|
"&sec=".&urlize($sect)."&opts=".
|
||||||
|
&urlize($opts{'man'}), "$pp[0] ($sect)",
|
||||||
&html_escape($desc),
|
&html_escape($desc),
|
||||||
$exact ? 4 : 3 ]);
|
$exact ? 4 : 3 ]);
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-3
@@ -69,10 +69,12 @@ else {
|
|||||||
$cmd = "cat";
|
$cmd = "cat";
|
||||||
}
|
}
|
||||||
$qout = quotemeta($out);
|
$qout = quotemeta($out);
|
||||||
|
$uopts = &urlize($in{'opts'});
|
||||||
$manout = &backquote_command("$config{'man2html_path'} -v 2>&1", 1);
|
$manout = &backquote_command("$config{'man2html_path'} -v 2>&1", 1);
|
||||||
if ($manout =~ /Version:\s+([0-9\.]+)/i && $1 >= 3) {
|
if ($manout =~ /Version:\s+([0-9\.]+)/i && $1 >= 3) {
|
||||||
# New version uses a different syntax!
|
# New version uses a different syntax!
|
||||||
$cmd .= " $qout | nroff -mman | $config{'man2html_path'} --cgiurl ".quotemeta("view_man.cgi?page=\\\${title}&sec=\\\${section}&opts=$in{'opts'}")." --bare";
|
$cgiurl = "view_man.cgi?page=\${title}&sec=\${section}&opts=$uopts";
|
||||||
|
$cmd .= " $qout | nroff -mman | $config{'man2html_path'} --cgiurl ".quotemeta($cgiurl)." --bare";
|
||||||
$out = &backquote_command("$cmd 2>&1", 1);
|
$out = &backquote_command("$cmd 2>&1", 1);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -82,8 +84,7 @@ else {
|
|||||||
$out =~ s/^.*Content-type:.*\n//i;
|
$out =~ s/^.*Content-type:.*\n//i;
|
||||||
$out =~ s/http:\/\///ig;
|
$out =~ s/http:\/\///ig;
|
||||||
$out =~ s/\?/\?sec=/ig;
|
$out =~ s/\?/\?sec=/ig;
|
||||||
$eopts = &html_escape($in{'opts'});
|
$out =~ s/\+/&opts=$uopts&page=/ig;
|
||||||
$out =~ s/\+/&opts=$eopts&page=/ig;
|
|
||||||
$out =~ s/<HTML>.*<BODY>//isg;
|
$out =~ s/<HTML>.*<BODY>//isg;
|
||||||
$out =~ s/<\/HTML>//ig;
|
$out =~ s/<\/HTML>//ig;
|
||||||
$out =~ s/<\/BODY>//ig;
|
$out =~ s/<\/BODY>//ig;
|
||||||
|
|||||||
Reference in New Issue
Block a user