From 60c0c5790d1dfca6c14d7acd29fb816b1a58a80e Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Tue, 23 Nov 2010 15:52:25 +0100 Subject: [PATCH] =?utf8?q?Templates:=20Auswertung=20des=20"else"-Teils=20g?= =?utf8?q?efixt,=20wenn=20"if"-Teil=20Variablenvergleiche=20enth=C3=A4lt?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/Template/Simple.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/SL/Template/Simple.pm b/SL/Template/Simple.pm index 3baeaac2d..d7a7c3525 100644 --- a/SL/Template/Simple.pm +++ b/SL/Template/Simple.pm @@ -163,6 +163,7 @@ sub _parse_block_if { my $not = $1; my $var = $2; + my $comparison = $3; # Optionaler Match um $4..$8 my $operator_neg = $4; # '=' oder '!' oder undef, wenn kein Vergleich erkannt my $operator_type = $5; # '=' oder '~' für Stringvergleich oder Regex my $quoted_word = $7; # nur gültig, wenn quoted string angegeben (siehe unten); dann "value" aus <%if var == "value" %> @@ -173,7 +174,7 @@ sub _parse_block_if { substr($$contents, 0, length($&)) = ""; my $block; - ($block, $$contents) = $self->find_end($$contents, 0, $var, $not); + ($block, $$contents) = $self->find_end($$contents, 0, "$var $comparison", $not); if (!$block) { $self->{"error"} = "Unclosed $self->{tag_start}if$self->{tag_end}." unless ($self->{"error"}); $main::lxdebug->leave_sub(); -- 2.20.1