Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed handling the value of attribute case forms in opt:switch: now t…

…hey are treated as expressions.
  • Loading branch information...
commit 043177e51803d90d46750a4be3fdcd603d146c01 1 parent 626c3af
@zyxist zyxist authored
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/Opt/Instruction/Switch.php
View
4 lib/Opt/Instruction/Switch.php
@@ -382,7 +382,9 @@ private function _createSwitchGroup(Opt_Xml_Node $base, $group, Opt_Format_Abstr
$item->set('priv:switch.nesting', $nesting);
if($item->get('priv:switch.caseType') == 'attribute')
{
- $params[$format->action('switch:processAttribute')] = $item->getAttribute($subcase)->getValue();
+ $detected = $this->_compiler->detectExpressionEngine($item->getAttribute($subcase)->getValue(), 'parse');
+ $result = $this->_compiler->parseExpression($detected[1], $detected[0], Opt_Compiler_Class::ESCAPE_OFF);
+ $params[$format->action('switch:processAttribute')] = $result['bare'];
}
else
{
Please sign in to comment.
Something went wrong with that request. Please try again.