[vhffs-dev] [1958] @ = $cgi->url_param is not affected by $cgi->delete, workaround by removing theme and lang from query_string generation

[ Thread Index | Date Index | More vhffs.org/vhffs-dev Archives ]


Revision: 1958
Author:   gradator
Date:     2012-01-27 20:38:58 +0100 (Fri, 27 Jan 2012)
Log Message:
-----------
@ = $cgi->url_param is not affected by $cgi->delete, workaround by removing theme and lang from query_string generation

Modified Paths:
--------------
    trunk/vhffs-api/src/Vhffs/Panel/Main.pm

Modified: trunk/vhffs-api/src/Vhffs/Panel/Main.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/Main.pm	2012-01-27 19:17:56 UTC (rev 1957)
+++ trunk/vhffs-api/src/Vhffs/Panel/Main.pm	2012-01-27 19:38:58 UTC (rev 1958)
@@ -251,7 +251,6 @@
 
 	# lang cookie
 	my $lang = $cgi->param('lang');
-	$cgi->delete('lang') if defined $lang;
 	$self->add_cookie( $cgi->cookie( -name=>'language', -value=>$lang, -expires=>'+10y' ) ) if defined $lang;
 	$lang = $cgi->cookie('language') unless defined $lang;
 	$lang = $vhffs->get_config->get_default_language() unless defined $lang;
@@ -264,7 +263,6 @@
 
 	# theme cookie
 	my $theme = $cgi->param('theme');
-	$cgi->delete('theme') if defined $theme;
 	$self->add_cookie( $cgi->cookie( -name=>'theme', -value=>$theme, -expires=>'+10y' ) ) if defined $theme;
 	$theme = $cgi->cookie('theme') unless defined $theme;
 	$theme = $config->get_panel->{'default_theme'} unless defined $theme;
@@ -474,7 +472,8 @@
 
 	my $query_string = '';
 	foreach( my @params = $cgi->url_param ) {
-		$query_string .= $_.'='.$cgi->url_param($_).';' if defined $cgi->url_param($_);
+		my $p = $cgi->url_param($_);
+		$query_string .= $_.'='.$p.';' if defined $p and $_ ne 'lang' and $_ ne 'theme';
 	}
 	chop $query_string;
 	undef $query_string unless $query_string;


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/