From 24a9ad0e3460a4daba0a0d5255d6146cc4653a70 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Fri, 11 May 2007 12:02:24 +0000 Subject: [PATCH] Filehandles lokal deklarieren. open() nur mit "sicherem" Argument aufrufen. --- SL/USTVA.pm | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/SL/USTVA.pm b/SL/USTVA.pm index f99021f9a..86bf8bdea 100644 --- a/SL/USTVA.pm +++ b/SL/USTVA.pm @@ -562,6 +562,8 @@ sub process_query { # return unless (-f $filename); + local *FH; + open(FH, "$filename") or $form->error("$filename : $!\n"); my $query = ""; my $sth; @@ -1014,14 +1016,18 @@ sub get_config { my ($self, $userpath, $filename) = @_; + local (*FACONF, *FANEW); + my $form = $main::form; - if (!open(FACONF, "$userpath/$form->{login}_$filename")) { - open(FANEW, ">$userpath/$form->{login}_$filename") || - $form->error("$userpath/$filename : $!"); + $filename = "$form->{login}_$filename"; + $filename =~ s|.*/||; + $filename = "$userspath/$filename"; + + if (!open(FACONF, "<", $filename)) { + open(FANEW, ">", $filename) || $form->error("$filename : $!"); close(FANEW); - open(FACONF, "$userpath/$form->{login}_$filename") || - $form->error("$userpath/$form->{username}_$filename : $!"); + open(FACONF, "<", $filename) || $form->error("$filename : $!"); } while () { -- 2.20.1