Skip Menu |

This queue is for tickets about the HTML-Mason CPAN distribution.

Report information
The Basics
Id: 87050
Status: resolved
Priority: 0/
Queue: HTML-Mason

People
Owner: Nobody in particular
Requestors: rurban [...] x-ray.at
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: check length of handlers
use_dhandlers and use_autohandlers fall into the return precedence trap [perl #59802]. i.e. return defined $self->{autohandler_name} and length $self->{autohandler_name}; never checks the length as it parses to (return defined $self->{autohandler_name}) and length $self->{autohandler_name}; See attached patch
Subject: HTML-Mason-1.51-returns.patch
diff -bu ./blib/lib/HTML/Mason/Interp.pm~ ./blib/lib/HTML/Mason/Interp.pm --- ./blib/lib/HTML/Mason/Interp.pm~ 2013-05-08 20:45:13.000000000 -0500 +++ ./blib/lib/HTML/Mason/Interp.pm 2013-07-19 09:36:54.167807984 -0500 @@ -865,7 +865,7 @@ sub use_autohandlers { my $self = shift; - return defined $self->{autohandler_name} and length $self->{autohandler_name}; + return (defined $self->{autohandler_name} and length $self->{autohandler_name}); } # Generate HTML that describes Interp's current status. diff -bu ./blib/lib/HTML/Mason/Request.pm~ ./blib/lib/HTML/Mason/Request.pm --- ./blib/lib/HTML/Mason/Request.pm~ 2013-05-08 20:45:13.000000000 -0500 +++ ./blib/lib/HTML/Mason/Request.pm 2013-07-19 09:36:05.008259380 -0500 @@ -346,7 +346,7 @@ sub use_dhandlers { my $self = shift; - return defined $self->{dhandler_name} and length $self->{dhandler_name}; + return (defined $self->{dhandler_name} and length $self->{dhandler_name}); } sub alter_superclass