From 75ee0279ecaa8e5a8ee77d99ab466b4333b071a6 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Fri, 9 Jul 2021 13:04:14 +0000 Subject: [PATCH] pakfire.cgi: Pass packages to install/uninstall as array Signed-off-by: Michael Tremer --- html/cgi-bin/pakfire.cgi | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/html/cgi-bin/pakfire.cgi b/html/cgi-bin/pakfire.cgi index 631587ce27..ff79b2defe 100644 --- a/html/cgi-bin/pakfire.cgi +++ b/html/cgi-bin/pakfire.cgi @@ -55,14 +55,14 @@ sub refreshpage{&Header::openbox( 'Waiting', 1, "$Lang::tr{'pakfire install package'}.$cgiparams{'INSPAKS'}.$Lang::tr{'pakfire possible dependency'} +
$Lang::tr{'pakfire install package'}.@pkgs.$Lang::tr{'pakfire possible dependency'}
 END
 		foreach (@output) {
@@ -92,15 +92,14 @@ END
 		exit;
 	}
 } elsif (($cgiparams{'ACTION'} eq 'remove') && (! -e $Pakfire::lockfile)) {
-
-	$cgiparams{'DELPAKS'} =~ s/\|/\ /g;
+	my @pkgs = split(/\|/, $cgiparams{'DELPAKS'});
 	if ("$cgiparams{'FORCE'}" eq "on") {
-		&General::system_background("/usr/local/bin/pakfire", "remove", "--non-interactive", "--no-colors", $cgiparams{'DELPAKS'});
+		&General::system_background("/usr/local/bin/pakfire", "remove", "--non-interactive", "--no-colors", @pkgs);
 	} else {
 		&Header::openbox("100%", "center", $Lang::tr{'request'});
-		my @output = &General::system_output("/usr/local/bin/pakfire", "resolvedeps", "--no-colors", $cgiparams{'DELPAKS'});
+		my @output = &General::system_output("/usr/local/bin/pakfire", "resolvedeps", "--no-colors", @pkgs);
 		print <
$Lang::tr{'pakfire uninstall package'}.$cgiparams{'DELPAKS'}.$Lang::tr{'pakfire possible dependency'} +
$Lang::tr{'pakfire uninstall package'}.@pkgs.$Lang::tr{'pakfire possible dependency'}
 END
 		foreach (@output) {
-- 
2.39.2