getAttributes($compiler, $args); if ($_attr['nocache'] === true) { $compiler->trigger_template_error('nocache option not allowed', $compiler->lex->taglineno); } if (strpos($_attr['file'], '$_tmp') !== false) { $compiler->trigger_template_error('illegal value for file attribute', $compiler->lex->taglineno); } // add tag to call parent template at the end of source if ($compiler->has_variable_string || !((substr_count($_attr['file'], '"') == 2 || substr_count($_attr['file'], "'") == 2)) || substr_count($_attr['file'], '(') != 0 || substr_count($_attr['file'], '$_smarty_tpl->') != 0 ) { $compiler->trigger_template_error('variable template file name not allowed', $compiler->lex->taglineno); } $name = trim($_attr['file'],"\"'"); // create template object $_template = new $compiler->smarty->template_class($name, $compiler->smarty, $compiler->template); // check for recursion $uid = $_template->source->uid; if (isset($compiler->extends_uid[$uid])) { $compiler->trigger_template_error("illegal recursive call of \"$include_file\"", $this->lex->line - 1); } $compiler->extends_uid[$uid] = true; if (empty($_template->source->components)) { array_unshift($compiler->sources, $_template->source); } else { foreach ($_template->source->components as $source) { array_unshift($compiler->sources, $source); $uid = $source->uid; if (isset($compiler->extends_uid[$uid])) { $compiler->trigger_template_error("illegal recursive call of \"{$sorce->filepath}\"", $this->lex->line - 1); } $compiler->extends_uid[$uid] = true; } } unset ($_template); $compiler->inheritance_child = true; $compiler->lex->yypushstate(Smarty_Internal_Templatelexer::CHILDBODY); return ''; } }