diff options
author | einhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46> | 2007-12-13 21:27:59 +0000 |
---|---|---|
committer | einhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46> | 2007-12-13 21:27:59 +0000 |
commit | 03bfa825f47a35ff8fac5c9a0ffa95107687901c (patch) | |
tree | b34647425df248a3ca0699f7b59ec7b7c131883e /LedgerSMB.pm | |
parent | 536b29fa6ca68c26012785df5ad6807ce96acc40 (diff) |
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
Diffstat (limited to 'LedgerSMB.pm')
-rwxr-xr-x | LedgerSMB.pm | 13 |
1 files changed, 13 insertions, 0 deletions
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; |