git: 48f6deeecf - main - ports.cgi: minor perl bugfixes
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 02 Oct 2026 10:41:54 UTC
The branch main has been updated by wosch:
URL: https://cgit.FreeBSD.org/doc/commit/?id=48f6deeecf8b4ce5b448b855160607a378abe3d5
commit 48f6deeecf8b4ce5b448b855160607a378abe3d5
Author: Wolfram Schneider <wosch@FreeBSD.org>
AuthorDate: 2026-10-02 10:41:49 +0000
Commit: Wolfram Schneider <wosch@FreeBSD.org>
CommitDate: 2026-10-02 10:41:49 +0000
ports.cgi: minor perl bugfixes
---
website/content/en/cgi/ports.cgi | 16 ++++++----------
1 file changed, 6 insertions(+), 10 deletions(-)
diff --git a/website/content/en/cgi/ports.cgi b/website/content/en/cgi/ports.cgi
index 4387cfdf67..c9ebac6a79 100755
--- a/website/content/en/cgi/ports.cgi
+++ b/website/content/en/cgi/ports.cgi
@@ -256,7 +256,7 @@ sub encode_url {
local ($_) = @_;
s/([\000-\032\;\/\?\:\@\&\=\%\'\"\`\<\>\177-\377 ])/sprintf('%%%02x',ord($1))/eg;
- # s/%20/+/g;
+ s/\+/%20/g;
$_;
}
@@ -275,7 +275,7 @@ sub readindex {
while (<C>) {
next if $query && !/$query/oi;
- chop;
+ chomp;
@tmp = split(/\|/);
$var{"$tmp[0]"} = $_;
@@ -296,7 +296,7 @@ sub readcoll {
if ( -r $file && open( C, $file ) ) {
while (<C>) {
- chop;
+ chomp;
if (/^\s*([^,]+),\s*"([^"]+)",\s*([A-Z]+)/) {
@b = split( /\s+/, $1 );
@@ -317,7 +317,7 @@ sub readcoll {
}
while (<C>) {
- chop;
+ chomp;
@a = split('\|');
@b = split( /\s+/, $a[6] );
@@ -359,15 +359,11 @@ sub out {
$rdepends //= "";
$counter++;
- $pathB = $path;
my $port_path = $path;
$port_path =~ s,/usr/ports/,,;
- $pathB =~ s/^$localPrefix/ports/o;
-
$path =~ s/^$localPrefix/$remotePrefixFtp/o;
$descfile =~ s/^$localPrefix/$remotePrefixFtp/o;
- $version = &encode_url($version);
$email = &check_freebsd_mailing_list($email)
if $enable_check_freebsd_mailing_list;
@@ -380,13 +376,13 @@ sub out {
$descfile =~ s%^$remotePrefixFtp%$remotePrefixRepo/plain%o;
print
- qq{<dt><b><a name="$version" href="$t">$version</a></b></dt>\n};
+ qq{<dt><b><a name="@{[ &encode_url($version) ]}" href="$t">}, &escapeHTML($version), qq{</a></b></dt>\n};
print qq{<dd>}, &escapeHTML($comment), qq{<br />\n};
print qq[<a href="$descfile">Description</a>\n];
print qq[<b>:</b> <a href="$l">Commit Log</a>\n];
- print qq[<b>:</b> <a href="?stype=pkg&query=], escapeHTML($port_path),
+ print qq[<b>:</b> <a href="?stype=pkg&query=], &encode_url($port_path),
qq[">Packages</a>\n]
if $enable_packages_link;