[freeside-commits] freeside/httemplate/elements create_uri_query, NONE, 1.1.2.2 handle_uri_query, NONE, 1.1.2.2
Ivan,,,
ivan at wavetail.420.am
Fri Nov 26 19:55:10 PST 2010
Update of /home/cvs/cvsroot/freeside/httemplate/elements
In directory wavetail.420.am:/tmp/cvs-serv21325/elements
Added Files:
Tag: FREESIDE_2_1_BRANCH
create_uri_query handle_uri_query
Log Message:
fix "URL limit exceeded" when errors are present on quick payment entry, RT#9917
--- NEW FILE: handle_uri_query ---
<%init>
if ( $cgi->param('redirect') ) {
my $session = $cgi->param('redirect');
my $pref = $FS::CurrentUser::CurrentUser->option("redirect$session");
die "unknown redirect session $session\n" unless length($pref);
$cgi = new CGI($pref);
}
</%init>
--- NEW FILE: create_uri_query ---
<% $query %>\
<%init>
my $query = $cgi->query_string;
if ( length($query) > 1920 ) { #stupid IE 2083 URL limit
my $session = int(rand(4294967296)); #XXX
my $pref = new FS::access_user_pref({
'usernum' => $FS::CurrentUser::CurrentUser->usernum,
'prefname' => "redirect$session",
'prefvalue' => $query,
'expiration' => time + 3600, #1h? 1m?
});
my $pref_error = $pref->insert;
if ( $pref_error ) {
die "FATAL: couldn't even set redirect cookie: $pref_error".
" attempting to set redirect$session to $query\n";
}
$query = "redirect=$session";
}
</%init>
More information about the freeside-commits
mailing list