From 03bfa825f47a35ff8fac5c9a0ffa95107687901c Mon Sep 17 00:00:00 2001 From: einhverfr Date: Thu, 13 Dec 2007 21:27:59 +0000 Subject: Added a routine to sanitize the CGI variables. Needed for some CSV exports routines. git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1978 4979c152-3d1c-0410-bac9-87ea11338e46 --- LedgerSMB.pm | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'LedgerSMB.pm') diff --git a/LedgerSMB.pm b/LedgerSMB.pm index 49126940..30c3b2b8 100755 --- a/LedgerSMB.pm +++ b/LedgerSMB.pm @@ -94,6 +94,11 @@ non-numbers. Copies the given key=>vars to $self. Allows for finer control of merging hashes into self. +=item remove_cgi_globals() + +Removes all elements starting with a . because these elements conflict with the +ability to hide the entire structure for things like CSV lookups. + =back =head1 Copyright (C) 2006, The LedgerSMB core team. @@ -796,6 +801,14 @@ sub set { } +sub remove_cgi_globals { + my ($self) = @_; + for my $key (keys %$self){ + if ($key =~ /^\./){ + delete $self->{key} + } + } +} 1; -- cgit v1.2.3