mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-19 16:11:21 +02:00
Merge branch 'develop-ascraeus' into develop
* develop-ascraeus: [ticket/12781] Add tests [ticket/12781] Template regex for IF catch too many things
This commit is contained in:
@@ -285,7 +285,7 @@ class lexer extends \Twig_Lexer
|
|||||||
return "<!-- {$matches[1]}IF{$inner}-->";
|
return "<!-- {$matches[1]}IF{$inner}-->";
|
||||||
};
|
};
|
||||||
|
|
||||||
return preg_replace_callback('#<!-- (ELSE)?IF((.*?) \(*!?[\$|\.]([^\s]+)(.*?))-->#', $callback, $code);
|
return preg_replace_callback('#<!-- (ELSE)?IF((.*?) (?:\(*!?[\$|\.]([^\s]+)(.*?))?)-->#', $callback, $code);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -352,6 +352,13 @@ class phpbb_template_template_test extends phpbb_template_template_test_case
|
|||||||
array(),
|
array(),
|
||||||
"13FOOBAR|foobar",
|
"13FOOBAR|foobar",
|
||||||
),
|
),
|
||||||
|
array(
|
||||||
|
'if_nested_tags.html',
|
||||||
|
array('S_VALUE' => true,),
|
||||||
|
array(),
|
||||||
|
array(),
|
||||||
|
'inner_value',
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
1
tests/template/templates/if_nested_tags.html
Normal file
1
tests/template/templates/if_nested_tags.html
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<!-- IF S_VALUE --><!-- DEFINE $INNER_VALUE = 'inner_value' --><!-- ENDIF -->{$INNER_VALUE}
|
Reference in New Issue
Block a user