diff --git a/src/Mustache/Parser.php b/src/Mustache/Parser.php index de43fcda..02e3d896 100644 --- a/src/Mustache/Parser.php +++ b/src/Mustache/Parser.php @@ -313,12 +313,6 @@ private function getDynamicName(array $token) $isDynamic = true; } - // Two stars is two many! - if (preg_match('/^\s*\*\s*/', $name) || preg_match('/[|.]\s*\*/', $name)) { - $msg = sprintf('Invalid dynamic name: %s', $name); - throw new Mustache_Exception_SyntaxException($msg, $token); - } - return array($name, $isDynamic); } diff --git a/test/Mustache/Test/Functional/DynamicPartialsTest.php b/test/Mustache/Test/Functional/DynamicPartialsTest.php index 9887132a..88e1fd83 100644 --- a/test/Mustache/Test/Functional/DynamicPartialsTest.php +++ b/test/Mustache/Test/Functional/DynamicPartialsTest.php @@ -24,34 +24,6 @@ public function setUp() )); } - public function getInvalidDynamicNamesExamples() - { - return array( - array('{{> **foo}}'), - array('{{> *foo.*bar}}'), - array('{{> foo.*bar}}'), - array('{{ *foo }}'), - array('{{{ *foo }}}'), - array('{{& *foo }}'), - array('{{# *foo }}{{/ *foo }}'), - array('{{^ *foo }}{{/ *foo }}'), - array('{{% FILTERS}}{{> *foo | *bar}}'), - array('{{% FILTERS}}{{> foo | *bar}}'), - array('{{% BLOCKS }}{{$ *foo }}{{/ *foo }}'), - ); - } - - /** - * @dataProvider getInvalidDynamicNamesExamples - * @expectedException Mustache_Exception_SyntaxException - * @expectedExceptionMessage Invalid dynamic name: - */ - public function testInvalidDynamicNamesExamples($template) - { - $this->mustache->render($template); - } - - public function getValidDynamicNamesExamples() { // technically not all dynamic names, but also not invalid