Re: [interchange] Fix potential "use of uninitialized value" if called during startup

"Stefan Hornburg (Racke)" <[email protected]>
Newsgroups gmane.comp.web.interchange.users
Message-ID <[email protected]>
Hallo David,

thanks very much on your effort to clean up Interchange!

I think the // operator isn't present in older Perls.

Regards
         Racke

On 06/22/2017 10:05 PM, David Christensen wrote:
> commit af6e71231e72eb42b88d4100b500e3d34e5a2adc
> Author: David Christensen <[email protected]>
> Date:   Thu Jun 22 14:38:50 2017 -0500
> 
>     Fix potential "use of uninitialized value" if called during startup
> 
>  lib/Vend/File.pm |    5 ++++-
>  1 files changed, 4 insertions(+), 1 deletions(-)
> ---
> diff --git a/lib/Vend/File.pm b/lib/Vend/File.pm
> index 386ed74..6d9d4ee 100644
> --- a/lib/Vend/File.pm
> +++ b/lib/Vend/File.pm
> @@ -707,10 +707,13 @@ sub allowed_file {
>  	my $fn = shift;
>  	my $write = shift;
>  	my $status = 1;
> +	my $pat;
>  	$Vend::File::errstr = '';
>  	if(	$Global::NoAbsolute
>  			and
> -		$fn !~ $Global::AllowedFileRegex->{$Vend::Cat}
> +		$pat = $Global::AllowedFileRegex->{$Vend::Cat // ''}
> +			and
> +		$fn !~ $pat
>  			and
>  		absolute_or_relative($fn)
>  		)
> 
> _______________________________________________
> interchange-cvs mailing list
> [email protected]
> http://www.icdevgroup.org/mailman/listinfo/interchange-cvs
> 


-- 
Ecommerce and Linux consulting + Perl and web application programming.
Debian and Sympa administration.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.