diff --git a/lib/classes/Smarty b/lib/classes/Smarty index a4419630..8629c8bd 120000 --- a/lib/classes/Smarty +++ b/lib/classes/Smarty @@ -1 +1 @@ -Smarty-3.1.14/libs/ \ No newline at end of file +Smarty-3.1.15/libs/ \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_block.php b/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_block.php deleted file mode 100644 index 847b04a9..00000000 --- a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_block.php +++ /dev/null @@ -1,283 +0,0 @@ -getAttributes($compiler, $args); - $save = array($_attr, $compiler->parser->current_buffer, $compiler->nocache, $compiler->smarty->merge_compiled_includes, $compiler->merged_templates, $compiler->smarty->merged_templates_func, $compiler->template->properties, $compiler->template->has_nocache_code); - $this->openTag($compiler, 'block', $save); - if ($_attr['nocache'] == true) { - $compiler->nocache = true; - } - // set flag for {block} tag - $compiler->inheritance = true; - // must merge includes - $compiler->smarty->merge_compiled_includes = true; - - $compiler->parser->current_buffer = new _smarty_template_buffer($compiler->parser); - $compiler->has_code = false; - return true; - } - - /** - * Save or replace child block source by block name during parsing - * - * @param string $block_content block source content - * @param string $block_tag opening block tag - * @param object $template template object - * @param string $filepath filepath of template source - */ - public static function saveBlockData($block_content, $block_tag, $template, $filepath) { - $_rdl = preg_quote($template->smarty->right_delimiter); - $_ldl = preg_quote($template->smarty->left_delimiter); - if (!$template->smarty->auto_literal) { - $al = '\s*'; - } else { - $al = ''; - } - if (0 == preg_match("!({$_ldl}{$al}block\s+)(name=)?(\w+|'.*'|\".*\")(\s*?)?((append|prepend|nocache)?(\s*)?(hide)?)?(\s*{$_rdl})!", $block_tag, $_match)) { - $error_text = 'Syntax Error in template "' . $template->source->filepath . '" "' . $block_tag . '" illegal options'; - throw new SmartyCompilerException($error_text); - } else { - $_name = trim($_match[3], '\'"'); - if ($_match[8] != 'hide' || isset($template->block_data[$_name])) { // replace {$smarty.block.child} - // get nested block tags - if (0 != preg_match_all("!({$_ldl}{$al}block\s+)(name=)?(\w+|'.*'|\".*\")([\s\S]*?)(hide)?(\s*{$_rdl})([\s\S]*?)(.*)?({$_ldl}{$al}/block\s*{$_rdl})!", $block_content, $_match2)) { - foreach ($_match2[3] as $key => $name) { - // get it's replacement - $_name2 = trim($name, '\'"'); - if ($_match2[5][$key] != 'hide' || isset($template->block_data[$_name2])) { - if (isset($template->block_data[$_name2])) { - $replacement = $template->block_data[$_name2]['source']; - } else { - $replacement = ''; - } - // replace {$smarty.block.child} tag - if (preg_match("!{$_ldl}{$al}\\\$smarty\.block\.child\s*{$_rdl}!",$_match2[7][$key])) { - $replacement = preg_replace("!({$_ldl}{$al}\\\$smarty\.block\.child\s*{$_rdl})!", $replacement, $_match2[7][$key]); - $block_content = preg_replace("!(({$_ldl}{$al}block)(.*)?{$name}(.*)?({$_rdl}[\s\S]*?{$_ldl}{$al}/block\s*{$_rdl}))!", $replacement, $block_content); - } - if (preg_match("!{$_ldl}{$al}\\\$smarty\.block\.child\s*{$_rdl}!",$_match2[8][$key])) { - $replacement = preg_replace("!{$_ldl}{$al}\\\$smarty\.block\.child\s*{$_rdl}!", $replacement, $_match2[8][$key]); - $block_content = preg_replace("!(({$_ldl}{$al}block)(.*)?{$name}(.*)?({$_rdl})(.*)?({$_ldl}{$al}/block\s*{$_rdl}))!", $replacement, $block_content); - } - } else { - // remove hidden blocks - $block_content = preg_replace("!(({$_ldl}{$al}block)(.*)?{$name}(.*)?({$_rdl}[\s\S]*?{$_ldl}{$al}/block\s*{$_rdl}))!", '', $block_content); - } - } - } - // do we have not nested {$smart.block.child} - if (0 != preg_match("!({$_ldl}{$al}\\\$smarty\.block\.child\s*{$_rdl})!", $block_content, $_match2)) { - // get child replacement for this block - if (isset($template->block_data[$_name])) { - $replacement = $template->block_data[$_name]['source']; - unset($template->block_data[$_name]); - } else { - $replacement = ''; - } - $block_content = preg_replace("!({$_ldl}{$al}\\\$smarty\.block\.child\s*{$_rdl})!", $replacement, $block_content); - } - if (isset($template->block_data[$_name])) { - if (strpos($template->block_data[$_name]['source'], '%%%%SMARTY_PARENT%%%%') !== false) { - $template->block_data[$_name]['source'] = - str_replace('%%%%SMARTY_PARENT%%%%', $block_content, $template->block_data[$_name]['source']); - } elseif ($template->block_data[$_name]['mode'] == 'prepend') { - $template->block_data[$_name]['source'] .= $block_content; - } elseif ($template->block_data[$_name]['mode'] == 'append') { - $template->block_data[$_name]['source'] = $block_content . $template->block_data[$_name]['source']; - } - } else { - $template->block_data[$_name]['source'] = $block_content; - $template->block_data[$_name]['file'] = $filepath; - } - if ($_match[6] == 'append') { - $template->block_data[$_name]['mode'] = 'append'; - } elseif ($_match[6] == 'prepend') { - $template->block_data[$_name]['mode'] = 'prepend'; - } else { - $template->block_data[$_name]['mode'] = 'replace'; - } - } - } - } - - /** - * Compile saved child block source - * - * @param object $compiler compiler object - * @param string $_name optional name of child block - * @return string compiled code of schild block - */ - public static function compileChildBlock($compiler, $_name = null) { - $_output = ''; - // if called by {$smarty.block.child} we must search the name of enclosing {block} - if ($_name == null) { - $stack_count = count($compiler->_tag_stack); - while (--$stack_count >= 0) { - if ($compiler->_tag_stack[$stack_count][0] == 'block') { - $_name = trim($compiler->_tag_stack[$stack_count][1][0]['name'], "'\""); - break; - } - } - // flag that child is already compile by {$smarty.block.child} inclusion - $compiler->template->block_data[$_name]['compiled'] = true; - } - if ($_name == null) { - $compiler->trigger_template_error('{$smarty.block.child} used out of context', $compiler->lex->taglineno); - } - // undefined child? - if (!isset($compiler->template->block_data[$_name]['source'])) { - return ''; - } - $_tpl = new Smarty_Internal_template('string:' . $compiler->template->block_data[$_name]['source'], $compiler->smarty, $compiler->template, $compiler->template->cache_id, - $compiler->template->compile_id, $compiler->template->caching, $compiler->template->cache_lifetime); - $_tpl->variable_filters = $compiler->template->variable_filters; - $_tpl->properties['nocache_hash'] = $compiler->template->properties['nocache_hash']; - $_tpl->source->filepath = $compiler->template->block_data[$_name]['file']; - $_tpl->allow_relative_path = true; - if ($compiler->nocache) { - $_tpl->compiler->forceNocache = 2; - } else { - $_tpl->compiler->forceNocache = 1; - } - $_tpl->compiler->suppressHeader = true; - $_tpl->compiler->suppressFilter = true; - $_tpl->compiler->suppressTemplatePropertyHeader = true; - $_tpl->compiler->suppressMergedTemplates = true; - if (strpos($compiler->template->block_data[$_name]['source'], '%%%%SMARTY_PARENT%%%%') !== false) { - $_output = str_replace('%%%%SMARTY_PARENT%%%%', $compiler->parser->current_buffer->to_smarty_php(), $_tpl->compiler->compileTemplate($_tpl)); - } elseif ($compiler->template->block_data[$_name]['mode'] == 'prepend') { - $_output = $_tpl->compiler->compileTemplate($_tpl) . $compiler->parser->current_buffer->to_smarty_php(); - } elseif ($compiler->template->block_data[$_name]['mode'] == 'append') { - $_output = $compiler->parser->current_buffer->to_smarty_php() . $_tpl->compiler->compileTemplate($_tpl); - } elseif (!empty($compiler->template->block_data[$_name])) { - $_output = $_tpl->compiler->compileTemplate($_tpl); - } - $compiler->template->properties['file_dependency'] = array_merge($compiler->template->properties['file_dependency'], $_tpl->properties['file_dependency']); - $compiler->template->properties['function'] = array_merge($compiler->template->properties['function'], $_tpl->properties['function']); - $compiler->merged_templates = array_merge($compiler->merged_templates, $_tpl->compiler->merged_templates); - $compiler->template->variable_filters = $_tpl->variable_filters; - if ($_tpl->has_nocache_code) { - $compiler->template->has_nocache_code = true; - } - foreach ($_tpl->required_plugins as $key => $tmp1) { - if ($compiler->nocache && $compiler->template->caching) { - $code = 'nocache'; - } else { - $code = $key; - } - foreach ($tmp1 as $name => $tmp) { - foreach ($tmp as $type => $data) { - $compiler->template->required_plugins[$code][$name][$type] = $data; - } - } - } - unset($_tpl); - return $_output; - } - -} - -/** - * Smarty Internal Plugin Compile BlockClose Class - * - * @package Smarty - * @subpackage Compiler - */ -class Smarty_Internal_Compile_Blockclose extends Smarty_Internal_CompileBase { - - /** - * Compiles code for the {/block} tag - * - * @param array $args array with attributes from parser - * @param object $compiler compiler object - * @return string compiled code - */ - public function compile($args, $compiler) { - $compiler->has_code = true; - // check and get attributes - $_attr = $this->getAttributes($compiler, $args); - $saved_data = $this->closeTag($compiler, array('block')); - $_name = trim($saved_data[0]['name'], "\"'"); - if (isset($compiler->template->block_data[$_name]) && !isset($compiler->template->block_data[$_name]['compiled'])) { - // restore to status before {block} tag as new subtemplate code of parent {block} is not needed - // TODO: Below code was disabled in 3.1.8 because of problems with {include} in nested {block} tags in child templates - // combined with append/prepend or $smarty.block.parent - // For later versions it should be checked under which conditions it could run for optimisation - // - //$compiler->merged_templates = $saved_data[4]; - //$compiler->smarty->merged_templates_func = $saved_data[5]; - //$compiler->template->properties = $saved_data[6]; - //$compiler->template->has_nocache_code = $saved_data[7]; - $_output = Smarty_Internal_Compile_Block::compileChildBlock($compiler, $_name); - } else { - if (isset($saved_data[0]['hide']) && !isset($compiler->template->block_data[$_name]['source'])) { - $_output = ''; - } else { - $_output = $compiler->parser->current_buffer->to_smarty_php(); - } - unset($compiler->template->block_data[$_name]['compiled']); - } - // reset flags - $compiler->parser->current_buffer = $saved_data[1]; - $compiler->nocache = $saved_data[2]; - $compiler->smarty->merge_compiled_includes = $saved_data[3]; - // reset flag for {block} tag - $compiler->inheritance = false; - // $_output content has already nocache code processed - $compiler->suppressNocacheProcessing = true; - return $_output; - } - -} - -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_extends.php b/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_extends.php deleted file mode 100644 index fe14a408..00000000 --- a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_extends.php +++ /dev/null @@ -1,133 +0,0 @@ - true, 'eval' => true); - $this->_rdl = preg_quote($compiler->smarty->right_delimiter); - $this->_ldl = preg_quote($compiler->smarty->left_delimiter); - if (!$compiler->smarty->auto_literal) { - $al = '\s*'; - } else { - $al = ''; - } - $filepath = $compiler->template->source->filepath; - $this->mbstring_overload = ini_get('mbstring.func_overload') & 2; - // check and get attributes - $_attr = $this->getAttributes($compiler, $args); - if ($_attr['nocache'] === true) { - $compiler->trigger_template_error('nocache option not allowed', $compiler->lex->taglineno); - } - - $_smarty_tpl = $compiler->template; - $include_file = null; - if (strpos($_attr['file'], '$_tmp') !== false) { - $compiler->trigger_template_error('illegal value for file attribute', $compiler->lex->taglineno); - } - eval('$include_file = ' . $_attr['file'] . ';'); - // create template object - $_template = new $compiler->smarty->template_class($include_file, $compiler->smarty, $compiler->template); - // save file dependency - if (isset($_is_stringy[$_template->source->type])) { - $template_sha1 = sha1($include_file); - } else { - $template_sha1 = sha1($_template->source->filepath); - } - if (isset($compiler->template->properties['file_dependency'][$template_sha1])) { - $compiler->trigger_template_error("illegal recursive call of \"{$include_file}\"", $compiler->lex->line - 1); - } - $compiler->template->properties['file_dependency'][$template_sha1] = array($_template->source->filepath, $_template->source->timestamp, $_template->source->type); - $_content = ($this->mbstring_overload ? mb_substr($compiler->lex->data, $compiler->lex->counter - 1, 20000000, 'latin1') : substr($compiler->lex->data, $compiler->lex->counter - 1)); - if (preg_match_all("!({$this->_ldl}{$al}block\s(.+?)\s*{$this->_rdl})!", $_content, $s) != - preg_match_all("!({$this->_ldl}{$al}/block\s*{$this->_rdl})!", $_content, $c)) { - $compiler->trigger_template_error('unmatched {block} {/block} pairs'); - } - preg_match_all("!{$this->_ldl}{$al}block\s(.+?)\s*{$this->_rdl}|{$this->_ldl}{$al}/block\s*{$this->_rdl}|{$this->_ldl}\*([\S\s]*?)\*{$this->_rdl}!", $_content, $_result, PREG_OFFSET_CAPTURE); - $_result_count = count($_result[0]); - $_start = 0; - while ($_start+1 < $_result_count) { - $_end = 0; - $_level = 1; - if (($this->mbstring_overload ? mb_substr($_result[0][$_start][0],0,mb_strlen($compiler->smarty->left_delimiter,'latin1')+1, 'latin1') : substr($_result[0][$_start][0],0,strlen($compiler->smarty->left_delimiter)+1)) == $compiler->smarty->left_delimiter.'*') { - $_start++; - continue; - } - while ($_level != 0) { - $_end++; - if (($this->mbstring_overload ? mb_substr($_result[0][$_start + $_end][0],0,mb_strlen($compiler->smarty->left_delimiter,'latin1')+1, 'latin1') : substr($_result[0][$_start + $_end][0],0,strlen($compiler->smarty->left_delimiter)+1)) == $compiler->smarty->left_delimiter.'*') { - continue; - } - if (!strpos($_result[0][$_start + $_end][0], '/')) { - $_level++; - } else { - $_level--; - } - } - $_block_content = str_replace($compiler->smarty->left_delimiter . '$smarty.block.parent' . $compiler->smarty->right_delimiter, '%%%%SMARTY_PARENT%%%%', - ($this->mbstring_overload ? mb_substr($_content, $_result[0][$_start][1] + mb_strlen($_result[0][$_start][0], 'latin1'), $_result[0][$_start + $_end][1] - $_result[0][$_start][1] - + mb_strlen($_result[0][$_start][0], 'latin1'), 'latin1') : substr($_content, $_result[0][$_start][1] + strlen($_result[0][$_start][0]), $_result[0][$_start + $_end][1] - $_result[0][$_start][1] - + strlen($_result[0][$_start][0])))); - Smarty_Internal_Compile_Block::saveBlockData($_block_content, $_result[0][$_start][0], $compiler->template, $filepath); - $_start = $_start + $_end + 1; - } - if ($_template->source->type == 'extends') { - $_template->block_data = $compiler->template->block_data; - } - $compiler->template->source->content = $_template->source->content; - if ($_template->source->type == 'extends') { - $compiler->template->block_data = $_template->block_data; - foreach ($_template->source->components as $key => $component) { - $compiler->template->properties['file_dependency'][$key] = array($component->filepath, $component->timestamp, $component->type); - } - } - $compiler->template->source->filepath = $_template->source->filepath; - $compiler->abort_and_recompile = true; - return ''; - } - -} - -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_include.php b/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_include.php deleted file mode 100644 index 43a144f9..00000000 --- a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_include.php +++ /dev/null @@ -1,215 +0,0 @@ -getAttributes($compiler, $args); - // save posible attributes - $include_file = $_attr['file']; - - if (isset($_attr['assign'])) { - // output will be stored in a smarty variable instead of beind displayed - $_assign = $_attr['assign']; - } - - $_parent_scope = Smarty::SCOPE_LOCAL; - if (isset($_attr['scope'])) { - $_attr['scope'] = trim($_attr['scope'], "'\""); - if ($_attr['scope'] == 'parent') { - $_parent_scope = Smarty::SCOPE_PARENT; - } elseif ($_attr['scope'] == 'root') { - $_parent_scope = Smarty::SCOPE_ROOT; - } elseif ($_attr['scope'] == 'global') { - $_parent_scope = Smarty::SCOPE_GLOBAL; - } - } - $_caching = 'null'; - if ($compiler->nocache || $compiler->tag_nocache) { - $_caching = Smarty::CACHING_OFF; - } - // default for included templates - if ($compiler->template->caching && !$compiler->nocache && !$compiler->tag_nocache) { - $_caching = self::CACHING_NOCACHE_CODE; - } - /* - * if the {include} tag provides individual parameter for caching - * it will not be included into the common cache file and treated like - * a nocache section - */ - if (isset($_attr['cache_lifetime'])) { - $_cache_lifetime = $_attr['cache_lifetime']; - $compiler->tag_nocache = true; - $_caching = Smarty::CACHING_LIFETIME_CURRENT; - } else { - $_cache_lifetime = 'null'; - } - if (isset($_attr['cache_id'])) { - $_cache_id = $_attr['cache_id']; - $compiler->tag_nocache = true; - $_caching = Smarty::CACHING_LIFETIME_CURRENT; - } else { - $_cache_id = '$_smarty_tpl->cache_id'; - } - if (isset($_attr['compile_id'])) { - $_compile_id = $_attr['compile_id']; - } else { - $_compile_id = '$_smarty_tpl->compile_id'; - } - if ($_attr['caching'] === true) { - $_caching = Smarty::CACHING_LIFETIME_CURRENT; - } - if ($_attr['nocache'] === true) { - $compiler->tag_nocache = true; - $_caching = Smarty::CACHING_OFF; - } - - $has_compiled_template = false; - if (($compiler->smarty->merge_compiled_includes || $_attr['inline'] === true) && !$compiler->template->source->recompiled - && !($compiler->template->caching && ($compiler->tag_nocache || $compiler->nocache)) && $_caching != Smarty::CACHING_LIFETIME_CURRENT) { - // check if compiled code can be merged (contains no variable part) - if (!$compiler->has_variable_string && (substr_count($include_file, '"') == 2 or substr_count($include_file, "'") == 2) - and substr_count($include_file, '(') == 0 and substr_count($include_file, '$_smarty_tpl->') == 0) { - $tpl_name = null; - eval("\$tpl_name = $include_file;"); - if (!isset($compiler->smarty->merged_templates_func[$tpl_name]) || $compiler->inheritance) { - $tpl = new $compiler->smarty->template_class ($tpl_name, $compiler->smarty, $compiler->template, $compiler->template->cache_id, $compiler->template->compile_id); - // save unique function name - $compiler->smarty->merged_templates_func[$tpl_name]['func'] = $tpl->properties['unifunc'] = 'content_'. str_replace('.', '_', uniqid('', true)); - // use current nocache hash for inlined code - $compiler->smarty->merged_templates_func[$tpl_name]['nocache_hash'] = $tpl->properties['nocache_hash'] = $compiler->template->properties['nocache_hash']; - if ($compiler->template->caching) { - // needs code for cached page but no cache file - $tpl->caching = self::CACHING_NOCACHE_CODE; - } - // make sure whole chain gest compiled - $tpl->mustCompile = true; - if (!($tpl->source->uncompiled) && $tpl->source->exists) { - // get compiled code - $compiled_code = $tpl->compiler->compileTemplate($tpl); - // release compiler object to free memory - unset($tpl->compiler); - // merge compiled code for {function} tags - $compiler->template->properties['function'] = array_merge($compiler->template->properties['function'], $tpl->properties['function']); - // merge filedependency - $tpl->properties['file_dependency'][$tpl->source->uid] = array($tpl->source->filepath, $tpl->source->timestamp,$tpl->source->type); - $compiler->template->properties['file_dependency'] = array_merge($compiler->template->properties['file_dependency'], $tpl->properties['file_dependency']); - // remove header code - $compiled_code = preg_replace("/(<\?php \/\*%%SmartyHeaderCode:{$tpl->properties['nocache_hash']}%%\*\/(.+?)\/\*\/%%SmartyHeaderCode%%\*\/\?>\n)/s", '', $compiled_code); - if ($tpl->has_nocache_code) { - // replace nocache_hash - $compiled_code = str_replace("{$tpl->properties['nocache_hash']}", $compiler->template->properties['nocache_hash'], $compiled_code); - $compiler->template->has_nocache_code = true; - } - $compiler->merged_templates[$tpl->properties['unifunc']] = $compiled_code; - $has_compiled_template = true; - } - } else { - $has_compiled_template = true; - } - } - } - // delete {include} standard attributes - unset($_attr['file'], $_attr['assign'], $_attr['cache_id'], $_attr['compile_id'], $_attr['cache_lifetime'], $_attr['nocache'], $_attr['caching'], $_attr['scope'], $_attr['inline']); - // remaining attributes must be assigned as smarty variable - if (!empty($_attr)) { - if ($_parent_scope == Smarty::SCOPE_LOCAL) { - // create variables - foreach ($_attr as $key => $value) { - $_pairs[] = "'$key'=>$value"; - } - $_vars = 'array('.join(',',$_pairs).')'; - $_has_vars = true; - } else { - $compiler->trigger_template_error('variable passing not allowed in parent/global scope', $compiler->lex->taglineno); - } - } else { - $_vars = 'array()'; - $_has_vars = false; - } - if ($has_compiled_template) { - $_hash = $compiler->smarty->merged_templates_func[$tpl_name]['nocache_hash']; - $_output = "setupInlineSubTemplate($include_file, $_cache_id, $_compile_id, $_caching, $_cache_lifetime, $_vars, $_parent_scope, '$_hash');\n"; - if (isset($_assign)) { - $_output .= 'ob_start(); '; - } - $_output .= $compiler->smarty->merged_templates_func[$tpl_name]['func']. "(\$_smarty_tpl);\n"; - $_output .= "\$_smarty_tpl = array_pop(\$_tpl_stack); "; - if (isset($_assign)) { - $_output .= " \$_smarty_tpl->tpl_vars[$_assign] = new Smarty_variable(ob_get_clean());"; - } - $_output .= "/* End of included template \"" . $tpl_name . "\" */?>"; - return $_output; - } - - // was there an assign attribute - if (isset($_assign)) { - $_output = "tpl_vars[$_assign] = new Smarty_variable(\$_smarty_tpl->getSubTemplate ($include_file, $_cache_id, $_compile_id, $_caching, $_cache_lifetime, $_vars, $_parent_scope));?>\n";; - } else { - $_output = "getSubTemplate ($include_file, $_cache_id, $_compile_id, $_caching, $_cache_lifetime, $_vars, $_parent_scope);?>\n"; - } - return $_output; - } - -} - -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_resource_extends.php b/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_resource_extends.php deleted file mode 100644 index 29734ae0..00000000 --- a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_resource_extends.php +++ /dev/null @@ -1,162 +0,0 @@ -name); - $exists = true; - foreach ($components as $component) { - $s = Smarty_Resource::source(null, $source->smarty, $component); - if ($s->type == 'php') { - throw new SmartyException("Resource type {$s->type} cannot be used with the extends resource type"); - } - $sources[$s->uid] = $s; - $uid .= $s->filepath; - if ($_template && $_template->smarty->compile_check) { - $exists = $exists && $s->exists; - } - } - $source->components = $sources; - $source->filepath = $s->filepath; - $source->uid = sha1($uid); - if ($_template && $_template->smarty->compile_check) { - $source->timestamp = $s->timestamp; - $source->exists = $exists; - } - // need the template at getContent() - $source->template = $_template; - } - - /** - * populate Source Object with timestamp and exists from Resource - * - * @param Smarty_Template_Source $source source object - */ - public function populateTimestamp(Smarty_Template_Source $source) - { - $source->exists = true; - foreach ($source->components as $s) { - $source->exists = $source->exists && $s->exists; - } - $source->timestamp = $s->timestamp; - } - - /** - * Load template's source from files into current template object - * - * @param Smarty_Template_Source $source source object - * @return string template source - * @throws SmartyException if source cannot be loaded - */ - public function getContent(Smarty_Template_Source $source) - { - if (!$source->exists) { - throw new SmartyException("Unable to read template {$source->type} '{$source->name}'"); - } - - $this->mbstring_overload = ini_get('mbstring.func_overload') & 2; - $_rdl = preg_quote($source->smarty->right_delimiter); - $_ldl = preg_quote($source->smarty->left_delimiter); - if (!$source->smarty->auto_literal) { - $al = '\s*'; - } else { - $al = ''; - } - $_components = array_reverse($source->components); - $_first = reset($_components); - $_last = end($_components); - - foreach ($_components as $_component) { - // register dependency - if ($_component != $_first) { - $source->template->properties['file_dependency'][$_component->uid] = array($_component->filepath, $_component->timestamp, $_component->type); - } - - // read content - $source->filepath = $_component->filepath; - $_content = $_component->content; - - // extend sources - if ($_component != $_last) { - if (preg_match_all("!({$_ldl}{$al}block\s(.+?)\s*{$_rdl})!", $_content, $_open) != - preg_match_all("!({$_ldl}{$al}/block\s*{$_rdl})!", $_content, $_close)) { - throw new SmartyException("unmatched {block} {/block} pairs in template {$_component->type} '{$_component->name}'"); - } - preg_match_all("!{$_ldl}{$al}block\s(.+?)\s*{$_rdl}|{$_ldl}{$al}/block\s*{$_rdl}|{$_ldl}\*([\S\s]*?)\*{$_rdl}!", $_content, $_result, PREG_OFFSET_CAPTURE); - $_result_count = count($_result[0]); - $_start = 0; - while ($_start+1 < $_result_count) { - $_end = 0; - $_level = 1; - if (($this->mbstring_overload ? mb_substr($_result[0][$_start][0],0,mb_strlen($source->smarty->left_delimiter,'latin1')+1, 'latin1') : substr($_result[0][$_start][0],0,strlen($source->smarty->left_delimiter)+1)) == $source->smarty->left_delimiter.'*') { - $_start++; - continue; - } - while ($_level != 0) { - $_end++; - if (($this->mbstring_overload ? mb_substr($_result[0][$_start + $_end][0],0,mb_strlen($source->smarty->left_delimiter,'latin1')+1, 'latin1') : substr($_result[0][$_start + $_end][0],0,strlen($source->smarty->left_delimiter)+1)) == $source->smarty->left_delimiter.'*') { - continue; - } - if (!strpos($_result[0][$_start + $_end][0], '/')) { - $_level++; - } else { - $_level--; - } - } - $_block_content = str_replace($source->smarty->left_delimiter . '$smarty.block.parent' . $source->smarty->right_delimiter, '%%%%SMARTY_PARENT%%%%', - ($this->mbstring_overload ? mb_substr($_content, $_result[0][$_start][1] + mb_strlen($_result[0][$_start][0], 'latin1'), $_result[0][$_start + $_end][1] - $_result[0][$_start][1] - + mb_strlen($_result[0][$_start][0], 'latin1'), 'latin1') : substr($_content, $_result[0][$_start][1] + strlen($_result[0][$_start][0]), $_result[0][$_start + $_end][1] - $_result[0][$_start][1] - + strlen($_result[0][$_start][0])))); - Smarty_Internal_Compile_Block::saveBlockData($_block_content, $_result[0][$_start][0], $source->template, $_component->filepath); - $_start = $_start + $_end + 1; - } - } else { - return $_content; - } - } - } - - /** - * Determine basename for compiled filename - * - * @param Smarty_Template_Source $source source object - * @return string resource's basename - */ - public function getBasename(Smarty_Template_Source $source) - { - return str_replace(':', '.', basename($source->filepath)); - } - -} - -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_templateparser.php b/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_templateparser.php deleted file mode 100644 index d67be6e6..00000000 --- a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_templateparser.php +++ /dev/null @@ -1,3254 +0,0 @@ -string = $s->string; - $this->metadata = $s->metadata; - } else { - $this->string = (string) $s; - if ($m instanceof TP_yyToken) { - $this->metadata = $m->metadata; - } elseif (is_array($m)) { - $this->metadata = $m; - } - } - } - - function __toString() - { - return $this->_string; - } - - function offsetExists($offset) - { - return isset($this->metadata[$offset]); - } - - function offsetGet($offset) - { - return $this->metadata[$offset]; - } - - function offsetSet($offset, $value) - { - if ($offset === null) { - if (isset($value[0])) { - $x = ($value instanceof TP_yyToken) ? - $value->metadata : $value; - $this->metadata = array_merge($this->metadata, $x); - return; - } - $offset = count($this->metadata); - } - if ($value === null) { - return; - } - if ($value instanceof TP_yyToken) { - if ($value->metadata) { - $this->metadata[$offset] = $value->metadata; - } - } elseif ($value) { - $this->metadata[$offset] = $value; - } - } - - function offsetUnset($offset) - { - unset($this->metadata[$offset]); - } -} - -class TP_yyStackEntry -{ - public $stateno; /* The state-number */ - public $major; /* The major token value. This is the code - ** number for the token at this stack level */ - public $minor; /* The user-supplied minor token value. This - ** is the value of the token */ -}; - - -#line 12 "smarty_internal_templateparser.y" -class Smarty_Internal_Templateparser#line 79 "smarty_internal_templateparser.php" -{ -#line 14 "smarty_internal_templateparser.y" - - const Err1 = "Security error: Call to private object member not allowed"; - const Err2 = "Security error: Call to dynamic object member not allowed"; - const Err3 = "PHP in template not allowed. Use SmartyBC to enable it"; - // states whether the parse was successful or not - public $successful = true; - public $retvalue = 0; - private $lex; - private $internalError = false; - private $strip = false; - - function __construct($lex, $compiler) { - $this->lex = $lex; - $this->compiler = $compiler; - $this->smarty = $this->compiler->smarty; - $this->template = $this->compiler->template; - $this->compiler->has_variable_string = false; - $this->compiler->prefix_code = array(); - $this->prefix_number = 0; - $this->block_nesting_level = 0; - if ($this->security = isset($this->smarty->security_policy)) { - $this->php_handling = $this->smarty->security_policy->php_handling; - } else { - $this->php_handling = $this->smarty->php_handling; - } - $this->is_xml = false; - $this->asp_tags = (ini_get('asp_tags') != '0'); - $this->current_buffer = $this->root_buffer = new _smarty_template_buffer($this); - } - - public static function escape_start_tag($tag_text) { - $tag = preg_replace('/\A<\?(.*)\z/', '<?\1', $tag_text, -1 , $count); //Escape tag - return $tag; - } - - public static function escape_end_tag($tag_text) { - return '?>'; - } - - public function compileVariable($variable) { - if (strpos($variable,'(') == 0) { - // not a variable variable - $var = trim($variable,'\''); - $this->compiler->tag_nocache=$this->compiler->tag_nocache|$this->template->getVariable($var, null, true, false)->nocache; - $this->template->properties['variables'][$var] = $this->compiler->tag_nocache|$this->compiler->nocache; - } -// return '(isset($_smarty_tpl->tpl_vars['. $variable .'])?$_smarty_tpl->tpl_vars['. $variable .']->value:$_smarty_tpl->getVariable('. $variable .')->value)'; - return '$_smarty_tpl->tpl_vars['. $variable .']->value'; - } -#line 132 "smarty_internal_templateparser.php" - - const TP_VERT = 1; - const TP_COLON = 2; - const TP_COMMENT = 3; - const TP_PHPSTARTTAG = 4; - const TP_PHPENDTAG = 5; - const TP_ASPSTARTTAG = 6; - const TP_ASPENDTAG = 7; - const TP_FAKEPHPSTARTTAG = 8; - const TP_XMLTAG = 9; - const TP_TEXT = 10; - const TP_STRIPON = 11; - const TP_STRIPOFF = 12; - const TP_LITERALSTART = 13; - const TP_LITERALEND = 14; - const TP_LITERAL = 15; - const TP_LDEL = 16; - const TP_RDEL = 17; - const TP_DOLLAR = 18; - const TP_ID = 19; - const TP_EQUAL = 20; - const TP_PTR = 21; - const TP_LDELIF = 22; - const TP_LDELFOR = 23; - const TP_SEMICOLON = 24; - const TP_INCDEC = 25; - const TP_TO = 26; - const TP_STEP = 27; - const TP_LDELFOREACH = 28; - const TP_SPACE = 29; - const TP_AS = 30; - const TP_APTR = 31; - const TP_LDELSETFILTER = 32; - const TP_SMARTYBLOCKCHILD = 33; - const TP_LDELSLASH = 34; - const TP_ATTR = 35; - const TP_INTEGER = 36; - const TP_COMMA = 37; - const TP_OPENP = 38; - const TP_CLOSEP = 39; - const TP_MATH = 40; - const TP_UNIMATH = 41; - const TP_ANDSYM = 42; - const TP_ISIN = 43; - const TP_ISDIVBY = 44; - const TP_ISNOTDIVBY = 45; - const TP_ISEVEN = 46; - const TP_ISNOTEVEN = 47; - const TP_ISEVENBY = 48; - const TP_ISNOTEVENBY = 49; - const TP_ISODD = 50; - const TP_ISNOTODD = 51; - const TP_ISODDBY = 52; - const TP_ISNOTODDBY = 53; - const TP_INSTANCEOF = 54; - const TP_QMARK = 55; - const TP_NOT = 56; - const TP_TYPECAST = 57; - const TP_HEX = 58; - const TP_DOT = 59; - const TP_SINGLEQUOTESTRING = 60; - const TP_DOUBLECOLON = 61; - const TP_AT = 62; - const TP_HATCH = 63; - const TP_OPENB = 64; - const TP_CLOSEB = 65; - const TP_EQUALS = 66; - const TP_NOTEQUALS = 67; - const TP_GREATERTHAN = 68; - const TP_LESSTHAN = 69; - const TP_GREATEREQUAL = 70; - const TP_LESSEQUAL = 71; - const TP_IDENTITY = 72; - const TP_NONEIDENTITY = 73; - const TP_MOD = 74; - const TP_LAND = 75; - const TP_LOR = 76; - const TP_LXOR = 77; - const TP_QUOTE = 78; - const TP_BACKTICK = 79; - const TP_DOLLARID = 80; - const YY_NO_ACTION = 597; - const YY_ACCEPT_ACTION = 596; - const YY_ERROR_ACTION = 595; - - const YY_SZ_ACTTAB = 2383; -static public $yy_action = array( - /* 0 */ 225, 275, 263, 276, 259, 257, 260, 390, 356, 359, - /* 10 */ 353, 193, 18, 127, 42, 317, 381, 351, 196, 350, - /* 20 */ 6, 108, 24, 98, 128, 190, 134, 318, 41, 41, - /* 30 */ 249, 329, 231, 18, 43, 43, 317, 26, 298, 50, - /* 40 */ 47, 48, 44, 10, 13, 305, 306, 12, 11, 340, - /* 50 */ 341, 40, 20, 387, 308, 307, 309, 374, 254, 248, - /* 60 */ 252, 217, 193, 385, 291, 375, 376, 377, 373, 372, - /* 70 */ 368, 367, 369, 370, 371, 378, 379, 225, 312, 255, - /* 80 */ 225, 225, 118, 2, 207, 76, 135, 596, 95, 281, - /* 90 */ 271, 264, 2, 366, 315, 386, 461, 383, 232, 294, - /* 100 */ 303, 388, 313, 389, 227, 41, 144, 225, 461, 245, - /* 110 */ 282, 43, 218, 358, 461, 144, 50, 47, 48, 44, - /* 120 */ 10, 13, 305, 306, 12, 11, 340, 341, 40, 20, - /* 130 */ 105, 177, 522, 46, 46, 41, 19, 522, 143, 297, - /* 140 */ 325, 43, 375, 376, 377, 373, 372, 368, 367, 369, - /* 150 */ 370, 371, 378, 379, 225, 312, 293, 206, 225, 141, - /* 160 */ 124, 225, 54, 119, 123, 225, 459, 38, 173, 246, - /* 170 */ 319, 315, 386, 347, 455, 232, 294, 303, 459, 313, - /* 180 */ 139, 321, 41, 31, 459, 41, 41, 2, 43, 188, - /* 190 */ 2, 43, 43, 50, 47, 48, 44, 10, 13, 305, - /* 200 */ 306, 12, 11, 340, 341, 40, 20, 225, 136, 301, - /* 210 */ 144, 194, 350, 144, 46, 202, 206, 328, 198, 375, - /* 220 */ 376, 377, 373, 372, 368, 367, 369, 370, 371, 378, - /* 230 */ 379, 21, 9, 28, 185, 41, 318, 225, 265, 271, - /* 240 */ 264, 43, 206, 27, 173, 206, 50, 47, 48, 44, - /* 250 */ 10, 13, 305, 306, 12, 11, 340, 341, 40, 20, - /* 260 */ 225, 178, 18, 212, 330, 317, 17, 32, 8, 14, - /* 270 */ 325, 267, 375, 376, 377, 373, 372, 368, 367, 369, - /* 280 */ 370, 371, 378, 379, 136, 363, 363, 207, 41, 4, - /* 290 */ 46, 5, 131, 233, 43, 25, 186, 289, 318, 50, - /* 300 */ 47, 48, 44, 10, 13, 305, 306, 12, 11, 340, - /* 310 */ 341, 40, 20, 225, 100, 161, 18, 355, 361, 317, - /* 320 */ 26, 109, 360, 346, 325, 375, 376, 377, 373, 372, - /* 330 */ 368, 367, 369, 370, 371, 378, 379, 106, 201, 172, - /* 340 */ 25, 206, 288, 25, 18, 261, 181, 317, 325, 45, - /* 350 */ 339, 129, 50, 47, 48, 44, 10, 13, 305, 306, - /* 360 */ 12, 11, 340, 341, 40, 20, 225, 104, 162, 18, - /* 370 */ 16, 205, 317, 206, 248, 238, 43, 325, 375, 376, - /* 380 */ 377, 373, 372, 368, 367, 369, 370, 371, 378, 379, - /* 390 */ 255, 354, 243, 229, 206, 342, 18, 239, 242, 241, - /* 400 */ 248, 266, 300, 330, 240, 50, 47, 48, 44, 10, - /* 410 */ 13, 305, 306, 12, 11, 340, 341, 40, 20, 225, - /* 420 */ 165, 176, 184, 18, 18, 18, 253, 215, 251, 325, - /* 430 */ 325, 375, 376, 377, 373, 372, 368, 367, 369, 370, - /* 440 */ 371, 378, 379, 304, 268, 159, 207, 207, 247, 206, - /* 450 */ 148, 41, 195, 350, 325, 27, 33, 43, 50, 47, - /* 460 */ 48, 44, 10, 13, 305, 306, 12, 11, 340, 341, - /* 470 */ 40, 20, 163, 225, 328, 199, 133, 29, 187, 23, - /* 480 */ 250, 325, 101, 225, 375, 376, 377, 373, 372, 368, - /* 490 */ 367, 369, 370, 371, 378, 379, 225, 298, 207, 334, - /* 500 */ 225, 45, 312, 103, 299, 192, 154, 364, 18, 302, - /* 510 */ 135, 317, 285, 35, 173, 203, 320, 3, 236, 6, - /* 520 */ 108, 41, 232, 294, 303, 134, 313, 43, 130, 249, - /* 530 */ 329, 231, 250, 225, 280, 50, 47, 48, 44, 10, - /* 540 */ 13, 305, 306, 12, 11, 340, 341, 40, 20, 336, - /* 550 */ 36, 166, 212, 230, 332, 228, 338, 8, 132, 330, - /* 560 */ 325, 375, 376, 377, 373, 372, 368, 367, 369, 370, - /* 570 */ 371, 378, 379, 225, 312, 345, 37, 362, 141, 312, - /* 580 */ 94, 77, 135, 156, 236, 182, 173, 135, 122, 204, - /* 590 */ 315, 386, 365, 225, 232, 294, 303, 137, 313, 232, - /* 600 */ 294, 303, 125, 313, 41, 222, 333, 180, 277, 337, - /* 610 */ 43, 225, 50, 47, 48, 44, 10, 13, 305, 306, - /* 620 */ 12, 11, 340, 341, 40, 20, 136, 335, 316, 5, - /* 630 */ 22, 197, 269, 34, 173, 148, 126, 116, 375, 376, - /* 640 */ 377, 373, 372, 368, 367, 369, 370, 371, 378, 379, - /* 650 */ 225, 312, 298, 225, 292, 141, 312, 258, 77, 135, - /* 660 */ 153, 183, 318, 301, 135, 175, 284, 315, 386, 461, - /* 670 */ 117, 232, 294, 303, 325, 313, 232, 294, 303, 382, - /* 680 */ 313, 461, 220, 110, 329, 298, 318, 461, 329, 50, - /* 690 */ 47, 48, 44, 10, 13, 305, 306, 12, 11, 340, - /* 700 */ 341, 40, 20, 225, 30, 191, 46, 189, 314, 107, - /* 710 */ 329, 329, 146, 97, 102, 375, 376, 377, 373, 372, - /* 720 */ 368, 367, 369, 370, 371, 378, 379, 298, 298, 298, - /* 730 */ 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, - /* 740 */ 329, 329, 50, 47, 48, 44, 10, 13, 305, 306, - /* 750 */ 12, 11, 340, 341, 40, 20, 225, 329, 329, 329, - /* 760 */ 329, 329, 329, 329, 329, 114, 160, 115, 375, 376, - /* 770 */ 377, 373, 372, 368, 367, 369, 370, 371, 378, 379, - /* 780 */ 298, 298, 298, 329, 329, 329, 329, 329, 329, 329, - /* 790 */ 329, 329, 329, 329, 283, 50, 47, 48, 44, 10, - /* 800 */ 13, 305, 306, 12, 11, 340, 341, 40, 20, 329, - /* 810 */ 225, 329, 329, 329, 329, 329, 329, 329, 329, 329, - /* 820 */ 329, 375, 376, 377, 373, 372, 368, 367, 369, 370, - /* 830 */ 371, 378, 379, 200, 329, 329, 329, 329, 329, 329, - /* 840 */ 329, 329, 329, 329, 329, 329, 329, 329, 329, 50, - /* 850 */ 47, 48, 44, 10, 13, 305, 306, 12, 11, 340, - /* 860 */ 341, 40, 20, 225, 329, 329, 329, 329, 329, 329, - /* 870 */ 329, 329, 329, 329, 329, 375, 376, 377, 373, 372, - /* 880 */ 368, 367, 369, 370, 371, 378, 379, 329, 329, 329, - /* 890 */ 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, - /* 900 */ 329, 329, 50, 47, 48, 44, 10, 13, 305, 306, - /* 910 */ 12, 11, 340, 341, 40, 20, 329, 329, 329, 329, - /* 920 */ 329, 329, 329, 329, 329, 329, 329, 290, 375, 376, - /* 930 */ 377, 373, 372, 368, 367, 369, 370, 371, 378, 379, - /* 940 */ 225, 312, 329, 225, 329, 141, 312, 329, 77, 135, - /* 950 */ 152, 329, 329, 329, 135, 158, 208, 315, 386, 458, - /* 960 */ 329, 232, 294, 303, 325, 313, 232, 294, 303, 329, - /* 970 */ 313, 458, 223, 329, 329, 329, 318, 458, 329, 50, - /* 980 */ 47, 48, 44, 10, 13, 305, 306, 12, 11, 340, - /* 990 */ 341, 40, 20, 225, 329, 329, 46, 329, 329, 329, - /* 1000 */ 329, 329, 329, 329, 329, 375, 376, 377, 373, 372, - /* 1010 */ 368, 367, 369, 370, 371, 378, 379, 329, 329, 329, - /* 1020 */ 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, - /* 1030 */ 329, 329, 50, 47, 48, 44, 10, 13, 305, 306, - /* 1040 */ 12, 11, 340, 341, 40, 20, 329, 329, 329, 329, - /* 1050 */ 329, 329, 329, 329, 329, 329, 329, 329, 375, 376, - /* 1060 */ 377, 373, 372, 368, 367, 369, 370, 371, 378, 379, - /* 1070 */ 329, 329, 329, 50, 47, 48, 44, 10, 13, 305, - /* 1080 */ 306, 12, 11, 340, 341, 40, 20, 329, 329, 329, - /* 1090 */ 329, 329, 329, 329, 329, 329, 329, 329, 329, 375, - /* 1100 */ 376, 377, 373, 372, 368, 367, 369, 370, 371, 378, - /* 1110 */ 379, 329, 329, 329, 329, 329, 42, 329, 145, 211, - /* 1120 */ 329, 329, 6, 108, 329, 279, 329, 312, 134, 329, - /* 1130 */ 329, 150, 249, 329, 231, 135, 235, 41, 39, 329, - /* 1140 */ 329, 52, 329, 43, 311, 329, 312, 232, 294, 303, - /* 1150 */ 147, 313, 329, 170, 135, 329, 51, 49, 331, 237, - /* 1160 */ 296, 329, 325, 106, 1, 278, 232, 294, 303, 329, - /* 1170 */ 313, 155, 329, 42, 318, 145, 216, 329, 96, 6, - /* 1180 */ 108, 18, 329, 226, 317, 134, 329, 313, 329, 249, - /* 1190 */ 329, 231, 329, 235, 41, 39, 256, 329, 52, 329, - /* 1200 */ 43, 329, 312, 329, 329, 329, 141, 329, 329, 66, - /* 1210 */ 119, 238, 329, 51, 49, 331, 237, 296, 315, 386, - /* 1220 */ 106, 1, 232, 294, 303, 329, 313, 270, 329, 329, - /* 1230 */ 42, 329, 140, 92, 329, 96, 6, 108, 18, 41, - /* 1240 */ 169, 317, 134, 329, 273, 43, 249, 329, 231, 325, - /* 1250 */ 235, 41, 39, 244, 329, 52, 41, 43, 329, 312, - /* 1260 */ 329, 318, 43, 141, 329, 329, 67, 135, 225, 329, - /* 1270 */ 51, 49, 331, 237, 296, 315, 386, 106, 1, 224, - /* 1280 */ 294, 303, 329, 313, 310, 329, 329, 42, 329, 145, - /* 1290 */ 213, 329, 96, 6, 108, 329, 41, 329, 329, 134, - /* 1300 */ 329, 323, 43, 249, 329, 231, 329, 235, 329, 39, - /* 1310 */ 329, 329, 52, 41, 329, 329, 312, 329, 329, 43, - /* 1320 */ 141, 46, 329, 86, 135, 329, 329, 51, 49, 331, - /* 1330 */ 237, 296, 315, 386, 106, 1, 232, 294, 303, 329, - /* 1340 */ 313, 274, 329, 329, 42, 329, 142, 216, 329, 96, - /* 1350 */ 6, 108, 329, 41, 329, 329, 134, 329, 348, 43, - /* 1360 */ 249, 329, 231, 329, 235, 329, 7, 329, 329, 52, - /* 1370 */ 41, 329, 329, 312, 329, 329, 43, 141, 329, 329, - /* 1380 */ 90, 135, 329, 329, 51, 49, 331, 237, 296, 315, - /* 1390 */ 386, 106, 1, 232, 294, 303, 329, 313, 295, 329, - /* 1400 */ 329, 42, 329, 138, 216, 329, 96, 6, 108, 329, - /* 1410 */ 41, 329, 329, 134, 329, 322, 43, 249, 329, 231, - /* 1420 */ 329, 235, 329, 39, 329, 329, 52, 41, 329, 329, - /* 1430 */ 312, 329, 329, 43, 141, 329, 329, 87, 135, 329, - /* 1440 */ 329, 51, 49, 331, 237, 296, 315, 386, 106, 1, - /* 1450 */ 232, 294, 303, 329, 313, 384, 329, 329, 42, 329, - /* 1460 */ 131, 216, 329, 96, 6, 108, 329, 41, 329, 329, - /* 1470 */ 134, 329, 380, 43, 249, 329, 231, 329, 235, 329, - /* 1480 */ 15, 329, 329, 52, 41, 329, 329, 312, 329, 329, - /* 1490 */ 43, 141, 329, 329, 79, 135, 329, 329, 51, 49, - /* 1500 */ 331, 237, 296, 315, 386, 106, 1, 232, 294, 303, - /* 1510 */ 329, 313, 272, 329, 329, 42, 329, 145, 210, 329, - /* 1520 */ 96, 6, 108, 329, 41, 329, 329, 134, 329, 349, - /* 1530 */ 43, 249, 329, 231, 329, 221, 329, 39, 329, 329, - /* 1540 */ 52, 41, 329, 329, 312, 329, 329, 43, 141, 329, - /* 1550 */ 329, 70, 135, 329, 329, 51, 49, 331, 237, 296, - /* 1560 */ 315, 386, 106, 1, 232, 294, 303, 329, 313, 324, - /* 1570 */ 329, 329, 42, 329, 145, 209, 329, 96, 6, 108, - /* 1580 */ 329, 41, 329, 329, 134, 329, 326, 43, 249, 329, - /* 1590 */ 231, 329, 235, 329, 39, 329, 329, 52, 41, 329, - /* 1600 */ 329, 312, 329, 329, 43, 141, 329, 329, 74, 135, - /* 1610 */ 329, 329, 51, 49, 331, 237, 296, 315, 386, 106, - /* 1620 */ 1, 232, 294, 303, 329, 313, 262, 329, 329, 42, - /* 1630 */ 329, 131, 214, 329, 96, 6, 108, 329, 41, 329, - /* 1640 */ 329, 134, 329, 327, 43, 249, 329, 231, 329, 235, - /* 1650 */ 329, 15, 329, 329, 52, 41, 329, 329, 312, 329, - /* 1660 */ 329, 43, 141, 329, 329, 53, 135, 329, 329, 51, - /* 1670 */ 49, 331, 237, 296, 315, 386, 106, 329, 232, 294, - /* 1680 */ 303, 329, 313, 286, 329, 329, 42, 329, 131, 216, - /* 1690 */ 329, 96, 6, 108, 329, 41, 329, 329, 134, 329, - /* 1700 */ 343, 43, 249, 329, 231, 329, 235, 329, 15, 329, - /* 1710 */ 329, 52, 41, 329, 329, 312, 329, 329, 43, 118, - /* 1720 */ 329, 329, 76, 135, 329, 329, 51, 49, 331, 237, - /* 1730 */ 296, 315, 386, 106, 329, 232, 294, 303, 329, 313, - /* 1740 */ 329, 329, 329, 329, 504, 329, 329, 329, 96, 329, - /* 1750 */ 357, 504, 329, 504, 504, 364, 504, 504, 329, 329, - /* 1760 */ 329, 35, 504, 329, 504, 2, 504, 6, 108, 329, - /* 1770 */ 198, 174, 329, 134, 329, 329, 329, 249, 329, 231, - /* 1780 */ 325, 504, 329, 21, 9, 329, 329, 329, 144, 329, - /* 1790 */ 329, 329, 504, 329, 312, 99, 179, 206, 141, 329, - /* 1800 */ 329, 58, 135, 329, 329, 325, 504, 329, 21, 9, - /* 1810 */ 315, 386, 329, 312, 232, 294, 303, 141, 313, 329, - /* 1820 */ 71, 135, 206, 344, 37, 362, 329, 329, 329, 315, - /* 1830 */ 386, 329, 329, 232, 294, 303, 312, 313, 329, 329, - /* 1840 */ 141, 329, 329, 72, 135, 329, 329, 312, 329, 329, - /* 1850 */ 329, 141, 315, 386, 65, 135, 232, 294, 303, 329, - /* 1860 */ 313, 329, 329, 315, 386, 329, 329, 232, 294, 303, - /* 1870 */ 329, 313, 329, 329, 312, 198, 167, 329, 141, 329, - /* 1880 */ 329, 69, 135, 329, 329, 325, 329, 329, 21, 9, - /* 1890 */ 315, 386, 329, 329, 232, 294, 303, 312, 313, 329, - /* 1900 */ 329, 141, 206, 329, 85, 135, 329, 312, 329, 329, - /* 1910 */ 329, 149, 329, 315, 386, 135, 312, 232, 294, 303, - /* 1920 */ 141, 313, 329, 81, 135, 329, 329, 232, 294, 303, - /* 1930 */ 329, 313, 315, 386, 329, 329, 232, 294, 303, 312, - /* 1940 */ 313, 329, 329, 141, 329, 329, 82, 135, 329, 329, - /* 1950 */ 312, 329, 329, 329, 141, 315, 386, 63, 135, 232, - /* 1960 */ 294, 303, 329, 313, 329, 329, 315, 386, 329, 329, - /* 1970 */ 232, 294, 303, 329, 313, 329, 312, 329, 329, 329, - /* 1980 */ 141, 329, 329, 73, 135, 329, 329, 312, 329, 329, - /* 1990 */ 329, 141, 315, 386, 83, 135, 232, 294, 303, 329, - /* 2000 */ 313, 329, 329, 315, 386, 329, 312, 232, 294, 303, - /* 2010 */ 141, 313, 329, 89, 135, 329, 329, 329, 329, 329, - /* 2020 */ 329, 329, 315, 386, 329, 312, 232, 294, 303, 111, - /* 2030 */ 313, 329, 68, 135, 329, 329, 312, 329, 329, 329, - /* 2040 */ 141, 315, 386, 62, 135, 232, 294, 303, 329, 313, - /* 2050 */ 329, 329, 315, 386, 329, 329, 232, 294, 303, 329, - /* 2060 */ 313, 329, 312, 329, 329, 329, 141, 329, 329, 61, - /* 2070 */ 135, 329, 329, 312, 329, 329, 329, 141, 315, 386, - /* 2080 */ 91, 135, 232, 294, 303, 329, 313, 329, 329, 315, - /* 2090 */ 386, 329, 312, 232, 294, 303, 141, 313, 329, 78, - /* 2100 */ 135, 329, 329, 329, 329, 329, 329, 329, 315, 386, - /* 2110 */ 329, 312, 232, 294, 303, 141, 313, 329, 66, 135, - /* 2120 */ 329, 329, 312, 329, 329, 329, 141, 315, 386, 80, - /* 2130 */ 135, 232, 294, 303, 329, 313, 329, 329, 315, 386, - /* 2140 */ 329, 329, 232, 294, 303, 329, 313, 329, 312, 329, - /* 2150 */ 329, 329, 113, 329, 329, 88, 135, 329, 329, 312, - /* 2160 */ 329, 329, 329, 112, 315, 386, 84, 135, 232, 294, - /* 2170 */ 303, 329, 313, 329, 329, 315, 386, 329, 312, 232, - /* 2180 */ 294, 303, 141, 313, 329, 57, 135, 329, 329, 329, - /* 2190 */ 329, 329, 329, 329, 315, 386, 329, 312, 232, 294, - /* 2200 */ 303, 93, 313, 329, 59, 121, 329, 329, 312, 329, - /* 2210 */ 329, 329, 141, 315, 386, 75, 135, 232, 294, 303, - /* 2220 */ 329, 313, 329, 329, 315, 386, 329, 329, 232, 294, - /* 2230 */ 303, 329, 313, 329, 312, 329, 329, 329, 141, 329, - /* 2240 */ 329, 60, 135, 329, 329, 312, 329, 329, 329, 141, - /* 2250 */ 315, 386, 64, 135, 232, 294, 303, 329, 313, 329, - /* 2260 */ 329, 315, 386, 329, 312, 232, 294, 303, 120, 313, - /* 2270 */ 329, 55, 135, 329, 329, 329, 329, 329, 329, 329, - /* 2280 */ 315, 386, 329, 312, 232, 294, 303, 93, 313, 329, - /* 2290 */ 56, 121, 225, 329, 312, 329, 198, 164, 157, 315, - /* 2300 */ 386, 329, 135, 219, 294, 303, 325, 313, 352, 21, - /* 2310 */ 9, 287, 234, 329, 232, 294, 303, 329, 313, 329, - /* 2320 */ 41, 329, 329, 206, 312, 329, 43, 329, 151, 2, - /* 2330 */ 329, 329, 135, 329, 329, 329, 329, 329, 329, 329, - /* 2340 */ 198, 168, 329, 329, 232, 294, 303, 329, 313, 329, - /* 2350 */ 325, 329, 144, 21, 9, 198, 171, 329, 329, 329, - /* 2360 */ 329, 329, 329, 329, 329, 325, 329, 206, 21, 9, - /* 2370 */ 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, - /* 2380 */ 329, 329, 206, - ); - static public $yy_lookahead = array( - /* 0 */ 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, - /* 10 */ 12, 13, 16, 98, 16, 19, 17, 17, 113, 114, - /* 20 */ 22, 23, 16, 97, 18, 19, 28, 112, 29, 29, - /* 30 */ 32, 33, 34, 16, 35, 35, 19, 20, 112, 40, - /* 40 */ 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, - /* 50 */ 51, 52, 53, 4, 5, 6, 7, 8, 62, 93, - /* 60 */ 94, 95, 13, 14, 15, 66, 67, 68, 69, 70, - /* 70 */ 71, 72, 73, 74, 75, 76, 77, 1, 85, 62, - /* 80 */ 1, 1, 89, 38, 117, 92, 93, 82, 83, 84, - /* 90 */ 85, 86, 38, 17, 101, 102, 17, 17, 105, 106, - /* 100 */ 107, 86, 109, 88, 59, 29, 61, 1, 29, 30, - /* 110 */ 65, 35, 119, 120, 35, 61, 40, 41, 42, 43, - /* 120 */ 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - /* 130 */ 90, 91, 59, 54, 54, 29, 16, 64, 18, 19, - /* 140 */ 100, 35, 66, 67, 68, 69, 70, 71, 72, 73, - /* 150 */ 74, 75, 76, 77, 1, 85, 36, 117, 1, 89, - /* 160 */ 18, 1, 92, 93, 94, 1, 17, 20, 21, 20, - /* 170 */ 17, 101, 102, 17, 17, 105, 106, 107, 29, 109, - /* 180 */ 38, 17, 29, 31, 35, 29, 29, 38, 35, 90, - /* 190 */ 38, 35, 35, 40, 41, 42, 43, 44, 45, 46, - /* 200 */ 47, 48, 49, 50, 51, 52, 53, 1, 61, 111, - /* 210 */ 61, 113, 114, 61, 54, 90, 117, 118, 90, 66, - /* 220 */ 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - /* 230 */ 77, 103, 104, 27, 110, 29, 112, 1, 84, 85, - /* 240 */ 86, 35, 117, 20, 21, 117, 40, 41, 42, 43, - /* 250 */ 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - /* 260 */ 1, 91, 16, 59, 25, 19, 20, 31, 64, 16, - /* 270 */ 100, 25, 66, 67, 68, 69, 70, 71, 72, 73, - /* 280 */ 74, 75, 76, 77, 61, 85, 85, 117, 29, 37, - /* 290 */ 54, 38, 18, 19, 35, 37, 110, 39, 112, 40, - /* 300 */ 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, - /* 310 */ 51, 52, 53, 1, 90, 91, 16, 65, 79, 19, - /* 320 */ 20, 121, 122, 122, 100, 66, 67, 68, 69, 70, - /* 330 */ 71, 72, 73, 74, 75, 76, 77, 63, 24, 91, - /* 340 */ 37, 117, 39, 37, 16, 39, 90, 19, 100, 2, - /* 350 */ 19, 37, 40, 41, 42, 43, 44, 45, 46, 47, - /* 360 */ 48, 49, 50, 51, 52, 53, 1, 90, 91, 16, - /* 370 */ 29, 19, 19, 117, 93, 94, 35, 100, 66, 67, - /* 380 */ 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - /* 390 */ 62, 79, 96, 62, 117, 17, 16, 18, 19, 19, - /* 400 */ 93, 94, 19, 25, 39, 40, 41, 42, 43, 44, - /* 410 */ 45, 46, 47, 48, 49, 50, 51, 52, 53, 1, - /* 420 */ 91, 91, 90, 16, 16, 16, 19, 19, 19, 100, - /* 430 */ 100, 66, 67, 68, 69, 70, 71, 72, 73, 74, - /* 440 */ 75, 76, 77, 108, 29, 91, 117, 117, 30, 117, - /* 450 */ 115, 29, 113, 114, 100, 20, 96, 35, 40, 41, - /* 460 */ 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - /* 470 */ 52, 53, 91, 1, 118, 99, 18, 26, 110, 20, - /* 480 */ 2, 100, 97, 1, 66, 67, 68, 69, 70, 71, - /* 490 */ 72, 73, 74, 75, 76, 77, 1, 112, 117, 17, - /* 500 */ 1, 2, 85, 99, 19, 110, 89, 10, 16, 19, - /* 510 */ 93, 19, 17, 16, 21, 99, 17, 38, 59, 22, - /* 520 */ 23, 29, 105, 106, 107, 28, 109, 35, 18, 32, - /* 530 */ 33, 34, 2, 1, 65, 40, 41, 42, 43, 44, - /* 540 */ 45, 46, 47, 48, 49, 50, 51, 52, 53, 17, - /* 550 */ 20, 91, 59, 21, 36, 19, 19, 64, 19, 25, - /* 560 */ 100, 66, 67, 68, 69, 70, 71, 72, 73, 74, - /* 570 */ 75, 76, 77, 1, 85, 78, 79, 80, 89, 85, - /* 580 */ 19, 92, 93, 89, 59, 63, 21, 93, 19, 17, - /* 590 */ 101, 102, 17, 1, 105, 106, 107, 18, 109, 105, - /* 600 */ 106, 107, 18, 109, 29, 116, 36, 63, 19, 17, - /* 610 */ 35, 1, 40, 41, 42, 43, 44, 45, 46, 47, - /* 620 */ 48, 49, 50, 51, 52, 53, 61, 17, 108, 38, - /* 630 */ 2, 19, 39, 55, 21, 115, 18, 97, 66, 67, - /* 640 */ 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - /* 650 */ 1, 85, 112, 1, 100, 89, 85, 115, 92, 93, - /* 660 */ 89, 110, 112, 111, 93, 91, 17, 101, 102, 17, - /* 670 */ 97, 105, 106, 107, 100, 109, 105, 106, 107, 14, - /* 680 */ 109, 29, 116, 87, 123, 112, 112, 35, 123, 40, - /* 690 */ 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, - /* 700 */ 51, 52, 53, 1, 2, 110, 54, 110, 114, 110, - /* 710 */ 123, 123, 97, 97, 97, 66, 67, 68, 69, 70, - /* 720 */ 71, 72, 73, 74, 75, 76, 77, 112, 112, 112, - /* 730 */ 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, - /* 740 */ 123, 123, 40, 41, 42, 43, 44, 45, 46, 47, - /* 750 */ 48, 49, 50, 51, 52, 53, 1, 123, 123, 123, - /* 760 */ 123, 123, 123, 123, 123, 97, 97, 97, 66, 67, - /* 770 */ 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - /* 780 */ 112, 112, 112, 123, 123, 123, 123, 123, 123, 123, - /* 790 */ 123, 123, 123, 123, 39, 40, 41, 42, 43, 44, - /* 800 */ 45, 46, 47, 48, 49, 50, 51, 52, 53, 123, - /* 810 */ 1, 123, 123, 123, 123, 123, 123, 123, 123, 123, - /* 820 */ 123, 66, 67, 68, 69, 70, 71, 72, 73, 74, - /* 830 */ 75, 76, 77, 24, 123, 123, 123, 123, 123, 123, - /* 840 */ 123, 123, 123, 123, 123, 123, 123, 123, 123, 40, - /* 850 */ 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, - /* 860 */ 51, 52, 53, 1, 123, 123, 123, 123, 123, 123, - /* 870 */ 123, 123, 123, 123, 123, 66, 67, 68, 69, 70, - /* 880 */ 71, 72, 73, 74, 75, 76, 77, 123, 123, 123, - /* 890 */ 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, - /* 900 */ 123, 123, 40, 41, 42, 43, 44, 45, 46, 47, - /* 910 */ 48, 49, 50, 51, 52, 53, 123, 123, 123, 123, - /* 920 */ 123, 123, 123, 123, 123, 123, 123, 65, 66, 67, - /* 930 */ 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - /* 940 */ 1, 85, 123, 1, 123, 89, 85, 123, 92, 93, - /* 950 */ 89, 123, 123, 123, 93, 91, 17, 101, 102, 17, - /* 960 */ 123, 105, 106, 107, 100, 109, 105, 106, 107, 123, - /* 970 */ 109, 29, 116, 123, 123, 123, 112, 35, 123, 40, - /* 980 */ 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, - /* 990 */ 51, 52, 53, 1, 123, 123, 54, 123, 123, 123, - /* 1000 */ 123, 123, 123, 123, 123, 66, 67, 68, 69, 70, - /* 1010 */ 71, 72, 73, 74, 75, 76, 77, 123, 123, 123, - /* 1020 */ 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, - /* 1030 */ 123, 123, 40, 41, 42, 43, 44, 45, 46, 47, - /* 1040 */ 48, 49, 50, 51, 52, 53, 123, 123, 123, 123, - /* 1050 */ 123, 123, 123, 123, 123, 123, 123, 123, 66, 67, - /* 1060 */ 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - /* 1070 */ 123, 123, 123, 40, 41, 42, 43, 44, 45, 46, - /* 1080 */ 47, 48, 49, 50, 51, 52, 53, 123, 123, 123, - /* 1090 */ 123, 123, 123, 123, 123, 123, 123, 123, 123, 66, - /* 1100 */ 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - /* 1110 */ 77, 123, 123, 123, 123, 123, 16, 123, 18, 19, - /* 1120 */ 123, 123, 22, 23, 123, 17, 123, 85, 28, 123, - /* 1130 */ 123, 89, 32, 33, 34, 93, 36, 29, 38, 123, - /* 1140 */ 123, 41, 123, 35, 102, 123, 85, 105, 106, 107, - /* 1150 */ 89, 109, 123, 91, 93, 123, 56, 57, 58, 59, - /* 1160 */ 60, 123, 100, 63, 64, 65, 105, 106, 107, 123, - /* 1170 */ 109, 93, 123, 16, 112, 18, 19, 123, 78, 22, - /* 1180 */ 23, 16, 123, 105, 19, 28, 123, 109, 123, 32, - /* 1190 */ 33, 34, 123, 36, 29, 38, 31, 123, 41, 123, - /* 1200 */ 35, 123, 85, 123, 123, 123, 89, 123, 123, 92, - /* 1210 */ 93, 94, 123, 56, 57, 58, 59, 60, 101, 102, - /* 1220 */ 63, 64, 105, 106, 107, 123, 109, 17, 123, 123, - /* 1230 */ 16, 123, 18, 19, 123, 78, 22, 23, 16, 29, - /* 1240 */ 91, 19, 28, 123, 17, 35, 32, 33, 34, 100, - /* 1250 */ 36, 29, 38, 31, 123, 41, 29, 35, 123, 85, - /* 1260 */ 123, 112, 35, 89, 123, 123, 92, 93, 1, 123, - /* 1270 */ 56, 57, 58, 59, 60, 101, 102, 63, 64, 105, - /* 1280 */ 106, 107, 123, 109, 17, 123, 123, 16, 123, 18, - /* 1290 */ 19, 123, 78, 22, 23, 123, 29, 123, 123, 28, - /* 1300 */ 123, 17, 35, 32, 33, 34, 123, 36, 123, 38, - /* 1310 */ 123, 123, 41, 29, 123, 123, 85, 123, 123, 35, - /* 1320 */ 89, 54, 123, 92, 93, 123, 123, 56, 57, 58, - /* 1330 */ 59, 60, 101, 102, 63, 64, 105, 106, 107, 123, - /* 1340 */ 109, 17, 123, 123, 16, 123, 18, 19, 123, 78, - /* 1350 */ 22, 23, 123, 29, 123, 123, 28, 123, 17, 35, - /* 1360 */ 32, 33, 34, 123, 36, 123, 38, 123, 123, 41, - /* 1370 */ 29, 123, 123, 85, 123, 123, 35, 89, 123, 123, - /* 1380 */ 92, 93, 123, 123, 56, 57, 58, 59, 60, 101, - /* 1390 */ 102, 63, 64, 105, 106, 107, 123, 109, 17, 123, - /* 1400 */ 123, 16, 123, 18, 19, 123, 78, 22, 23, 123, - /* 1410 */ 29, 123, 123, 28, 123, 17, 35, 32, 33, 34, - /* 1420 */ 123, 36, 123, 38, 123, 123, 41, 29, 123, 123, - /* 1430 */ 85, 123, 123, 35, 89, 123, 123, 92, 93, 123, - /* 1440 */ 123, 56, 57, 58, 59, 60, 101, 102, 63, 64, - /* 1450 */ 105, 106, 107, 123, 109, 17, 123, 123, 16, 123, - /* 1460 */ 18, 19, 123, 78, 22, 23, 123, 29, 123, 123, - /* 1470 */ 28, 123, 17, 35, 32, 33, 34, 123, 36, 123, - /* 1480 */ 38, 123, 123, 41, 29, 123, 123, 85, 123, 123, - /* 1490 */ 35, 89, 123, 123, 92, 93, 123, 123, 56, 57, - /* 1500 */ 58, 59, 60, 101, 102, 63, 64, 105, 106, 107, - /* 1510 */ 123, 109, 17, 123, 123, 16, 123, 18, 19, 123, - /* 1520 */ 78, 22, 23, 123, 29, 123, 123, 28, 123, 17, - /* 1530 */ 35, 32, 33, 34, 123, 36, 123, 38, 123, 123, - /* 1540 */ 41, 29, 123, 123, 85, 123, 123, 35, 89, 123, - /* 1550 */ 123, 92, 93, 123, 123, 56, 57, 58, 59, 60, - /* 1560 */ 101, 102, 63, 64, 105, 106, 107, 123, 109, 17, - /* 1570 */ 123, 123, 16, 123, 18, 19, 123, 78, 22, 23, - /* 1580 */ 123, 29, 123, 123, 28, 123, 17, 35, 32, 33, - /* 1590 */ 34, 123, 36, 123, 38, 123, 123, 41, 29, 123, - /* 1600 */ 123, 85, 123, 123, 35, 89, 123, 123, 92, 93, - /* 1610 */ 123, 123, 56, 57, 58, 59, 60, 101, 102, 63, - /* 1620 */ 64, 105, 106, 107, 123, 109, 17, 123, 123, 16, - /* 1630 */ 123, 18, 19, 123, 78, 22, 23, 123, 29, 123, - /* 1640 */ 123, 28, 123, 17, 35, 32, 33, 34, 123, 36, - /* 1650 */ 123, 38, 123, 123, 41, 29, 123, 123, 85, 123, - /* 1660 */ 123, 35, 89, 123, 123, 92, 93, 123, 123, 56, - /* 1670 */ 57, 58, 59, 60, 101, 102, 63, 123, 105, 106, - /* 1680 */ 107, 123, 109, 17, 123, 123, 16, 123, 18, 19, - /* 1690 */ 123, 78, 22, 23, 123, 29, 123, 123, 28, 123, - /* 1700 */ 17, 35, 32, 33, 34, 123, 36, 123, 38, 123, - /* 1710 */ 123, 41, 29, 123, 123, 85, 123, 123, 35, 89, - /* 1720 */ 123, 123, 92, 93, 123, 123, 56, 57, 58, 59, - /* 1730 */ 60, 101, 102, 63, 123, 105, 106, 107, 123, 109, - /* 1740 */ 123, 123, 123, 123, 17, 123, 123, 123, 78, 123, - /* 1750 */ 120, 24, 123, 26, 27, 10, 29, 30, 123, 123, - /* 1760 */ 123, 16, 35, 123, 37, 38, 39, 22, 23, 123, - /* 1770 */ 90, 91, 123, 28, 123, 123, 123, 32, 33, 34, - /* 1780 */ 100, 54, 123, 103, 104, 123, 123, 123, 61, 123, - /* 1790 */ 123, 123, 65, 123, 85, 90, 91, 117, 89, 123, - /* 1800 */ 123, 92, 93, 123, 123, 100, 79, 123, 103, 104, - /* 1810 */ 101, 102, 123, 85, 105, 106, 107, 89, 109, 123, - /* 1820 */ 92, 93, 117, 78, 79, 80, 123, 123, 123, 101, - /* 1830 */ 102, 123, 123, 105, 106, 107, 85, 109, 123, 123, - /* 1840 */ 89, 123, 123, 92, 93, 123, 123, 85, 123, 123, - /* 1850 */ 123, 89, 101, 102, 92, 93, 105, 106, 107, 123, - /* 1860 */ 109, 123, 123, 101, 102, 123, 123, 105, 106, 107, - /* 1870 */ 123, 109, 123, 123, 85, 90, 91, 123, 89, 123, - /* 1880 */ 123, 92, 93, 123, 123, 100, 123, 123, 103, 104, - /* 1890 */ 101, 102, 123, 123, 105, 106, 107, 85, 109, 123, - /* 1900 */ 123, 89, 117, 123, 92, 93, 123, 85, 123, 123, - /* 1910 */ 123, 89, 123, 101, 102, 93, 85, 105, 106, 107, - /* 1920 */ 89, 109, 123, 92, 93, 123, 123, 105, 106, 107, - /* 1930 */ 123, 109, 101, 102, 123, 123, 105, 106, 107, 85, - /* 1940 */ 109, 123, 123, 89, 123, 123, 92, 93, 123, 123, - /* 1950 */ 85, 123, 123, 123, 89, 101, 102, 92, 93, 105, - /* 1960 */ 106, 107, 123, 109, 123, 123, 101, 102, 123, 123, - /* 1970 */ 105, 106, 107, 123, 109, 123, 85, 123, 123, 123, - /* 1980 */ 89, 123, 123, 92, 93, 123, 123, 85, 123, 123, - /* 1990 */ 123, 89, 101, 102, 92, 93, 105, 106, 107, 123, - /* 2000 */ 109, 123, 123, 101, 102, 123, 85, 105, 106, 107, - /* 2010 */ 89, 109, 123, 92, 93, 123, 123, 123, 123, 123, - /* 2020 */ 123, 123, 101, 102, 123, 85, 105, 106, 107, 89, - /* 2030 */ 109, 123, 92, 93, 123, 123, 85, 123, 123, 123, - /* 2040 */ 89, 101, 102, 92, 93, 105, 106, 107, 123, 109, - /* 2050 */ 123, 123, 101, 102, 123, 123, 105, 106, 107, 123, - /* 2060 */ 109, 123, 85, 123, 123, 123, 89, 123, 123, 92, - /* 2070 */ 93, 123, 123, 85, 123, 123, 123, 89, 101, 102, - /* 2080 */ 92, 93, 105, 106, 107, 123, 109, 123, 123, 101, - /* 2090 */ 102, 123, 85, 105, 106, 107, 89, 109, 123, 92, - /* 2100 */ 93, 123, 123, 123, 123, 123, 123, 123, 101, 102, - /* 2110 */ 123, 85, 105, 106, 107, 89, 109, 123, 92, 93, - /* 2120 */ 123, 123, 85, 123, 123, 123, 89, 101, 102, 92, - /* 2130 */ 93, 105, 106, 107, 123, 109, 123, 123, 101, 102, - /* 2140 */ 123, 123, 105, 106, 107, 123, 109, 123, 85, 123, - /* 2150 */ 123, 123, 89, 123, 123, 92, 93, 123, 123, 85, - /* 2160 */ 123, 123, 123, 89, 101, 102, 92, 93, 105, 106, - /* 2170 */ 107, 123, 109, 123, 123, 101, 102, 123, 85, 105, - /* 2180 */ 106, 107, 89, 109, 123, 92, 93, 123, 123, 123, - /* 2190 */ 123, 123, 123, 123, 101, 102, 123, 85, 105, 106, - /* 2200 */ 107, 89, 109, 123, 92, 93, 123, 123, 85, 123, - /* 2210 */ 123, 123, 89, 101, 102, 92, 93, 105, 106, 107, - /* 2220 */ 123, 109, 123, 123, 101, 102, 123, 123, 105, 106, - /* 2230 */ 107, 123, 109, 123, 85, 123, 123, 123, 89, 123, - /* 2240 */ 123, 92, 93, 123, 123, 85, 123, 123, 123, 89, - /* 2250 */ 101, 102, 92, 93, 105, 106, 107, 123, 109, 123, - /* 2260 */ 123, 101, 102, 123, 85, 105, 106, 107, 89, 109, - /* 2270 */ 123, 92, 93, 123, 123, 123, 123, 123, 123, 123, - /* 2280 */ 101, 102, 123, 85, 105, 106, 107, 89, 109, 123, - /* 2290 */ 92, 93, 1, 123, 85, 123, 90, 91, 89, 101, - /* 2300 */ 102, 123, 93, 105, 106, 107, 100, 109, 17, 103, - /* 2310 */ 104, 102, 21, 123, 105, 106, 107, 123, 109, 123, - /* 2320 */ 29, 123, 123, 117, 85, 123, 35, 123, 89, 38, - /* 2330 */ 123, 123, 93, 123, 123, 123, 123, 123, 123, 123, - /* 2340 */ 90, 91, 123, 123, 105, 106, 107, 123, 109, 123, - /* 2350 */ 100, 123, 61, 103, 104, 90, 91, 123, 123, 123, - /* 2360 */ 123, 123, 123, 123, 123, 100, 123, 117, 103, 104, - /* 2370 */ 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, - /* 2380 */ 123, 123, 117, -); - const YY_SHIFT_USE_DFLT = -5; - const YY_SHIFT_MAX = 256; - static public $yy_shift_ofst = array( - /* 0 */ -2, 1271, 1157, 1157, 1271, 1157, 1328, 1328, 1100, 1157, - /* 10 */ 1157, 1157, 1157, 1157, 1157, 1157, 1499, 1157, 1157, 1157, - /* 20 */ 1157, 1157, 1556, 1157, 1157, 1157, 1157, 1157, 1157, 1157, - /* 30 */ 1157, 1157, 1157, 1157, 1385, 1214, 1157, 1157, 1157, 1157, - /* 40 */ 1157, 1499, 1214, 1157, 1442, 1442, 1613, 1670, 1670, 1670, - /* 50 */ 1670, 1670, 1670, 206, 153, 76, -1, 259, 259, 259, - /* 60 */ 809, 939, 755, 862, 702, 649, 365, 312, 418, 495, - /* 70 */ 572, 992, 992, 992, 992, 992, 992, 992, 992, 992, - /* 80 */ 992, 992, 992, 992, 992, 992, 992, 992, 992, 992, - /* 90 */ 1033, 1033, 2291, 1267, 106, -2, 1745, 1222, 1165, 157, - /* 100 */ 157, 492, 492, 499, 106, 106, 274, 493, 142, 497, - /* 110 */ 49, 79, 942, 652, 246, 17, 328, 300, 236, 223, - /* 120 */ 80, 147, 532, 1227, 353, 353, 353, 422, 407, 142, - /* 130 */ 353, 353, 610, 353, 341, 565, 379, 353, 380, 142, - /* 140 */ 408, 160, 409, 353, 379, 409, 353, 472, 613, 472, - /* 150 */ 472, 472, 472, 472, 472, 613, 472, -5, 1284, 1210, - /* 160 */ -4, 1108, 0, 156, 575, 1683, 1552, 1512, 1569, 1609, - /* 170 */ 1666, 1324, 1626, 6, 1495, 1398, 1381, 1341, 1438, 1455, - /* 180 */ 73, 482, 73, 204, 592, 204, 204, 204, 164, 204, - /* 190 */ 253, 204, 204, 665, 613, 613, 613, 479, 472, 347, - /* 200 */ 415, 415, 472, 347, -5, -5, -5, -5, -5, 1727, - /* 210 */ 149, 45, 120, 152, 54, 530, 54, 314, 252, 378, - /* 220 */ 306, 459, 258, 303, 239, 331, 522, 536, 469, 537, - /* 230 */ 539, 569, 534, 544, 561, 525, 518, 570, 593, 612, - /* 240 */ 578, 628, 591, 579, 510, 584, 589, 458, 435, 352, - /* 250 */ 485, 478, 451, 479, 490, 383, 618, -); - const YY_REDUCE_USE_DFLT = -96; - const YY_REDUCE_MAX = 208; - static public $yy_reduce_ofst = array( - /* 0 */ 5, -7, 489, 566, 1630, 856, 70, 1117, 1865, 1854, - /* 10 */ 1831, 1812, 1891, 1902, 1977, 1951, 1940, 1921, 1789, 1762, - /* 20 */ 1402, 1345, 1288, 1231, 1459, 1516, 1751, 1728, 1709, 1573, - /* 30 */ 1988, 2007, 2123, 2149, 2160, 2198, 2179, 1174, 2093, 2026, - /* 40 */ 2037, 2063, 2112, 2074, 1042, 2209, 1822, 2239, 1061, 861, - /* 50 */ 494, 417, 571, 2265, 2250, 2206, 1705, 1785, 1680, 1705, - /* 60 */ 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, - /* 70 */ 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, - /* 80 */ 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, - /* 90 */ 128, 128, 277, 224, 40, 154, 200, 864, 1062, 170, - /* 100 */ 330, 574, 1149, 99, 329, 381, 1078, 98, -34, 201, - /* 110 */ 15, 125, 125, 125, -85, 124, 124, 124, 125, -95, - /* 120 */ 125, -95, 332, 354, 573, 616, 617, 460, 615, 307, - /* 130 */ 385, 540, 256, -74, 248, -95, 335, 668, 540, 281, - /* 140 */ 540, 125, 670, 669, 520, 540, 186, 125, 339, 125, - /* 150 */ 125, 125, 125, 125, 125, -95, 125, 125, 554, 554, - /* 160 */ 550, 554, 554, 554, 554, 554, 554, 554, 554, 554, - /* 170 */ 554, 554, 554, 542, 554, 554, 554, 554, 554, 554, - /* 180 */ 595, -33, 551, 552, -33, 552, 552, 552, -33, 552, - /* 190 */ 597, 552, 552, 596, 594, 594, 594, 599, -33, 356, - /* 200 */ 296, 360, -33, 356, 395, 404, 376, 416, 368, -); - static public $yyExpectedTokens = array( - /* 0 */ array(3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16, 22, 23, 28, 32, 33, 34, ), - /* 1 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ), - /* 2 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ), - /* 3 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ), - /* 4 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ), - /* 5 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ), - /* 6 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ), - /* 7 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ), - /* 8 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 65, 78, ), - /* 9 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ), - /* 10 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ), - /* 11 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ), - /* 12 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ), - /* 13 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ), - /* 14 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ), - /* 15 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ), - /* 16 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ), - /* 17 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ), - /* 18 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ), - /* 19 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ), - /* 20 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ), - /* 21 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ), - /* 22 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ), - /* 23 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ), - /* 24 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ), - /* 25 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ), - /* 26 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ), - /* 27 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ), - /* 28 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ), - /* 29 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ), - /* 30 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ), - /* 31 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ), - /* 32 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ), - /* 33 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ), - /* 34 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ), - /* 35 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ), - /* 36 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ), - /* 37 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ), - /* 38 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ), - /* 39 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ), - /* 40 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ), - /* 41 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ), - /* 42 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ), - /* 43 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ), - /* 44 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ), - /* 45 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 64, 78, ), - /* 46 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 78, ), - /* 47 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 78, ), - /* 48 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 78, ), - /* 49 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 78, ), - /* 50 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 78, ), - /* 51 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 78, ), - /* 52 */ array(16, 18, 19, 22, 23, 28, 32, 33, 34, 36, 38, 41, 56, 57, 58, 59, 60, 63, 78, ), - /* 53 */ array(1, 27, 29, 35, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ), - /* 54 */ array(1, 17, 29, 35, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ), - /* 55 */ array(1, 17, 29, 35, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ), - /* 56 */ array(1, 17, 29, 35, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ), - /* 57 */ array(1, 29, 35, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ), - /* 58 */ array(1, 29, 35, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ), - /* 59 */ array(1, 29, 35, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ), - /* 60 */ array(1, 24, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ), - /* 61 */ array(1, 17, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ), - /* 62 */ array(1, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ), - /* 63 */ array(1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ), - /* 64 */ array(1, 2, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ), - /* 65 */ array(1, 17, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ), - /* 66 */ array(1, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ), - /* 67 */ array(1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 79, ), - /* 68 */ array(1, 30, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ), - /* 69 */ array(1, 17, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ), - /* 70 */ array(1, 17, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ), - /* 71 */ array(1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ), - /* 72 */ array(1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ), - /* 73 */ array(1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ), - /* 74 */ array(1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ), - /* 75 */ array(1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ), - /* 76 */ array(1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ), - /* 77 */ array(1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ), - /* 78 */ array(1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ), - /* 79 */ array(1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ), - /* 80 */ array(1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ), - /* 81 */ array(1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ), - /* 82 */ array(1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ), - /* 83 */ array(1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ), - /* 84 */ array(1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ), - /* 85 */ array(1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ), - /* 86 */ array(1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ), - /* 87 */ array(1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ), - /* 88 */ array(1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ), - /* 89 */ array(1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ), - /* 90 */ array(40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ), - /* 91 */ array(40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, ), - /* 92 */ array(1, 17, 21, 29, 35, 38, 61, ), - /* 93 */ array(1, 17, 29, 35, 54, ), - /* 94 */ array(1, 29, 35, ), - /* 95 */ array(3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16, 22, 23, 28, 32, 33, 34, ), - /* 96 */ array(10, 16, 22, 23, 28, 32, 33, 34, 78, 79, 80, ), - /* 97 */ array(16, 19, 29, 31, 35, ), - /* 98 */ array(16, 19, 29, 31, 35, ), - /* 99 */ array(1, 17, 29, 35, ), - /* 100 */ array(1, 17, 29, 35, ), - /* 101 */ array(16, 19, 29, 35, ), - /* 102 */ array(16, 19, 29, 35, ), - /* 103 */ array(1, 2, 17, ), - /* 104 */ array(1, 29, 35, ), - /* 105 */ array(1, 29, 35, ), - /* 106 */ array(18, 19, 63, ), - /* 107 */ array(21, 59, 64, ), - /* 108 */ array(18, 38, ), - /* 109 */ array(10, 16, 22, 23, 28, 32, 33, 34, 78, 79, 80, ), - /* 110 */ array(4, 5, 6, 7, 8, 13, 14, 15, ), - /* 111 */ array(1, 17, 29, 30, 35, 54, ), - /* 112 */ array(1, 17, 29, 35, 54, ), - /* 113 */ array(1, 17, 29, 35, 54, ), - /* 114 */ array(16, 19, 20, 25, ), - /* 115 */ array(16, 19, 20, 62, ), - /* 116 */ array(16, 19, 62, ), - /* 117 */ array(16, 19, 20, ), - /* 118 */ array(1, 31, 54, ), - /* 119 */ array(20, 21, 61, ), - /* 120 */ array(1, 17, 54, ), - /* 121 */ array(20, 21, 61, ), - /* 122 */ array(1, 17, 21, ), - /* 123 */ array(17, 29, 35, ), - /* 124 */ array(16, 19, ), - /* 125 */ array(16, 19, ), - /* 126 */ array(16, 19, ), - /* 127 */ array(29, 35, ), - /* 128 */ array(16, 19, ), - /* 129 */ array(18, 38, ), - /* 130 */ array(16, 19, ), - /* 131 */ array(16, 19, ), - /* 132 */ array(1, 17, ), - /* 133 */ array(16, 19, ), - /* 134 */ array(29, 35, ), - /* 135 */ array(21, 61, ), - /* 136 */ array(18, 19, ), - /* 137 */ array(16, 19, ), - /* 138 */ array(16, 19, ), - /* 139 */ array(18, 38, ), - /* 140 */ array(16, 19, ), - /* 141 */ array(1, 54, ), - /* 142 */ array(16, 19, ), - /* 143 */ array(16, 19, ), - /* 144 */ array(18, 19, ), - /* 145 */ array(16, 19, ), - /* 146 */ array(16, 19, ), - /* 147 */ array(1, ), - /* 148 */ array(21, ), - /* 149 */ array(1, ), - /* 150 */ array(1, ), - /* 151 */ array(1, ), - /* 152 */ array(1, ), - /* 153 */ array(1, ), - /* 154 */ array(1, ), - /* 155 */ array(21, ), - /* 156 */ array(1, ), - /* 157 */ array(), - /* 158 */ array(17, 29, 35, ), - /* 159 */ array(17, 29, 35, ), - /* 160 */ array(16, 19, 62, ), - /* 161 */ array(17, 29, 35, ), - /* 162 */ array(17, 29, 35, ), - /* 163 */ array(17, 29, 35, ), - /* 164 */ array(17, 29, 35, ), - /* 165 */ array(17, 29, 35, ), - /* 166 */ array(17, 29, 35, ), - /* 167 */ array(17, 29, 35, ), - /* 168 */ array(17, 29, 35, ), - /* 169 */ array(17, 29, 35, ), - /* 170 */ array(17, 29, 35, ), - /* 171 */ array(17, 29, 35, ), - /* 172 */ array(17, 29, 35, ), - /* 173 */ array(16, 18, 19, ), - /* 174 */ array(17, 29, 35, ), - /* 175 */ array(17, 29, 35, ), - /* 176 */ array(17, 29, 35, ), - /* 177 */ array(17, 29, 35, ), - /* 178 */ array(17, 29, 35, ), - /* 179 */ array(17, 29, 35, ), - /* 180 */ array(59, 64, ), - /* 181 */ array(1, 17, ), - /* 182 */ array(59, 64, ), - /* 183 */ array(59, 64, ), - /* 184 */ array(1, 17, ), - /* 185 */ array(59, 64, ), - /* 186 */ array(59, 64, ), - /* 187 */ array(59, 64, ), - /* 188 */ array(1, 17, ), - /* 189 */ array(59, 64, ), - /* 190 */ array(16, 38, ), - /* 191 */ array(59, 64, ), - /* 192 */ array(59, 64, ), - /* 193 */ array(14, ), - /* 194 */ array(21, ), - /* 195 */ array(21, ), - /* 196 */ array(21, ), - /* 197 */ array(38, ), - /* 198 */ array(1, ), - /* 199 */ array(2, ), - /* 200 */ array(29, ), - /* 201 */ array(29, ), - /* 202 */ array(1, ), - /* 203 */ array(2, ), - /* 204 */ array(), - /* 205 */ array(), - /* 206 */ array(), - /* 207 */ array(), - /* 208 */ array(), - /* 209 */ array(17, 24, 26, 27, 29, 30, 35, 37, 38, 39, 54, 61, 65, 79, ), - /* 210 */ array(17, 20, 29, 35, 38, 61, ), - /* 211 */ array(38, 59, 61, 65, ), - /* 212 */ array(16, 18, 19, 36, ), - /* 213 */ array(31, 38, 61, ), - /* 214 */ array(38, 61, ), - /* 215 */ array(2, 20, ), - /* 216 */ array(38, 61, ), - /* 217 */ array(24, 37, ), - /* 218 */ array(37, 65, ), - /* 219 */ array(17, 25, ), - /* 220 */ array(37, 39, ), - /* 221 */ array(20, 59, ), - /* 222 */ array(37, 39, ), - /* 223 */ array(37, 39, ), - /* 224 */ array(25, 79, ), - /* 225 */ array(19, 62, ), - /* 226 */ array(63, ), - /* 227 */ array(19, ), - /* 228 */ array(65, ), - /* 229 */ array(19, ), - /* 230 */ array(19, ), - /* 231 */ array(19, ), - /* 232 */ array(25, ), - /* 233 */ array(63, ), - /* 234 */ array(19, ), - /* 235 */ array(59, ), - /* 236 */ array(36, ), - /* 237 */ array(36, ), - /* 238 */ array(39, ), - /* 239 */ array(19, ), - /* 240 */ array(55, ), - /* 241 */ array(2, ), - /* 242 */ array(38, ), - /* 243 */ array(18, ), - /* 244 */ array(18, ), - /* 245 */ array(18, ), - /* 246 */ array(19, ), - /* 247 */ array(18, ), - /* 248 */ array(20, ), - /* 249 */ array(19, ), - /* 250 */ array(19, ), - /* 251 */ array(2, ), - /* 252 */ array(26, ), - /* 253 */ array(38, ), - /* 254 */ array(19, ), - /* 255 */ array(19, ), - /* 256 */ array(18, ), - /* 257 */ array(), - /* 258 */ array(), - /* 259 */ array(), - /* 260 */ array(), - /* 261 */ array(), - /* 262 */ array(), - /* 263 */ array(), - /* 264 */ array(), - /* 265 */ array(), - /* 266 */ array(), - /* 267 */ array(), - /* 268 */ array(), - /* 269 */ array(), - /* 270 */ array(), - /* 271 */ array(), - /* 272 */ array(), - /* 273 */ array(), - /* 274 */ array(), - /* 275 */ array(), - /* 276 */ array(), - /* 277 */ array(), - /* 278 */ array(), - /* 279 */ array(), - /* 280 */ array(), - /* 281 */ array(), - /* 282 */ array(), - /* 283 */ array(), - /* 284 */ array(), - /* 285 */ array(), - /* 286 */ array(), - /* 287 */ array(), - /* 288 */ array(), - /* 289 */ array(), - /* 290 */ array(), - /* 291 */ array(), - /* 292 */ array(), - /* 293 */ array(), - /* 294 */ array(), - /* 295 */ array(), - /* 296 */ array(), - /* 297 */ array(), - /* 298 */ array(), - /* 299 */ array(), - /* 300 */ array(), - /* 301 */ array(), - /* 302 */ array(), - /* 303 */ array(), - /* 304 */ array(), - /* 305 */ array(), - /* 306 */ array(), - /* 307 */ array(), - /* 308 */ array(), - /* 309 */ array(), - /* 310 */ array(), - /* 311 */ array(), - /* 312 */ array(), - /* 313 */ array(), - /* 314 */ array(), - /* 315 */ array(), - /* 316 */ array(), - /* 317 */ array(), - /* 318 */ array(), - /* 319 */ array(), - /* 320 */ array(), - /* 321 */ array(), - /* 322 */ array(), - /* 323 */ array(), - /* 324 */ array(), - /* 325 */ array(), - /* 326 */ array(), - /* 327 */ array(), - /* 328 */ array(), - /* 329 */ array(), - /* 330 */ array(), - /* 331 */ array(), - /* 332 */ array(), - /* 333 */ array(), - /* 334 */ array(), - /* 335 */ array(), - /* 336 */ array(), - /* 337 */ array(), - /* 338 */ array(), - /* 339 */ array(), - /* 340 */ array(), - /* 341 */ array(), - /* 342 */ array(), - /* 343 */ array(), - /* 344 */ array(), - /* 345 */ array(), - /* 346 */ array(), - /* 347 */ array(), - /* 348 */ array(), - /* 349 */ array(), - /* 350 */ array(), - /* 351 */ array(), - /* 352 */ array(), - /* 353 */ array(), - /* 354 */ array(), - /* 355 */ array(), - /* 356 */ array(), - /* 357 */ array(), - /* 358 */ array(), - /* 359 */ array(), - /* 360 */ array(), - /* 361 */ array(), - /* 362 */ array(), - /* 363 */ array(), - /* 364 */ array(), - /* 365 */ array(), - /* 366 */ array(), - /* 367 */ array(), - /* 368 */ array(), - /* 369 */ array(), - /* 370 */ array(), - /* 371 */ array(), - /* 372 */ array(), - /* 373 */ array(), - /* 374 */ array(), - /* 375 */ array(), - /* 376 */ array(), - /* 377 */ array(), - /* 378 */ array(), - /* 379 */ array(), - /* 380 */ array(), - /* 381 */ array(), - /* 382 */ array(), - /* 383 */ array(), - /* 384 */ array(), - /* 385 */ array(), - /* 386 */ array(), - /* 387 */ array(), - /* 388 */ array(), - /* 389 */ array(), - /* 390 */ array(), -); - static public $yy_default = array( - /* 0 */ 394, 578, 549, 549, 595, 549, 595, 595, 595, 595, - /* 10 */ 595, 595, 595, 595, 595, 595, 595, 595, 595, 595, - /* 20 */ 595, 595, 595, 595, 595, 595, 595, 595, 595, 595, - /* 30 */ 595, 595, 595, 595, 595, 595, 595, 595, 595, 595, - /* 40 */ 595, 595, 595, 595, 595, 595, 595, 595, 595, 595, - /* 50 */ 595, 595, 595, 455, 595, 595, 595, 455, 455, 455, - /* 60 */ 595, 595, 595, 595, 595, 595, 595, 595, 460, 595, - /* 70 */ 595, 466, 465, 484, 547, 579, 581, 548, 580, 489, - /* 80 */ 488, 480, 479, 481, 457, 485, 462, 476, 460, 437, - /* 90 */ 492, 493, 504, 468, 455, 391, 595, 455, 455, 475, - /* 100 */ 512, 455, 455, 595, 455, 455, 595, 561, 595, 595, - /* 110 */ 595, 468, 468, 468, 595, 522, 522, 522, 468, 513, - /* 120 */ 468, 513, 595, 595, 595, 595, 595, 455, 595, 595, - /* 130 */ 595, 595, 595, 595, 455, 513, 595, 595, 595, 595, - /* 140 */ 595, 468, 595, 595, 595, 595, 522, 473, 558, 491, - /* 150 */ 478, 472, 497, 495, 496, 513, 471, 556, 595, 595, - /* 160 */ 523, 595, 595, 595, 595, 595, 595, 595, 595, 595, - /* 170 */ 595, 595, 595, 595, 595, 595, 595, 595, 595, 595, - /* 180 */ 516, 595, 518, 519, 595, 520, 540, 542, 595, 539, - /* 190 */ 522, 517, 541, 410, 562, 559, 536, 522, 475, 551, - /* 200 */ 594, 594, 512, 550, 522, 555, 555, 555, 522, 470, - /* 210 */ 504, 504, 595, 504, 490, 534, 504, 595, 595, 494, - /* 220 */ 595, 500, 595, 595, 494, 595, 595, 595, 595, 595, - /* 230 */ 595, 595, 494, 595, 595, 500, 502, 595, 595, 595, - /* 240 */ 506, 534, 560, 595, 595, 595, 595, 595, 595, 595, - /* 250 */ 595, 534, 463, 534, 595, 595, 595, 401, 543, 400, - /* 260 */ 402, 546, 445, 398, 397, 393, 464, 438, 593, 467, - /* 270 */ 435, 395, 440, 434, 439, 396, 399, 456, 531, 420, - /* 280 */ 529, 392, 528, 506, 527, 535, 444, 557, 545, 544, - /* 290 */ 530, 412, 453, 526, 505, 419, 507, 525, 532, 470, - /* 300 */ 514, 521, 524, 508, 510, 482, 483, 416, 415, 417, - /* 310 */ 418, 477, 511, 515, 538, 469, 509, 534, 533, 432, - /* 320 */ 446, 447, 443, 442, 436, 454, 433, 441, 554, 448, - /* 330 */ 498, 499, 501, 503, 452, 451, 449, 450, 552, 553, - /* 340 */ 486, 487, 589, 430, 582, 583, 584, 431, 429, 426, - /* 350 */ 537, 427, 428, 406, 587, 575, 404, 577, 576, 405, - /* 360 */ 585, 586, 588, 591, 592, 425, 424, 569, 568, 570, - /* 370 */ 571, 572, 567, 566, 414, 563, 564, 565, 573, 574, - /* 380 */ 422, 590, 407, 423, 421, 408, 474, 413, 411, 409, - /* 390 */ 403, -); - const YYNOCODE = 124; - const YYSTACKDEPTH = 100; - const YYNSTATE = 391; - const YYNRULE = 204; - const YYERRORSYMBOL = 81; - const YYERRSYMDT = 'yy0'; - const YYFALLBACK = 0; - static public $yyFallback = array( - ); - static function Trace($TraceFILE, $zTracePrompt) - { - if (!$TraceFILE) { - $zTracePrompt = 0; - } elseif (!$zTracePrompt) { - $TraceFILE = 0; - } - self::$yyTraceFILE = $TraceFILE; - self::$yyTracePrompt = $zTracePrompt; - } - - static function PrintTrace() - { - self::$yyTraceFILE = fopen('php://output', 'w'); - self::$yyTracePrompt = ''; - } - - static public $yyTraceFILE; - static public $yyTracePrompt; - public $yyidx; /* Index of top element in stack */ - public $yyerrcnt; /* Shifts left before out of the error */ - public $yystack = array(); /* The parser's stack */ - - public $yyTokenName = array( - '$', 'VERT', 'COLON', 'COMMENT', - 'PHPSTARTTAG', 'PHPENDTAG', 'ASPSTARTTAG', 'ASPENDTAG', - 'FAKEPHPSTARTTAG', 'XMLTAG', 'TEXT', 'STRIPON', - 'STRIPOFF', 'LITERALSTART', 'LITERALEND', 'LITERAL', - 'LDEL', 'RDEL', 'DOLLAR', 'ID', - 'EQUAL', 'PTR', 'LDELIF', 'LDELFOR', - 'SEMICOLON', 'INCDEC', 'TO', 'STEP', - 'LDELFOREACH', 'SPACE', 'AS', 'APTR', - 'LDELSETFILTER', 'SMARTYBLOCKCHILD', 'LDELSLASH', 'ATTR', - 'INTEGER', 'COMMA', 'OPENP', 'CLOSEP', - 'MATH', 'UNIMATH', 'ANDSYM', 'ISIN', - 'ISDIVBY', 'ISNOTDIVBY', 'ISEVEN', 'ISNOTEVEN', - 'ISEVENBY', 'ISNOTEVENBY', 'ISODD', 'ISNOTODD', - 'ISODDBY', 'ISNOTODDBY', 'INSTANCEOF', 'QMARK', - 'NOT', 'TYPECAST', 'HEX', 'DOT', - 'SINGLEQUOTESTRING', 'DOUBLECOLON', 'AT', 'HATCH', - 'OPENB', 'CLOSEB', 'EQUALS', 'NOTEQUALS', - 'GREATERTHAN', 'LESSTHAN', 'GREATEREQUAL', 'LESSEQUAL', - 'IDENTITY', 'NONEIDENTITY', 'MOD', 'LAND', - 'LOR', 'LXOR', 'QUOTE', 'BACKTICK', - 'DOLLARID', 'error', 'start', 'template', - 'template_element', 'smartytag', 'literal', 'literal_elements', - 'literal_element', 'value', 'modifierlist', 'attributes', - 'expr', 'varindexed', 'statement', 'statements', - 'optspace', 'varvar', 'foraction', 'modparameters', - 'attribute', 'ternary', 'array', 'ifcond', - 'lop', 'variable', 'function', 'doublequoted_with_quotes', - 'static_class_access', 'object', 'arrayindex', 'indexdef', - 'varvarele', 'objectchain', 'objectelement', 'method', - 'params', 'modifier', 'modparameter', 'arrayelements', - 'arrayelement', 'doublequoted', 'doublequotedcontent', - ); - - static public $yyRuleName = array( - /* 0 */ "start ::= template", - /* 1 */ "template ::= template_element", - /* 2 */ "template ::= template template_element", - /* 3 */ "template ::=", - /* 4 */ "template_element ::= smartytag", - /* 5 */ "template_element ::= COMMENT", - /* 6 */ "template_element ::= literal", - /* 7 */ "template_element ::= PHPSTARTTAG", - /* 8 */ "template_element ::= PHPENDTAG", - /* 9 */ "template_element ::= ASPSTARTTAG", - /* 10 */ "template_element ::= ASPENDTAG", - /* 11 */ "template_element ::= FAKEPHPSTARTTAG", - /* 12 */ "template_element ::= XMLTAG", - /* 13 */ "template_element ::= TEXT", - /* 14 */ "template_element ::= STRIPON", - /* 15 */ "template_element ::= STRIPOFF", - /* 16 */ "literal ::= LITERALSTART LITERALEND", - /* 17 */ "literal ::= LITERALSTART literal_elements LITERALEND", - /* 18 */ "literal_elements ::= literal_elements literal_element", - /* 19 */ "literal_elements ::=", - /* 20 */ "literal_element ::= literal", - /* 21 */ "literal_element ::= LITERAL", - /* 22 */ "literal_element ::= PHPSTARTTAG", - /* 23 */ "literal_element ::= FAKEPHPSTARTTAG", - /* 24 */ "literal_element ::= PHPENDTAG", - /* 25 */ "literal_element ::= ASPSTARTTAG", - /* 26 */ "literal_element ::= ASPENDTAG", - /* 27 */ "smartytag ::= LDEL value RDEL", - /* 28 */ "smartytag ::= LDEL value modifierlist attributes RDEL", - /* 29 */ "smartytag ::= LDEL value attributes RDEL", - /* 30 */ "smartytag ::= LDEL expr modifierlist attributes RDEL", - /* 31 */ "smartytag ::= LDEL expr attributes RDEL", - /* 32 */ "smartytag ::= LDEL DOLLAR ID EQUAL value RDEL", - /* 33 */ "smartytag ::= LDEL DOLLAR ID EQUAL expr RDEL", - /* 34 */ "smartytag ::= LDEL DOLLAR ID EQUAL expr attributes RDEL", - /* 35 */ "smartytag ::= LDEL varindexed EQUAL expr attributes RDEL", - /* 36 */ "smartytag ::= LDEL ID attributes RDEL", - /* 37 */ "smartytag ::= LDEL ID RDEL", - /* 38 */ "smartytag ::= LDEL ID PTR ID attributes RDEL", - /* 39 */ "smartytag ::= LDEL ID modifierlist attributes RDEL", - /* 40 */ "smartytag ::= LDEL ID PTR ID modifierlist attributes RDEL", - /* 41 */ "smartytag ::= LDELIF expr RDEL", - /* 42 */ "smartytag ::= LDELIF expr attributes RDEL", - /* 43 */ "smartytag ::= LDELIF statement RDEL", - /* 44 */ "smartytag ::= LDELIF statement attributes RDEL", - /* 45 */ "smartytag ::= LDELFOR statements SEMICOLON optspace expr SEMICOLON optspace DOLLAR varvar foraction attributes RDEL", - /* 46 */ "foraction ::= EQUAL expr", - /* 47 */ "foraction ::= INCDEC", - /* 48 */ "smartytag ::= LDELFOR statement TO expr attributes RDEL", - /* 49 */ "smartytag ::= LDELFOR statement TO expr STEP expr attributes RDEL", - /* 50 */ "smartytag ::= LDELFOREACH attributes RDEL", - /* 51 */ "smartytag ::= LDELFOREACH SPACE value AS DOLLAR varvar attributes RDEL", - /* 52 */ "smartytag ::= LDELFOREACH SPACE value AS DOLLAR varvar APTR DOLLAR varvar attributes RDEL", - /* 53 */ "smartytag ::= LDELFOREACH SPACE expr AS DOLLAR varvar attributes RDEL", - /* 54 */ "smartytag ::= LDELFOREACH SPACE expr AS DOLLAR varvar APTR DOLLAR varvar attributes RDEL", - /* 55 */ "smartytag ::= LDELSETFILTER ID modparameters RDEL", - /* 56 */ "smartytag ::= LDELSETFILTER ID modparameters modifierlist RDEL", - /* 57 */ "smartytag ::= SMARTYBLOCKCHILD", - /* 58 */ "smartytag ::= LDELSLASH ID RDEL", - /* 59 */ "smartytag ::= LDELSLASH ID modifierlist RDEL", - /* 60 */ "smartytag ::= LDELSLASH ID PTR ID RDEL", - /* 61 */ "smartytag ::= LDELSLASH ID PTR ID modifierlist RDEL", - /* 62 */ "attributes ::= attributes attribute", - /* 63 */ "attributes ::= attribute", - /* 64 */ "attributes ::=", - /* 65 */ "attribute ::= SPACE ID EQUAL ID", - /* 66 */ "attribute ::= ATTR expr", - /* 67 */ "attribute ::= ATTR value", - /* 68 */ "attribute ::= SPACE ID", - /* 69 */ "attribute ::= SPACE expr", - /* 70 */ "attribute ::= SPACE value", - /* 71 */ "attribute ::= SPACE INTEGER EQUAL expr", - /* 72 */ "statements ::= statement", - /* 73 */ "statements ::= statements COMMA statement", - /* 74 */ "statement ::= DOLLAR varvar EQUAL expr", - /* 75 */ "statement ::= varindexed EQUAL expr", - /* 76 */ "statement ::= OPENP statement CLOSEP", - /* 77 */ "expr ::= value", - /* 78 */ "expr ::= ternary", - /* 79 */ "expr ::= DOLLAR ID COLON ID", - /* 80 */ "expr ::= expr MATH value", - /* 81 */ "expr ::= expr UNIMATH value", - /* 82 */ "expr ::= expr ANDSYM value", - /* 83 */ "expr ::= array", - /* 84 */ "expr ::= expr modifierlist", - /* 85 */ "expr ::= expr ifcond expr", - /* 86 */ "expr ::= expr ISIN array", - /* 87 */ "expr ::= expr ISIN value", - /* 88 */ "expr ::= expr lop expr", - /* 89 */ "expr ::= expr ISDIVBY expr", - /* 90 */ "expr ::= expr ISNOTDIVBY expr", - /* 91 */ "expr ::= expr ISEVEN", - /* 92 */ "expr ::= expr ISNOTEVEN", - /* 93 */ "expr ::= expr ISEVENBY expr", - /* 94 */ "expr ::= expr ISNOTEVENBY expr", - /* 95 */ "expr ::= expr ISODD", - /* 96 */ "expr ::= expr ISNOTODD", - /* 97 */ "expr ::= expr ISODDBY expr", - /* 98 */ "expr ::= expr ISNOTODDBY expr", - /* 99 */ "expr ::= value INSTANCEOF ID", - /* 100 */ "expr ::= value INSTANCEOF value", - /* 101 */ "ternary ::= OPENP expr CLOSEP QMARK DOLLAR ID COLON expr", - /* 102 */ "ternary ::= OPENP expr CLOSEP QMARK expr COLON expr", - /* 103 */ "value ::= variable", - /* 104 */ "value ::= UNIMATH value", - /* 105 */ "value ::= NOT value", - /* 106 */ "value ::= TYPECAST value", - /* 107 */ "value ::= variable INCDEC", - /* 108 */ "value ::= HEX", - /* 109 */ "value ::= INTEGER", - /* 110 */ "value ::= INTEGER DOT INTEGER", - /* 111 */ "value ::= INTEGER DOT", - /* 112 */ "value ::= DOT INTEGER", - /* 113 */ "value ::= ID", - /* 114 */ "value ::= function", - /* 115 */ "value ::= OPENP expr CLOSEP", - /* 116 */ "value ::= SINGLEQUOTESTRING", - /* 117 */ "value ::= doublequoted_with_quotes", - /* 118 */ "value ::= ID DOUBLECOLON static_class_access", - /* 119 */ "value ::= varindexed DOUBLECOLON static_class_access", - /* 120 */ "value ::= smartytag", - /* 121 */ "value ::= value modifierlist", - /* 122 */ "variable ::= varindexed", - /* 123 */ "variable ::= DOLLAR varvar AT ID", - /* 124 */ "variable ::= object", - /* 125 */ "variable ::= HATCH ID HATCH", - /* 126 */ "variable ::= HATCH ID HATCH arrayindex", - /* 127 */ "variable ::= HATCH variable HATCH", - /* 128 */ "variable ::= HATCH variable HATCH arrayindex", - /* 129 */ "varindexed ::= DOLLAR varvar arrayindex", - /* 130 */ "arrayindex ::= arrayindex indexdef", - /* 131 */ "arrayindex ::=", - /* 132 */ "indexdef ::= DOT DOLLAR varvar", - /* 133 */ "indexdef ::= DOT DOLLAR varvar AT ID", - /* 134 */ "indexdef ::= DOT ID", - /* 135 */ "indexdef ::= DOT INTEGER", - /* 136 */ "indexdef ::= DOT LDEL expr RDEL", - /* 137 */ "indexdef ::= OPENB ID CLOSEB", - /* 138 */ "indexdef ::= OPENB ID DOT ID CLOSEB", - /* 139 */ "indexdef ::= OPENB expr CLOSEB", - /* 140 */ "indexdef ::= OPENB CLOSEB", - /* 141 */ "varvar ::= varvarele", - /* 142 */ "varvar ::= varvar varvarele", - /* 143 */ "varvarele ::= ID", - /* 144 */ "varvarele ::= LDEL expr RDEL", - /* 145 */ "object ::= varindexed objectchain", - /* 146 */ "objectchain ::= objectelement", - /* 147 */ "objectchain ::= objectchain objectelement", - /* 148 */ "objectelement ::= PTR ID arrayindex", - /* 149 */ "objectelement ::= PTR DOLLAR varvar arrayindex", - /* 150 */ "objectelement ::= PTR LDEL expr RDEL arrayindex", - /* 151 */ "objectelement ::= PTR ID LDEL expr RDEL arrayindex", - /* 152 */ "objectelement ::= PTR method", - /* 153 */ "function ::= ID OPENP params CLOSEP", - /* 154 */ "method ::= ID OPENP params CLOSEP", - /* 155 */ "method ::= DOLLAR ID OPENP params CLOSEP", - /* 156 */ "params ::= params COMMA expr", - /* 157 */ "params ::= expr", - /* 158 */ "params ::=", - /* 159 */ "modifierlist ::= modifierlist modifier modparameters", - /* 160 */ "modifierlist ::= modifier modparameters", - /* 161 */ "modifier ::= VERT AT ID", - /* 162 */ "modifier ::= VERT ID", - /* 163 */ "modparameters ::= modparameters modparameter", - /* 164 */ "modparameters ::=", - /* 165 */ "modparameter ::= COLON value", - /* 166 */ "modparameter ::= COLON array", - /* 167 */ "static_class_access ::= method", - /* 168 */ "static_class_access ::= method objectchain", - /* 169 */ "static_class_access ::= ID", - /* 170 */ "static_class_access ::= DOLLAR ID arrayindex", - /* 171 */ "static_class_access ::= DOLLAR ID arrayindex objectchain", - /* 172 */ "ifcond ::= EQUALS", - /* 173 */ "ifcond ::= NOTEQUALS", - /* 174 */ "ifcond ::= GREATERTHAN", - /* 175 */ "ifcond ::= LESSTHAN", - /* 176 */ "ifcond ::= GREATEREQUAL", - /* 177 */ "ifcond ::= LESSEQUAL", - /* 178 */ "ifcond ::= IDENTITY", - /* 179 */ "ifcond ::= NONEIDENTITY", - /* 180 */ "ifcond ::= MOD", - /* 181 */ "lop ::= LAND", - /* 182 */ "lop ::= LOR", - /* 183 */ "lop ::= LXOR", - /* 184 */ "array ::= OPENB arrayelements CLOSEB", - /* 185 */ "arrayelements ::= arrayelement", - /* 186 */ "arrayelements ::= arrayelements COMMA arrayelement", - /* 187 */ "arrayelements ::=", - /* 188 */ "arrayelement ::= value APTR expr", - /* 189 */ "arrayelement ::= ID APTR expr", - /* 190 */ "arrayelement ::= expr", - /* 191 */ "doublequoted_with_quotes ::= QUOTE QUOTE", - /* 192 */ "doublequoted_with_quotes ::= QUOTE doublequoted QUOTE", - /* 193 */ "doublequoted ::= doublequoted doublequotedcontent", - /* 194 */ "doublequoted ::= doublequotedcontent", - /* 195 */ "doublequotedcontent ::= BACKTICK variable BACKTICK", - /* 196 */ "doublequotedcontent ::= BACKTICK expr BACKTICK", - /* 197 */ "doublequotedcontent ::= DOLLARID", - /* 198 */ "doublequotedcontent ::= LDEL variable RDEL", - /* 199 */ "doublequotedcontent ::= LDEL expr RDEL", - /* 200 */ "doublequotedcontent ::= smartytag", - /* 201 */ "doublequotedcontent ::= TEXT", - /* 202 */ "optspace ::= SPACE", - /* 203 */ "optspace ::=", - ); - - function tokenName($tokenType) - { - if ($tokenType === 0) { - return 'End of Input'; - } - if ($tokenType > 0 && $tokenType < count($this->yyTokenName)) { - return $this->yyTokenName[$tokenType]; - } else { - return "Unknown"; - } - } - - static function yy_destructor($yymajor, $yypminor) - { - switch ($yymajor) { - default: break; /* If no destructor action specified: do nothing */ - } - } - - function yy_pop_parser_stack() - { - if (!count($this->yystack)) { - return; - } - $yytos = array_pop($this->yystack); - if (self::$yyTraceFILE && $this->yyidx >= 0) { - fwrite(self::$yyTraceFILE, - self::$yyTracePrompt . 'Popping ' . $this->yyTokenName[$yytos->major] . - "\n"); - } - $yymajor = $yytos->major; - self::yy_destructor($yymajor, $yytos->minor); - $this->yyidx--; - return $yymajor; - } - - function __destruct() - { - while ($this->yystack !== Array()) { - $this->yy_pop_parser_stack(); - } - if (is_resource(self::$yyTraceFILE)) { - fclose(self::$yyTraceFILE); - } - } - - function yy_get_expected_tokens($token) - { - $state = $this->yystack[$this->yyidx]->stateno; - $expected = self::$yyExpectedTokens[$state]; - if (in_array($token, self::$yyExpectedTokens[$state], true)) { - return $expected; - } - $stack = $this->yystack; - $yyidx = $this->yyidx; - do { - $yyact = $this->yy_find_shift_action($token); - if ($yyact >= self::YYNSTATE && $yyact < self::YYNSTATE + self::YYNRULE) { - // reduce action - $done = 0; - do { - if ($done++ == 100) { - $this->yyidx = $yyidx; - $this->yystack = $stack; - // too much recursion prevents proper detection - // so give up - return array_unique($expected); - } - $yyruleno = $yyact - self::YYNSTATE; - $this->yyidx -= self::$yyRuleInfo[$yyruleno]['rhs']; - $nextstate = $this->yy_find_reduce_action( - $this->yystack[$this->yyidx]->stateno, - self::$yyRuleInfo[$yyruleno]['lhs']); - if (isset(self::$yyExpectedTokens[$nextstate])) { - $expected = array_merge($expected, self::$yyExpectedTokens[$nextstate]); - if (in_array($token, - self::$yyExpectedTokens[$nextstate], true)) { - $this->yyidx = $yyidx; - $this->yystack = $stack; - return array_unique($expected); - } - } - if ($nextstate < self::YYNSTATE) { - // we need to shift a non-terminal - $this->yyidx++; - $x = new TP_yyStackEntry; - $x->stateno = $nextstate; - $x->major = self::$yyRuleInfo[$yyruleno]['lhs']; - $this->yystack[$this->yyidx] = $x; - continue 2; - } elseif ($nextstate == self::YYNSTATE + self::YYNRULE + 1) { - $this->yyidx = $yyidx; - $this->yystack = $stack; - // the last token was just ignored, we can't accept - // by ignoring input, this is in essence ignoring a - // syntax error! - return array_unique($expected); - } elseif ($nextstate === self::YY_NO_ACTION) { - $this->yyidx = $yyidx; - $this->yystack = $stack; - // input accepted, but not shifted (I guess) - return $expected; - } else { - $yyact = $nextstate; - } - } while (true); - } - break; - } while (true); - $this->yyidx = $yyidx; - $this->yystack = $stack; - return array_unique($expected); - } - - function yy_is_expected_token($token) - { - if ($token === 0) { - return true; // 0 is not part of this - } - $state = $this->yystack[$this->yyidx]->stateno; - if (in_array($token, self::$yyExpectedTokens[$state], true)) { - return true; - } - $stack = $this->yystack; - $yyidx = $this->yyidx; - do { - $yyact = $this->yy_find_shift_action($token); - if ($yyact >= self::YYNSTATE && $yyact < self::YYNSTATE + self::YYNRULE) { - // reduce action - $done = 0; - do { - if ($done++ == 100) { - $this->yyidx = $yyidx; - $this->yystack = $stack; - // too much recursion prevents proper detection - // so give up - return true; - } - $yyruleno = $yyact - self::YYNSTATE; - $this->yyidx -= self::$yyRuleInfo[$yyruleno]['rhs']; - $nextstate = $this->yy_find_reduce_action( - $this->yystack[$this->yyidx]->stateno, - self::$yyRuleInfo[$yyruleno]['lhs']); - if (isset(self::$yyExpectedTokens[$nextstate]) && - in_array($token, self::$yyExpectedTokens[$nextstate], true)) { - $this->yyidx = $yyidx; - $this->yystack = $stack; - return true; - } - if ($nextstate < self::YYNSTATE) { - // we need to shift a non-terminal - $this->yyidx++; - $x = new TP_yyStackEntry; - $x->stateno = $nextstate; - $x->major = self::$yyRuleInfo[$yyruleno]['lhs']; - $this->yystack[$this->yyidx] = $x; - continue 2; - } elseif ($nextstate == self::YYNSTATE + self::YYNRULE + 1) { - $this->yyidx = $yyidx; - $this->yystack = $stack; - if (!$token) { - // end of input: this is valid - return true; - } - // the last token was just ignored, we can't accept - // by ignoring input, this is in essence ignoring a - // syntax error! - return false; - } elseif ($nextstate === self::YY_NO_ACTION) { - $this->yyidx = $yyidx; - $this->yystack = $stack; - // input accepted, but not shifted (I guess) - return true; - } else { - $yyact = $nextstate; - } - } while (true); - } - break; - } while (true); - $this->yyidx = $yyidx; - $this->yystack = $stack; - return true; - } - - function yy_find_shift_action($iLookAhead) - { - $stateno = $this->yystack[$this->yyidx]->stateno; - - /* if ($this->yyidx < 0) return self::YY_NO_ACTION; */ - if (!isset(self::$yy_shift_ofst[$stateno])) { - // no shift actions - return self::$yy_default[$stateno]; - } - $i = self::$yy_shift_ofst[$stateno]; - if ($i === self::YY_SHIFT_USE_DFLT) { - return self::$yy_default[$stateno]; - } - if ($iLookAhead == self::YYNOCODE) { - return self::YY_NO_ACTION; - } - $i += $iLookAhead; - if ($i < 0 || $i >= self::YY_SZ_ACTTAB || - self::$yy_lookahead[$i] != $iLookAhead) { - if (count(self::$yyFallback) && $iLookAhead < count(self::$yyFallback) - && ($iFallback = self::$yyFallback[$iLookAhead]) != 0) { - if (self::$yyTraceFILE) { - fwrite(self::$yyTraceFILE, self::$yyTracePrompt . "FALLBACK " . - $this->yyTokenName[$iLookAhead] . " => " . - $this->yyTokenName[$iFallback] . "\n"); - } - return $this->yy_find_shift_action($iFallback); - } - return self::$yy_default[$stateno]; - } else { - return self::$yy_action[$i]; - } - } - - function yy_find_reduce_action($stateno, $iLookAhead) - { - /* $stateno = $this->yystack[$this->yyidx]->stateno; */ - - if (!isset(self::$yy_reduce_ofst[$stateno])) { - return self::$yy_default[$stateno]; - } - $i = self::$yy_reduce_ofst[$stateno]; - if ($i == self::YY_REDUCE_USE_DFLT) { - return self::$yy_default[$stateno]; - } - if ($iLookAhead == self::YYNOCODE) { - return self::YY_NO_ACTION; - } - $i += $iLookAhead; - if ($i < 0 || $i >= self::YY_SZ_ACTTAB || - self::$yy_lookahead[$i] != $iLookAhead) { - return self::$yy_default[$stateno]; - } else { - return self::$yy_action[$i]; - } - } - - function yy_shift($yyNewState, $yyMajor, $yypMinor) - { - $this->yyidx++; - if ($this->yyidx >= self::YYSTACKDEPTH) { - $this->yyidx--; - if (self::$yyTraceFILE) { - fprintf(self::$yyTraceFILE, "%sStack Overflow!\n", self::$yyTracePrompt); - } - while ($this->yyidx >= 0) { - $this->yy_pop_parser_stack(); - } -#line 84 "smarty_internal_templateparser.y" - - $this->internalError = true; - $this->compiler->trigger_template_error("Stack overflow in template parser"); -#line 1724 "smarty_internal_templateparser.php" - return; - } - $yytos = new TP_yyStackEntry; - $yytos->stateno = $yyNewState; - $yytos->major = $yyMajor; - $yytos->minor = $yypMinor; - array_push($this->yystack, $yytos); - if (self::$yyTraceFILE && $this->yyidx > 0) { - fprintf(self::$yyTraceFILE, "%sShift %d\n", self::$yyTracePrompt, - $yyNewState); - fprintf(self::$yyTraceFILE, "%sStack:", self::$yyTracePrompt); - for($i = 1; $i <= $this->yyidx; $i++) { - fprintf(self::$yyTraceFILE, " %s", - $this->yyTokenName[$this->yystack[$i]->major]); - } - fwrite(self::$yyTraceFILE,"\n"); - } - } - - static public $yyRuleInfo = array( - array( 'lhs' => 82, 'rhs' => 1 ), - array( 'lhs' => 83, 'rhs' => 1 ), - array( 'lhs' => 83, 'rhs' => 2 ), - array( 'lhs' => 83, 'rhs' => 0 ), - array( 'lhs' => 84, 'rhs' => 1 ), - array( 'lhs' => 84, 'rhs' => 1 ), - array( 'lhs' => 84, 'rhs' => 1 ), - array( 'lhs' => 84, 'rhs' => 1 ), - array( 'lhs' => 84, 'rhs' => 1 ), - array( 'lhs' => 84, 'rhs' => 1 ), - array( 'lhs' => 84, 'rhs' => 1 ), - array( 'lhs' => 84, 'rhs' => 1 ), - array( 'lhs' => 84, 'rhs' => 1 ), - array( 'lhs' => 84, 'rhs' => 1 ), - array( 'lhs' => 84, 'rhs' => 1 ), - array( 'lhs' => 84, 'rhs' => 1 ), - array( 'lhs' => 86, 'rhs' => 2 ), - array( 'lhs' => 86, 'rhs' => 3 ), - array( 'lhs' => 87, 'rhs' => 2 ), - array( 'lhs' => 87, 'rhs' => 0 ), - array( 'lhs' => 88, 'rhs' => 1 ), - array( 'lhs' => 88, 'rhs' => 1 ), - array( 'lhs' => 88, 'rhs' => 1 ), - array( 'lhs' => 88, 'rhs' => 1 ), - array( 'lhs' => 88, 'rhs' => 1 ), - array( 'lhs' => 88, 'rhs' => 1 ), - array( 'lhs' => 88, 'rhs' => 1 ), - array( 'lhs' => 85, 'rhs' => 3 ), - array( 'lhs' => 85, 'rhs' => 5 ), - array( 'lhs' => 85, 'rhs' => 4 ), - array( 'lhs' => 85, 'rhs' => 5 ), - array( 'lhs' => 85, 'rhs' => 4 ), - array( 'lhs' => 85, 'rhs' => 6 ), - array( 'lhs' => 85, 'rhs' => 6 ), - array( 'lhs' => 85, 'rhs' => 7 ), - array( 'lhs' => 85, 'rhs' => 6 ), - array( 'lhs' => 85, 'rhs' => 4 ), - array( 'lhs' => 85, 'rhs' => 3 ), - array( 'lhs' => 85, 'rhs' => 6 ), - array( 'lhs' => 85, 'rhs' => 5 ), - array( 'lhs' => 85, 'rhs' => 7 ), - array( 'lhs' => 85, 'rhs' => 3 ), - array( 'lhs' => 85, 'rhs' => 4 ), - array( 'lhs' => 85, 'rhs' => 3 ), - array( 'lhs' => 85, 'rhs' => 4 ), - array( 'lhs' => 85, 'rhs' => 12 ), - array( 'lhs' => 98, 'rhs' => 2 ), - array( 'lhs' => 98, 'rhs' => 1 ), - array( 'lhs' => 85, 'rhs' => 6 ), - array( 'lhs' => 85, 'rhs' => 8 ), - array( 'lhs' => 85, 'rhs' => 3 ), - array( 'lhs' => 85, 'rhs' => 8 ), - array( 'lhs' => 85, 'rhs' => 11 ), - array( 'lhs' => 85, 'rhs' => 8 ), - array( 'lhs' => 85, 'rhs' => 11 ), - array( 'lhs' => 85, 'rhs' => 4 ), - array( 'lhs' => 85, 'rhs' => 5 ), - array( 'lhs' => 85, 'rhs' => 1 ), - array( 'lhs' => 85, 'rhs' => 3 ), - array( 'lhs' => 85, 'rhs' => 4 ), - array( 'lhs' => 85, 'rhs' => 5 ), - array( 'lhs' => 85, 'rhs' => 6 ), - array( 'lhs' => 91, 'rhs' => 2 ), - array( 'lhs' => 91, 'rhs' => 1 ), - array( 'lhs' => 91, 'rhs' => 0 ), - array( 'lhs' => 100, 'rhs' => 4 ), - array( 'lhs' => 100, 'rhs' => 2 ), - array( 'lhs' => 100, 'rhs' => 2 ), - array( 'lhs' => 100, 'rhs' => 2 ), - array( 'lhs' => 100, 'rhs' => 2 ), - array( 'lhs' => 100, 'rhs' => 2 ), - array( 'lhs' => 100, 'rhs' => 4 ), - array( 'lhs' => 95, 'rhs' => 1 ), - array( 'lhs' => 95, 'rhs' => 3 ), - array( 'lhs' => 94, 'rhs' => 4 ), - array( 'lhs' => 94, 'rhs' => 3 ), - array( 'lhs' => 94, 'rhs' => 3 ), - array( 'lhs' => 92, 'rhs' => 1 ), - array( 'lhs' => 92, 'rhs' => 1 ), - array( 'lhs' => 92, 'rhs' => 4 ), - array( 'lhs' => 92, 'rhs' => 3 ), - array( 'lhs' => 92, 'rhs' => 3 ), - array( 'lhs' => 92, 'rhs' => 3 ), - array( 'lhs' => 92, 'rhs' => 1 ), - array( 'lhs' => 92, 'rhs' => 2 ), - array( 'lhs' => 92, 'rhs' => 3 ), - array( 'lhs' => 92, 'rhs' => 3 ), - array( 'lhs' => 92, 'rhs' => 3 ), - array( 'lhs' => 92, 'rhs' => 3 ), - array( 'lhs' => 92, 'rhs' => 3 ), - array( 'lhs' => 92, 'rhs' => 3 ), - array( 'lhs' => 92, 'rhs' => 2 ), - array( 'lhs' => 92, 'rhs' => 2 ), - array( 'lhs' => 92, 'rhs' => 3 ), - array( 'lhs' => 92, 'rhs' => 3 ), - array( 'lhs' => 92, 'rhs' => 2 ), - array( 'lhs' => 92, 'rhs' => 2 ), - array( 'lhs' => 92, 'rhs' => 3 ), - array( 'lhs' => 92, 'rhs' => 3 ), - array( 'lhs' => 92, 'rhs' => 3 ), - array( 'lhs' => 92, 'rhs' => 3 ), - array( 'lhs' => 101, 'rhs' => 8 ), - array( 'lhs' => 101, 'rhs' => 7 ), - array( 'lhs' => 89, 'rhs' => 1 ), - array( 'lhs' => 89, 'rhs' => 2 ), - array( 'lhs' => 89, 'rhs' => 2 ), - array( 'lhs' => 89, 'rhs' => 2 ), - array( 'lhs' => 89, 'rhs' => 2 ), - array( 'lhs' => 89, 'rhs' => 1 ), - array( 'lhs' => 89, 'rhs' => 1 ), - array( 'lhs' => 89, 'rhs' => 3 ), - array( 'lhs' => 89, 'rhs' => 2 ), - array( 'lhs' => 89, 'rhs' => 2 ), - array( 'lhs' => 89, 'rhs' => 1 ), - array( 'lhs' => 89, 'rhs' => 1 ), - array( 'lhs' => 89, 'rhs' => 3 ), - array( 'lhs' => 89, 'rhs' => 1 ), - array( 'lhs' => 89, 'rhs' => 1 ), - array( 'lhs' => 89, 'rhs' => 3 ), - array( 'lhs' => 89, 'rhs' => 3 ), - array( 'lhs' => 89, 'rhs' => 1 ), - array( 'lhs' => 89, 'rhs' => 2 ), - array( 'lhs' => 105, 'rhs' => 1 ), - array( 'lhs' => 105, 'rhs' => 4 ), - array( 'lhs' => 105, 'rhs' => 1 ), - array( 'lhs' => 105, 'rhs' => 3 ), - array( 'lhs' => 105, 'rhs' => 4 ), - array( 'lhs' => 105, 'rhs' => 3 ), - array( 'lhs' => 105, 'rhs' => 4 ), - array( 'lhs' => 93, 'rhs' => 3 ), - array( 'lhs' => 110, 'rhs' => 2 ), - array( 'lhs' => 110, 'rhs' => 0 ), - array( 'lhs' => 111, 'rhs' => 3 ), - array( 'lhs' => 111, 'rhs' => 5 ), - array( 'lhs' => 111, 'rhs' => 2 ), - array( 'lhs' => 111, 'rhs' => 2 ), - array( 'lhs' => 111, 'rhs' => 4 ), - array( 'lhs' => 111, 'rhs' => 3 ), - array( 'lhs' => 111, 'rhs' => 5 ), - array( 'lhs' => 111, 'rhs' => 3 ), - array( 'lhs' => 111, 'rhs' => 2 ), - array( 'lhs' => 97, 'rhs' => 1 ), - array( 'lhs' => 97, 'rhs' => 2 ), - array( 'lhs' => 112, 'rhs' => 1 ), - array( 'lhs' => 112, 'rhs' => 3 ), - array( 'lhs' => 109, 'rhs' => 2 ), - array( 'lhs' => 113, 'rhs' => 1 ), - array( 'lhs' => 113, 'rhs' => 2 ), - array( 'lhs' => 114, 'rhs' => 3 ), - array( 'lhs' => 114, 'rhs' => 4 ), - array( 'lhs' => 114, 'rhs' => 5 ), - array( 'lhs' => 114, 'rhs' => 6 ), - array( 'lhs' => 114, 'rhs' => 2 ), - array( 'lhs' => 106, 'rhs' => 4 ), - array( 'lhs' => 115, 'rhs' => 4 ), - array( 'lhs' => 115, 'rhs' => 5 ), - array( 'lhs' => 116, 'rhs' => 3 ), - array( 'lhs' => 116, 'rhs' => 1 ), - array( 'lhs' => 116, 'rhs' => 0 ), - array( 'lhs' => 90, 'rhs' => 3 ), - array( 'lhs' => 90, 'rhs' => 2 ), - array( 'lhs' => 117, 'rhs' => 3 ), - array( 'lhs' => 117, 'rhs' => 2 ), - array( 'lhs' => 99, 'rhs' => 2 ), - array( 'lhs' => 99, 'rhs' => 0 ), - array( 'lhs' => 118, 'rhs' => 2 ), - array( 'lhs' => 118, 'rhs' => 2 ), - array( 'lhs' => 108, 'rhs' => 1 ), - array( 'lhs' => 108, 'rhs' => 2 ), - array( 'lhs' => 108, 'rhs' => 1 ), - array( 'lhs' => 108, 'rhs' => 3 ), - array( 'lhs' => 108, 'rhs' => 4 ), - array( 'lhs' => 103, 'rhs' => 1 ), - array( 'lhs' => 103, 'rhs' => 1 ), - array( 'lhs' => 103, 'rhs' => 1 ), - array( 'lhs' => 103, 'rhs' => 1 ), - array( 'lhs' => 103, 'rhs' => 1 ), - array( 'lhs' => 103, 'rhs' => 1 ), - array( 'lhs' => 103, 'rhs' => 1 ), - array( 'lhs' => 103, 'rhs' => 1 ), - array( 'lhs' => 103, 'rhs' => 1 ), - array( 'lhs' => 104, 'rhs' => 1 ), - array( 'lhs' => 104, 'rhs' => 1 ), - array( 'lhs' => 104, 'rhs' => 1 ), - array( 'lhs' => 102, 'rhs' => 3 ), - array( 'lhs' => 119, 'rhs' => 1 ), - array( 'lhs' => 119, 'rhs' => 3 ), - array( 'lhs' => 119, 'rhs' => 0 ), - array( 'lhs' => 120, 'rhs' => 3 ), - array( 'lhs' => 120, 'rhs' => 3 ), - array( 'lhs' => 120, 'rhs' => 1 ), - array( 'lhs' => 107, 'rhs' => 2 ), - array( 'lhs' => 107, 'rhs' => 3 ), - array( 'lhs' => 121, 'rhs' => 2 ), - array( 'lhs' => 121, 'rhs' => 1 ), - array( 'lhs' => 122, 'rhs' => 3 ), - array( 'lhs' => 122, 'rhs' => 3 ), - array( 'lhs' => 122, 'rhs' => 1 ), - array( 'lhs' => 122, 'rhs' => 3 ), - array( 'lhs' => 122, 'rhs' => 3 ), - array( 'lhs' => 122, 'rhs' => 1 ), - array( 'lhs' => 122, 'rhs' => 1 ), - array( 'lhs' => 96, 'rhs' => 1 ), - array( 'lhs' => 96, 'rhs' => 0 ), - ); - - static public $yyReduceMap = array( - 0 => 0, - 1 => 1, - 2 => 1, - 4 => 4, - 5 => 5, - 6 => 6, - 7 => 7, - 8 => 8, - 9 => 9, - 10 => 10, - 11 => 11, - 12 => 12, - 13 => 13, - 14 => 14, - 15 => 15, - 16 => 16, - 19 => 16, - 203 => 16, - 17 => 17, - 76 => 17, - 18 => 18, - 104 => 18, - 106 => 18, - 107 => 18, - 130 => 18, - 168 => 18, - 20 => 20, - 21 => 20, - 47 => 20, - 69 => 20, - 70 => 20, - 77 => 20, - 78 => 20, - 83 => 20, - 103 => 20, - 108 => 20, - 109 => 20, - 114 => 20, - 116 => 20, - 117 => 20, - 124 => 20, - 141 => 20, - 167 => 20, - 169 => 20, - 185 => 20, - 190 => 20, - 202 => 20, - 22 => 22, - 23 => 22, - 24 => 24, - 25 => 25, - 26 => 26, - 27 => 27, - 28 => 28, - 29 => 29, - 31 => 29, - 30 => 30, - 32 => 32, - 33 => 32, - 34 => 34, - 35 => 35, - 36 => 36, - 37 => 37, - 38 => 38, - 39 => 39, - 40 => 40, - 41 => 41, - 42 => 42, - 44 => 42, - 43 => 43, - 45 => 45, - 46 => 46, - 48 => 48, - 49 => 49, - 50 => 50, - 51 => 51, - 52 => 52, - 53 => 53, - 54 => 54, - 55 => 55, - 56 => 56, - 57 => 57, - 58 => 58, - 59 => 59, - 60 => 60, - 61 => 61, - 62 => 62, - 63 => 63, - 72 => 63, - 157 => 63, - 161 => 63, - 165 => 63, - 166 => 63, - 64 => 64, - 158 => 64, - 164 => 64, - 65 => 65, - 66 => 66, - 67 => 66, - 68 => 68, - 71 => 71, - 73 => 73, - 74 => 74, - 75 => 74, - 79 => 79, - 80 => 80, - 81 => 80, - 82 => 80, - 84 => 84, - 121 => 84, - 85 => 85, - 88 => 85, - 99 => 85, - 86 => 86, - 87 => 87, - 89 => 89, - 90 => 90, - 91 => 91, - 96 => 91, - 92 => 92, - 95 => 92, - 93 => 93, - 98 => 93, - 94 => 94, - 97 => 94, - 100 => 100, - 101 => 101, - 102 => 102, - 105 => 105, - 110 => 110, - 111 => 111, - 112 => 112, - 113 => 113, - 115 => 115, - 118 => 118, - 119 => 119, - 120 => 120, - 122 => 122, - 123 => 123, - 125 => 125, - 126 => 126, - 127 => 127, - 128 => 128, - 129 => 129, - 131 => 131, - 187 => 131, - 132 => 132, - 133 => 133, - 134 => 134, - 135 => 135, - 136 => 136, - 139 => 136, - 137 => 137, - 138 => 138, - 140 => 140, - 142 => 142, - 143 => 143, - 144 => 144, - 145 => 145, - 146 => 146, - 147 => 147, - 148 => 148, - 149 => 149, - 150 => 150, - 151 => 151, - 152 => 152, - 153 => 153, - 154 => 154, - 155 => 155, - 156 => 156, - 159 => 159, - 160 => 160, - 162 => 162, - 163 => 163, - 170 => 170, - 171 => 171, - 172 => 172, - 173 => 173, - 174 => 174, - 175 => 175, - 176 => 176, - 177 => 177, - 178 => 178, - 179 => 179, - 180 => 180, - 181 => 181, - 182 => 182, - 183 => 183, - 184 => 184, - 186 => 186, - 188 => 188, - 189 => 189, - 191 => 191, - 192 => 192, - 193 => 193, - 194 => 194, - 195 => 195, - 196 => 195, - 198 => 195, - 197 => 197, - 199 => 199, - 200 => 200, - 201 => 201, - ); -#line 95 "smarty_internal_templateparser.y" - function yy_r0(){ - $this->_retvalue = $this->root_buffer->to_smarty_php(); - } -#line 2160 "smarty_internal_templateparser.php" -#line 103 "smarty_internal_templateparser.y" - function yy_r1(){ - $this->current_buffer->append_subtree($this->yystack[$this->yyidx + 0]->minor); - } -#line 2165 "smarty_internal_templateparser.php" -#line 119 "smarty_internal_templateparser.y" - function yy_r4(){ - if ($this->compiler->has_code) { - $tmp =''; foreach ($this->compiler->prefix_code as $code) {$tmp.=$code;} $this->compiler->prefix_code=array(); - $this->_retvalue = new _smarty_tag($this, $this->compiler->processNocacheCode($tmp.$this->yystack[$this->yyidx + 0]->minor,true)); - } else { - $this->_retvalue = new _smarty_tag($this, $this->yystack[$this->yyidx + 0]->minor); - } - $this->compiler->has_variable_string = false; - $this->block_nesting_level = count($this->compiler->_tag_stack); - } -#line 2177 "smarty_internal_templateparser.php" -#line 131 "smarty_internal_templateparser.y" - function yy_r5(){ - $this->_retvalue = new _smarty_tag($this, ''); - } -#line 2182 "smarty_internal_templateparser.php" -#line 136 "smarty_internal_templateparser.y" - function yy_r6(){ - $this->_retvalue = new _smarty_text($this, $this->yystack[$this->yyidx + 0]->minor); - } -#line 2187 "smarty_internal_templateparser.php" -#line 141 "smarty_internal_templateparser.y" - function yy_r7(){ - if ($this->php_handling == Smarty::PHP_PASSTHRU) { - $this->_retvalue = new _smarty_text($this, self::escape_start_tag($this->yystack[$this->yyidx + 0]->minor)); - } elseif ($this->php_handling == Smarty::PHP_QUOTE) { - $this->_retvalue = new _smarty_text($this, htmlspecialchars($this->yystack[$this->yyidx + 0]->minor, ENT_QUOTES)); - } elseif ($this->php_handling == Smarty::PHP_ALLOW) { - if (!($this->smarty instanceof SmartyBC)) { - $this->compiler->trigger_template_error (self::Err3); - } - $this->_retvalue = new _smarty_text($this, $this->compiler->processNocacheCode('php_handling == Smarty::PHP_REMOVE) { - $this->_retvalue = new _smarty_text($this, ''); - } - } -#line 2203 "smarty_internal_templateparser.php" -#line 157 "smarty_internal_templateparser.y" - function yy_r8(){ - if ($this->is_xml) { - $this->compiler->tag_nocache = true; - $this->is_xml = false; - $save = $this->template->has_nocache_code; - $this->_retvalue = new _smarty_text($this, $this->compiler->processNocacheCode("';?>\n", $this->compiler, true)); - $this->template->has_nocache_code = $save; - } elseif ($this->php_handling == Smarty::PHP_PASSTHRU) { - $this->_retvalue = new _smarty_text($this, '?>'); - } elseif ($this->php_handling == Smarty::PHP_QUOTE) { - $this->_retvalue = new _smarty_text($this, htmlspecialchars('?>', ENT_QUOTES)); - } elseif ($this->php_handling == Smarty::PHP_ALLOW) { - $this->_retvalue = new _smarty_text($this, $this->compiler->processNocacheCode('?>', true)); - } elseif ($this->php_handling == Smarty::PHP_REMOVE) { - $this->_retvalue = new _smarty_text($this, ''); - } - } -#line 2222 "smarty_internal_templateparser.php" -#line 176 "smarty_internal_templateparser.y" - function yy_r9(){ - if ($this->php_handling == Smarty::PHP_PASSTHRU) { - $this->_retvalue = new _smarty_text($this, '<%'); - } elseif ($this->php_handling == Smarty::PHP_QUOTE) { - $this->_retvalue = new _smarty_text($this, htmlspecialchars($this->yystack[$this->yyidx + 0]->minor, ENT_QUOTES)); - } elseif ($this->php_handling == Smarty::PHP_ALLOW) { - if ($this->asp_tags) { - if (!($this->smarty instanceof SmartyBC)) { - $this->compiler->trigger_template_error (self::Err3); - } - $this->_retvalue = new _smarty_text($this, $this->compiler->processNocacheCode('<%', true)); - } else { - $this->_retvalue = new _smarty_text($this, '<%'); - } - } elseif ($this->php_handling == Smarty::PHP_REMOVE) { - if ($this->asp_tags) { - $this->_retvalue = new _smarty_text($this, ''); - } else { - $this->_retvalue = new _smarty_text($this, '<%'); - } - } - } -#line 2246 "smarty_internal_templateparser.php" -#line 200 "smarty_internal_templateparser.y" - function yy_r10(){ - if ($this->php_handling == Smarty::PHP_PASSTHRU) { - $this->_retvalue = new _smarty_text($this, '%>'); - } elseif ($this->php_handling == Smarty::PHP_QUOTE) { - $this->_retvalue = new _smarty_text($this, htmlspecialchars('%>', ENT_QUOTES)); - } elseif ($this->php_handling == Smarty::PHP_ALLOW) { - if ($this->asp_tags) { - $this->_retvalue = new _smarty_text($this, $this->compiler->processNocacheCode('%>', true)); - } else { - $this->_retvalue = new _smarty_text($this, '%>'); - } - } elseif ($this->php_handling == Smarty::PHP_REMOVE) { - if ($this->asp_tags) { - $this->_retvalue = new _smarty_text($this, ''); - } else { - $this->_retvalue = new _smarty_text($this, '%>'); - } - } - } -#line 2267 "smarty_internal_templateparser.php" -#line 220 "smarty_internal_templateparser.y" - function yy_r11(){ - if ($this->strip) { - $this->_retvalue = new _smarty_text($this, preg_replace('![\t ]*[\r\n]+[\t ]*!', '', self::escape_start_tag($this->yystack[$this->yyidx + 0]->minor))); - } else { - $this->_retvalue = new _smarty_text($this, self::escape_start_tag($this->yystack[$this->yyidx + 0]->minor)); - } - } -#line 2276 "smarty_internal_templateparser.php" -#line 229 "smarty_internal_templateparser.y" - function yy_r12(){ - $this->compiler->tag_nocache = true; - $this->is_xml = true; - $save = $this->template->has_nocache_code; - $this->_retvalue = new _smarty_text($this, $this->compiler->processNocacheCode("", $this->compiler, true)); - $this->template->has_nocache_code = $save; - } -#line 2285 "smarty_internal_templateparser.php" -#line 238 "smarty_internal_templateparser.y" - function yy_r13(){ - if ($this->strip) { - $this->_retvalue = new _smarty_text($this, preg_replace('![\t ]*[\r\n]+[\t ]*!', '', $this->yystack[$this->yyidx + 0]->minor)); - } else { - $this->_retvalue = new _smarty_text($this, $this->yystack[$this->yyidx + 0]->minor); - } - } -#line 2294 "smarty_internal_templateparser.php" -#line 247 "smarty_internal_templateparser.y" - function yy_r14(){ - $this->strip = true; - $this->_retvalue = new _smarty_text($this, ''); - } -#line 2300 "smarty_internal_templateparser.php" -#line 252 "smarty_internal_templateparser.y" - function yy_r15(){ - $this->strip = false; - $this->_retvalue = new _smarty_text($this, ''); - } -#line 2306 "smarty_internal_templateparser.php" -#line 258 "smarty_internal_templateparser.y" - function yy_r16(){ - $this->_retvalue = ''; - } -#line 2311 "smarty_internal_templateparser.php" -#line 262 "smarty_internal_templateparser.y" - function yy_r17(){ - $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor; - } -#line 2316 "smarty_internal_templateparser.php" -#line 266 "smarty_internal_templateparser.y" - function yy_r18(){ - $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor; - } -#line 2321 "smarty_internal_templateparser.php" -#line 274 "smarty_internal_templateparser.y" - function yy_r20(){ - $this->_retvalue = $this->yystack[$this->yyidx + 0]->minor; - } -#line 2326 "smarty_internal_templateparser.php" -#line 282 "smarty_internal_templateparser.y" - function yy_r22(){ - $this->_retvalue = self::escape_start_tag($this->yystack[$this->yyidx + 0]->minor); - } -#line 2331 "smarty_internal_templateparser.php" -#line 290 "smarty_internal_templateparser.y" - function yy_r24(){ - $this->_retvalue = self::escape_end_tag($this->yystack[$this->yyidx + 0]->minor); - } -#line 2336 "smarty_internal_templateparser.php" -#line 294 "smarty_internal_templateparser.y" - function yy_r25(){ - $this->_retvalue = '<%'; - } -#line 2341 "smarty_internal_templateparser.php" -#line 298 "smarty_internal_templateparser.y" - function yy_r26(){ - $this->_retvalue = '%>'; - } -#line 2346 "smarty_internal_templateparser.php" -#line 307 "smarty_internal_templateparser.y" - function yy_r27(){ - $this->_retvalue = $this->compiler->compileTag('private_print_expression',array(),array('value'=>$this->yystack[$this->yyidx + -1]->minor)); - } -#line 2351 "smarty_internal_templateparser.php" -#line 311 "smarty_internal_templateparser.y" - function yy_r28(){ - $this->_retvalue = $this->compiler->compileTag('private_print_expression',$this->yystack[$this->yyidx + -1]->minor,array('value'=>$this->yystack[$this->yyidx + -3]->minor, 'modifierlist'=>$this->yystack[$this->yyidx + -2]->minor)); - } -#line 2356 "smarty_internal_templateparser.php" -#line 315 "smarty_internal_templateparser.y" - function yy_r29(){ - $this->_retvalue = $this->compiler->compileTag('private_print_expression',$this->yystack[$this->yyidx + -1]->minor,array('value'=>$this->yystack[$this->yyidx + -2]->minor)); - } -#line 2361 "smarty_internal_templateparser.php" -#line 319 "smarty_internal_templateparser.y" - function yy_r30(){ - $this->_retvalue = $this->compiler->compileTag('private_print_expression',$this->yystack[$this->yyidx + -1]->minor,array('value'=>$this->yystack[$this->yyidx + -3]->minor,'modifierlist'=>$this->yystack[$this->yyidx + -2]->minor)); - } -#line 2366 "smarty_internal_templateparser.php" -#line 332 "smarty_internal_templateparser.y" - function yy_r32(){ - $this->_retvalue = $this->compiler->compileTag('assign',array(array('value'=>$this->yystack[$this->yyidx + -1]->minor),array('var'=>"'".$this->yystack[$this->yyidx + -3]->minor."'"))); - } -#line 2371 "smarty_internal_templateparser.php" -#line 340 "smarty_internal_templateparser.y" - function yy_r34(){ - $this->_retvalue = $this->compiler->compileTag('assign',array_merge(array(array('value'=>$this->yystack[$this->yyidx + -2]->minor),array('var'=>"'".$this->yystack[$this->yyidx + -4]->minor."'")),$this->yystack[$this->yyidx + -1]->minor)); - } -#line 2376 "smarty_internal_templateparser.php" -#line 344 "smarty_internal_templateparser.y" - function yy_r35(){ - $this->_retvalue = $this->compiler->compileTag('assign',array_merge(array(array('value'=>$this->yystack[$this->yyidx + -2]->minor),array('var'=>$this->yystack[$this->yyidx + -4]->minor['var'])),$this->yystack[$this->yyidx + -1]->minor),array('smarty_internal_index'=>$this->yystack[$this->yyidx + -4]->minor['smarty_internal_index'])); - } -#line 2381 "smarty_internal_templateparser.php" -#line 349 "smarty_internal_templateparser.y" - function yy_r36(){ - $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + -2]->minor,$this->yystack[$this->yyidx + -1]->minor); - } -#line 2386 "smarty_internal_templateparser.php" -#line 353 "smarty_internal_templateparser.y" - function yy_r37(){ - $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + -1]->minor,array()); - } -#line 2391 "smarty_internal_templateparser.php" -#line 358 "smarty_internal_templateparser.y" - function yy_r38(){ - $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + -4]->minor,$this->yystack[$this->yyidx + -1]->minor,array('object_methode'=>$this->yystack[$this->yyidx + -2]->minor)); - } -#line 2396 "smarty_internal_templateparser.php" -#line 363 "smarty_internal_templateparser.y" - function yy_r39(){ - $this->_retvalue = ''.$this->compiler->compileTag($this->yystack[$this->yyidx + -3]->minor,$this->yystack[$this->yyidx + -1]->minor).'_retvalue .= $this->compiler->compileTag('private_modifier',array(),array('modifierlist'=>$this->yystack[$this->yyidx + -2]->minor,'value'=>'ob_get_clean()')).'?>'; - } -#line 2402 "smarty_internal_templateparser.php" -#line 369 "smarty_internal_templateparser.y" - function yy_r40(){ - $this->_retvalue = ''.$this->compiler->compileTag($this->yystack[$this->yyidx + -5]->minor,$this->yystack[$this->yyidx + -1]->minor,array('object_methode'=>$this->yystack[$this->yyidx + -3]->minor)).'_retvalue .= $this->compiler->compileTag('private_modifier',array(),array('modifierlist'=>$this->yystack[$this->yyidx + -2]->minor,'value'=>'ob_get_clean()')).'?>'; - } -#line 2408 "smarty_internal_templateparser.php" -#line 375 "smarty_internal_templateparser.y" - function yy_r41(){ - $tag = trim(substr($this->yystack[$this->yyidx + -2]->minor,$this->lex->ldel_length)); - $this->_retvalue = $this->compiler->compileTag(($tag == 'else if')? 'elseif' : $tag,array(),array('if condition'=>$this->yystack[$this->yyidx + -1]->minor)); - } -#line 2414 "smarty_internal_templateparser.php" -#line 380 "smarty_internal_templateparser.y" - function yy_r42(){ - $tag = trim(substr($this->yystack[$this->yyidx + -3]->minor,$this->lex->ldel_length)); - $this->_retvalue = $this->compiler->compileTag(($tag == 'else if')? 'elseif' : $tag,$this->yystack[$this->yyidx + -1]->minor,array('if condition'=>$this->yystack[$this->yyidx + -2]->minor)); - } -#line 2420 "smarty_internal_templateparser.php" -#line 385 "smarty_internal_templateparser.y" - function yy_r43(){ - $tag = trim(substr($this->yystack[$this->yyidx + -2]->minor,$this->lex->ldel_length)); - $this->_retvalue = $this->compiler->compileTag(($tag == 'else if')? 'elseif' : $tag,array(),array('if condition'=>$this->yystack[$this->yyidx + -1]->minor)); - } -#line 2426 "smarty_internal_templateparser.php" -#line 396 "smarty_internal_templateparser.y" - function yy_r45(){ - $this->_retvalue = $this->compiler->compileTag('for',array_merge($this->yystack[$this->yyidx + -1]->minor,array(array('start'=>$this->yystack[$this->yyidx + -10]->minor),array('ifexp'=>$this->yystack[$this->yyidx + -7]->minor),array('var'=>$this->yystack[$this->yyidx + -3]->minor),array('step'=>$this->yystack[$this->yyidx + -2]->minor))),1); - } -#line 2431 "smarty_internal_templateparser.php" -#line 400 "smarty_internal_templateparser.y" - function yy_r46(){ - $this->_retvalue = '='.$this->yystack[$this->yyidx + 0]->minor; - } -#line 2436 "smarty_internal_templateparser.php" -#line 408 "smarty_internal_templateparser.y" - function yy_r48(){ - $this->_retvalue = $this->compiler->compileTag('for',array_merge($this->yystack[$this->yyidx + -1]->minor,array(array('start'=>$this->yystack[$this->yyidx + -4]->minor),array('to'=>$this->yystack[$this->yyidx + -2]->minor))),0); - } -#line 2441 "smarty_internal_templateparser.php" -#line 412 "smarty_internal_templateparser.y" - function yy_r49(){ - $this->_retvalue = $this->compiler->compileTag('for',array_merge($this->yystack[$this->yyidx + -1]->minor,array(array('start'=>$this->yystack[$this->yyidx + -6]->minor),array('to'=>$this->yystack[$this->yyidx + -4]->minor),array('step'=>$this->yystack[$this->yyidx + -2]->minor))),0); - } -#line 2446 "smarty_internal_templateparser.php" -#line 417 "smarty_internal_templateparser.y" - function yy_r50(){ - $this->_retvalue = $this->compiler->compileTag('foreach',$this->yystack[$this->yyidx + -1]->minor); - } -#line 2451 "smarty_internal_templateparser.php" -#line 422 "smarty_internal_templateparser.y" - function yy_r51(){ - $this->_retvalue = $this->compiler->compileTag('foreach',array_merge($this->yystack[$this->yyidx + -1]->minor,array(array('from'=>$this->yystack[$this->yyidx + -5]->minor),array('item'=>$this->yystack[$this->yyidx + -2]->minor)))); - } -#line 2456 "smarty_internal_templateparser.php" -#line 426 "smarty_internal_templateparser.y" - function yy_r52(){ - $this->_retvalue = $this->compiler->compileTag('foreach',array_merge($this->yystack[$this->yyidx + -1]->minor,array(array('from'=>$this->yystack[$this->yyidx + -8]->minor),array('item'=>$this->yystack[$this->yyidx + -2]->minor),array('key'=>$this->yystack[$this->yyidx + -5]->minor)))); - } -#line 2461 "smarty_internal_templateparser.php" -#line 430 "smarty_internal_templateparser.y" - function yy_r53(){ - $this->_retvalue = $this->compiler->compileTag('foreach',array_merge($this->yystack[$this->yyidx + -1]->minor,array(array('from'=>$this->yystack[$this->yyidx + -5]->minor),array('item'=>$this->yystack[$this->yyidx + -2]->minor)))); - } -#line 2466 "smarty_internal_templateparser.php" -#line 434 "smarty_internal_templateparser.y" - function yy_r54(){ - $this->_retvalue = $this->compiler->compileTag('foreach',array_merge($this->yystack[$this->yyidx + -1]->minor,array(array('from'=>$this->yystack[$this->yyidx + -8]->minor),array('item'=>$this->yystack[$this->yyidx + -2]->minor),array('key'=>$this->yystack[$this->yyidx + -5]->minor)))); - } -#line 2471 "smarty_internal_templateparser.php" -#line 439 "smarty_internal_templateparser.y" - function yy_r55(){ - $this->_retvalue = $this->compiler->compileTag('setfilter',array(),array('modifier_list'=>array(array_merge(array($this->yystack[$this->yyidx + -2]->minor),$this->yystack[$this->yyidx + -1]->minor)))); - } -#line 2476 "smarty_internal_templateparser.php" -#line 443 "smarty_internal_templateparser.y" - function yy_r56(){ - $this->_retvalue = $this->compiler->compileTag('setfilter',array(),array('modifier_list'=>array_merge(array(array_merge(array($this->yystack[$this->yyidx + -3]->minor),$this->yystack[$this->yyidx + -2]->minor)),$this->yystack[$this->yyidx + -1]->minor))); - } -#line 2481 "smarty_internal_templateparser.php" -#line 448 "smarty_internal_templateparser.y" - function yy_r57(){ - $this->_retvalue = SMARTY_INTERNAL_COMPILE_BLOCK::compileChildBlock($this->compiler); - } -#line 2486 "smarty_internal_templateparser.php" -#line 454 "smarty_internal_templateparser.y" - function yy_r58(){ - $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + -1]->minor.'close',array()); - } -#line 2491 "smarty_internal_templateparser.php" -#line 458 "smarty_internal_templateparser.y" - function yy_r59(){ - $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + -2]->minor.'close',array(),array('modifier_list'=>$this->yystack[$this->yyidx + -1]->minor)); - } -#line 2496 "smarty_internal_templateparser.php" -#line 463 "smarty_internal_templateparser.y" - function yy_r60(){ - $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + -3]->minor.'close',array(),array('object_methode'=>$this->yystack[$this->yyidx + -1]->minor)); - } -#line 2501 "smarty_internal_templateparser.php" -#line 467 "smarty_internal_templateparser.y" - function yy_r61(){ - $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + -4]->minor.'close',array(),array('object_methode'=>$this->yystack[$this->yyidx + -2]->minor, 'modifier_list'=>$this->yystack[$this->yyidx + -1]->minor)); - } -#line 2506 "smarty_internal_templateparser.php" -#line 475 "smarty_internal_templateparser.y" - function yy_r62(){ - $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor; - $this->_retvalue[] = $this->yystack[$this->yyidx + 0]->minor; - } -#line 2512 "smarty_internal_templateparser.php" -#line 481 "smarty_internal_templateparser.y" - function yy_r63(){ - $this->_retvalue = array($this->yystack[$this->yyidx + 0]->minor); - } -#line 2517 "smarty_internal_templateparser.php" -#line 486 "smarty_internal_templateparser.y" - function yy_r64(){ - $this->_retvalue = array(); - } -#line 2522 "smarty_internal_templateparser.php" -#line 491 "smarty_internal_templateparser.y" - function yy_r65(){ - if (preg_match('~^true$~i', $this->yystack[$this->yyidx + 0]->minor)) { - $this->_retvalue = array($this->yystack[$this->yyidx + -2]->minor=>'true'); - } elseif (preg_match('~^false$~i', $this->yystack[$this->yyidx + 0]->minor)) { - $this->_retvalue = array($this->yystack[$this->yyidx + -2]->minor=>'false'); - } elseif (preg_match('~^null$~i', $this->yystack[$this->yyidx + 0]->minor)) { - $this->_retvalue = array($this->yystack[$this->yyidx + -2]->minor=>'null'); - } else { - $this->_retvalue = array($this->yystack[$this->yyidx + -2]->minor=>"'".$this->yystack[$this->yyidx + 0]->minor."'"); - } - } -#line 2535 "smarty_internal_templateparser.php" -#line 503 "smarty_internal_templateparser.y" - function yy_r66(){ - $this->_retvalue = array(trim($this->yystack[$this->yyidx + -1]->minor," =\n\r\t")=>$this->yystack[$this->yyidx + 0]->minor); - } -#line 2540 "smarty_internal_templateparser.php" -#line 511 "smarty_internal_templateparser.y" - function yy_r68(){ - $this->_retvalue = "'".$this->yystack[$this->yyidx + 0]->minor."'"; - } -#line 2545 "smarty_internal_templateparser.php" -#line 523 "smarty_internal_templateparser.y" - function yy_r71(){ - $this->_retvalue = array($this->yystack[$this->yyidx + -2]->minor=>$this->yystack[$this->yyidx + 0]->minor); - } -#line 2550 "smarty_internal_templateparser.php" -#line 536 "smarty_internal_templateparser.y" - function yy_r73(){ - $this->yystack[$this->yyidx + -2]->minor[]=$this->yystack[$this->yyidx + 0]->minor; - $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor; - } -#line 2556 "smarty_internal_templateparser.php" -#line 541 "smarty_internal_templateparser.y" - function yy_r74(){ - $this->_retvalue = array('var' => $this->yystack[$this->yyidx + -2]->minor, 'value'=>$this->yystack[$this->yyidx + 0]->minor); - } -#line 2561 "smarty_internal_templateparser.php" -#line 569 "smarty_internal_templateparser.y" - function yy_r79(){ - $this->_retvalue = '$_smarty_tpl->getStreamVariable(\''. $this->yystack[$this->yyidx + -2]->minor .'://'. $this->yystack[$this->yyidx + 0]->minor . '\')'; - } -#line 2566 "smarty_internal_templateparser.php" -#line 574 "smarty_internal_templateparser.y" - function yy_r80(){ - $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor . trim($this->yystack[$this->yyidx + -1]->minor) . $this->yystack[$this->yyidx + 0]->minor; - } -#line 2571 "smarty_internal_templateparser.php" -#line 593 "smarty_internal_templateparser.y" - function yy_r84(){ - $this->_retvalue = $this->compiler->compileTag('private_modifier',array(),array('value'=>$this->yystack[$this->yyidx + -1]->minor,'modifierlist'=>$this->yystack[$this->yyidx + 0]->minor)); - } -#line 2576 "smarty_internal_templateparser.php" -#line 599 "smarty_internal_templateparser.y" - function yy_r85(){ - $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.$this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor; - } -#line 2581 "smarty_internal_templateparser.php" -#line 603 "smarty_internal_templateparser.y" - function yy_r86(){ - $this->_retvalue = 'in_array('.$this->yystack[$this->yyidx + -2]->minor.','.$this->yystack[$this->yyidx + 0]->minor.')'; - } -#line 2586 "smarty_internal_templateparser.php" -#line 607 "smarty_internal_templateparser.y" - function yy_r87(){ - $this->_retvalue = 'in_array('.$this->yystack[$this->yyidx + -2]->minor.',(array)'.$this->yystack[$this->yyidx + 0]->minor.')'; - } -#line 2591 "smarty_internal_templateparser.php" -#line 615 "smarty_internal_templateparser.y" - function yy_r89(){ - $this->_retvalue = '!('.$this->yystack[$this->yyidx + -2]->minor.' % '.$this->yystack[$this->yyidx + 0]->minor.')'; - } -#line 2596 "smarty_internal_templateparser.php" -#line 619 "smarty_internal_templateparser.y" - function yy_r90(){ - $this->_retvalue = '('.$this->yystack[$this->yyidx + -2]->minor.' % '.$this->yystack[$this->yyidx + 0]->minor.')'; - } -#line 2601 "smarty_internal_templateparser.php" -#line 623 "smarty_internal_templateparser.y" - function yy_r91(){ - $this->_retvalue = '!(1 & '.$this->yystack[$this->yyidx + -1]->minor.')'; - } -#line 2606 "smarty_internal_templateparser.php" -#line 627 "smarty_internal_templateparser.y" - function yy_r92(){ - $this->_retvalue = '(1 & '.$this->yystack[$this->yyidx + -1]->minor.')'; - } -#line 2611 "smarty_internal_templateparser.php" -#line 631 "smarty_internal_templateparser.y" - function yy_r93(){ - $this->_retvalue = '!(1 & '.$this->yystack[$this->yyidx + -2]->minor.' / '.$this->yystack[$this->yyidx + 0]->minor.')'; - } -#line 2616 "smarty_internal_templateparser.php" -#line 635 "smarty_internal_templateparser.y" - function yy_r94(){ - $this->_retvalue = '(1 & '.$this->yystack[$this->yyidx + -2]->minor.' / '.$this->yystack[$this->yyidx + 0]->minor.')'; - } -#line 2621 "smarty_internal_templateparser.php" -#line 659 "smarty_internal_templateparser.y" - function yy_r100(){ - $this->prefix_number++; - $this->compiler->prefix_code[] = 'prefix_number.'='.$this->yystack[$this->yyidx + 0]->minor.';?>'; - $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.$this->yystack[$this->yyidx + -1]->minor.'$_tmp'.$this->prefix_number; - } -#line 2628 "smarty_internal_templateparser.php" -#line 668 "smarty_internal_templateparser.y" - function yy_r101(){ - $this->_retvalue = $this->yystack[$this->yyidx + -6]->minor.' ? '. $this->compileVariable("'".$this->yystack[$this->yyidx + -2]->minor."'") . ' : '.$this->yystack[$this->yyidx + 0]->minor; - } -#line 2633 "smarty_internal_templateparser.php" -#line 672 "smarty_internal_templateparser.y" - function yy_r102(){ - $this->_retvalue = $this->yystack[$this->yyidx + -5]->minor.' ? '.$this->yystack[$this->yyidx + -2]->minor.' : '.$this->yystack[$this->yyidx + 0]->minor; - } -#line 2638 "smarty_internal_templateparser.php" -#line 687 "smarty_internal_templateparser.y" - function yy_r105(){ - $this->_retvalue = '!'.$this->yystack[$this->yyidx + 0]->minor; - } -#line 2643 "smarty_internal_templateparser.php" -#line 708 "smarty_internal_templateparser.y" - function yy_r110(){ - $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.'.'.$this->yystack[$this->yyidx + 0]->minor; - } -#line 2648 "smarty_internal_templateparser.php" -#line 712 "smarty_internal_templateparser.y" - function yy_r111(){ - $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor.'.'; - } -#line 2653 "smarty_internal_templateparser.php" -#line 716 "smarty_internal_templateparser.y" - function yy_r112(){ - $this->_retvalue = '.'.$this->yystack[$this->yyidx + 0]->minor; - } -#line 2658 "smarty_internal_templateparser.php" -#line 721 "smarty_internal_templateparser.y" - function yy_r113(){ - if (preg_match('~^true$~i', $this->yystack[$this->yyidx + 0]->minor)) { - $this->_retvalue = 'true'; - } elseif (preg_match('~^false$~i', $this->yystack[$this->yyidx + 0]->minor)) { - $this->_retvalue = 'false'; - } elseif (preg_match('~^null$~i', $this->yystack[$this->yyidx + 0]->minor)) { - $this->_retvalue = 'null'; - } else { - $this->_retvalue = "'".$this->yystack[$this->yyidx + 0]->minor."'"; - } - } -#line 2671 "smarty_internal_templateparser.php" -#line 739 "smarty_internal_templateparser.y" - function yy_r115(){ - $this->_retvalue = "(". $this->yystack[$this->yyidx + -1]->minor .")"; - } -#line 2676 "smarty_internal_templateparser.php" -#line 754 "smarty_internal_templateparser.y" - function yy_r118(){ - if (!$this->security || isset($this->smarty->registered_classes[$this->yystack[$this->yyidx + -2]->minor]) || $this->smarty->security_policy->isTrustedStaticClass($this->yystack[$this->yyidx + -2]->minor, $this->compiler)) { - if (isset($this->smarty->registered_classes[$this->yystack[$this->yyidx + -2]->minor])) { - $this->_retvalue = $this->smarty->registered_classes[$this->yystack[$this->yyidx + -2]->minor].'::'.$this->yystack[$this->yyidx + 0]->minor; - } else { - $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.'::'.$this->yystack[$this->yyidx + 0]->minor; - } - } else { - $this->compiler->trigger_template_error ("static class '".$this->yystack[$this->yyidx + -2]->minor."' is undefined or not allowed by security setting"); - } - } -#line 2689 "smarty_internal_templateparser.php" -#line 766 "smarty_internal_templateparser.y" - function yy_r119(){ - if ($this->yystack[$this->yyidx + -2]->minor['var'] == '\'smarty\'') { - $this->_retvalue = $this->compiler->compileTag('private_special_variable',array(),$this->yystack[$this->yyidx + -2]->minor['smarty_internal_index']).'::'.$this->yystack[$this->yyidx + 0]->minor; - } else { - $this->_retvalue = $this->compileVariable($this->yystack[$this->yyidx + -2]->minor['var']).$this->yystack[$this->yyidx + -2]->minor['smarty_internal_index'].'::'.$this->yystack[$this->yyidx + 0]->minor; - } - } -#line 2698 "smarty_internal_templateparser.php" -#line 775 "smarty_internal_templateparser.y" - function yy_r120(){ - $this->prefix_number++; - $this->compiler->prefix_code[] = ''.$this->yystack[$this->yyidx + 0]->minor.'prefix_number.'=ob_get_clean();?>'; - $this->_retvalue = '$_tmp'.$this->prefix_number; - } -#line 2705 "smarty_internal_templateparser.php" -#line 790 "smarty_internal_templateparser.y" - function yy_r122(){ - if ($this->yystack[$this->yyidx + 0]->minor['var'] == '\'smarty\'') { - $smarty_var = $this->compiler->compileTag('private_special_variable',array(),$this->yystack[$this->yyidx + 0]->minor['smarty_internal_index']); - $this->_retvalue = $smarty_var; - } else { - // used for array reset,next,prev,end,current - $this->last_variable = $this->yystack[$this->yyidx + 0]->minor['var']; - $this->last_index = $this->yystack[$this->yyidx + 0]->minor['smarty_internal_index']; - $this->_retvalue = $this->compileVariable($this->yystack[$this->yyidx + 0]->minor['var']).$this->yystack[$this->yyidx + 0]->minor['smarty_internal_index']; - } - } -#line 2718 "smarty_internal_templateparser.php" -#line 803 "smarty_internal_templateparser.y" - function yy_r123(){ - $this->_retvalue = '$_smarty_tpl->tpl_vars['. $this->yystack[$this->yyidx + -2]->minor .']->'.$this->yystack[$this->yyidx + 0]->minor; - } -#line 2723 "smarty_internal_templateparser.php" -#line 813 "smarty_internal_templateparser.y" - function yy_r125(){ - $this->_retvalue = '$_smarty_tpl->getConfigVariable(\''. $this->yystack[$this->yyidx + -1]->minor .'\')'; - } -#line 2728 "smarty_internal_templateparser.php" -#line 817 "smarty_internal_templateparser.y" - function yy_r126(){ - $this->_retvalue = '(is_array($tmp = $_smarty_tpl->getConfigVariable(\''. $this->yystack[$this->yyidx + -2]->minor .'\')) ? $tmp'.$this->yystack[$this->yyidx + 0]->minor.' :null)'; - } -#line 2733 "smarty_internal_templateparser.php" -#line 821 "smarty_internal_templateparser.y" - function yy_r127(){ - $this->_retvalue = '$_smarty_tpl->getConfigVariable('. $this->yystack[$this->yyidx + -1]->minor .')'; - } -#line 2738 "smarty_internal_templateparser.php" -#line 825 "smarty_internal_templateparser.y" - function yy_r128(){ - $this->_retvalue = '(is_array($tmp = $_smarty_tpl->getConfigVariable('. $this->yystack[$this->yyidx + -2]->minor .')) ? $tmp'.$this->yystack[$this->yyidx + 0]->minor.' : null)'; - } -#line 2743 "smarty_internal_templateparser.php" -#line 829 "smarty_internal_templateparser.y" - function yy_r129(){ - $this->_retvalue = array('var'=>$this->yystack[$this->yyidx + -1]->minor, 'smarty_internal_index'=>$this->yystack[$this->yyidx + 0]->minor); - } -#line 2748 "smarty_internal_templateparser.php" -#line 842 "smarty_internal_templateparser.y" - function yy_r131(){ - return; - } -#line 2753 "smarty_internal_templateparser.php" -#line 848 "smarty_internal_templateparser.y" - function yy_r132(){ - $this->_retvalue = '['.$this->compileVariable($this->yystack[$this->yyidx + 0]->minor).']'; - } -#line 2758 "smarty_internal_templateparser.php" -#line 852 "smarty_internal_templateparser.y" - function yy_r133(){ - $this->_retvalue = '['.$this->compileVariable($this->yystack[$this->yyidx + -2]->minor).'->'.$this->yystack[$this->yyidx + 0]->minor.']'; - } -#line 2763 "smarty_internal_templateparser.php" -#line 856 "smarty_internal_templateparser.y" - function yy_r134(){ - $this->_retvalue = "['". $this->yystack[$this->yyidx + 0]->minor ."']"; - } -#line 2768 "smarty_internal_templateparser.php" -#line 860 "smarty_internal_templateparser.y" - function yy_r135(){ - $this->_retvalue = "[". $this->yystack[$this->yyidx + 0]->minor ."]"; - } -#line 2773 "smarty_internal_templateparser.php" -#line 864 "smarty_internal_templateparser.y" - function yy_r136(){ - $this->_retvalue = "[". $this->yystack[$this->yyidx + -1]->minor ."]"; - } -#line 2778 "smarty_internal_templateparser.php" -#line 869 "smarty_internal_templateparser.y" - function yy_r137(){ - $this->_retvalue = '['.$this->compiler->compileTag('private_special_variable',array(),'[\'section\'][\''.$this->yystack[$this->yyidx + -1]->minor.'\'][\'index\']').']'; - } -#line 2783 "smarty_internal_templateparser.php" -#line 873 "smarty_internal_templateparser.y" - function yy_r138(){ - $this->_retvalue = '['.$this->compiler->compileTag('private_special_variable',array(),'[\'section\'][\''.$this->yystack[$this->yyidx + -3]->minor.'\'][\''.$this->yystack[$this->yyidx + -1]->minor.'\']').']'; - } -#line 2788 "smarty_internal_templateparser.php" -#line 883 "smarty_internal_templateparser.y" - function yy_r140(){ - $this->_retvalue = '[]'; - } -#line 2793 "smarty_internal_templateparser.php" -#line 896 "smarty_internal_templateparser.y" - function yy_r142(){ - $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor.'.'.$this->yystack[$this->yyidx + 0]->minor; - } -#line 2798 "smarty_internal_templateparser.php" -#line 901 "smarty_internal_templateparser.y" - function yy_r143(){ - $this->_retvalue = '\''.$this->yystack[$this->yyidx + 0]->minor.'\''; - } -#line 2803 "smarty_internal_templateparser.php" -#line 906 "smarty_internal_templateparser.y" - function yy_r144(){ - $this->_retvalue = '('.$this->yystack[$this->yyidx + -1]->minor.')'; - } -#line 2808 "smarty_internal_templateparser.php" -#line 913 "smarty_internal_templateparser.y" - function yy_r145(){ - if ($this->yystack[$this->yyidx + -1]->minor['var'] == '\'smarty\'') { - $this->_retvalue = $this->compiler->compileTag('private_special_variable',array(),$this->yystack[$this->yyidx + -1]->minor['smarty_internal_index']).$this->yystack[$this->yyidx + 0]->minor; - } else { - $this->_retvalue = $this->compileVariable($this->yystack[$this->yyidx + -1]->minor['var']).$this->yystack[$this->yyidx + -1]->minor['smarty_internal_index'].$this->yystack[$this->yyidx + 0]->minor; - } - } -#line 2817 "smarty_internal_templateparser.php" -#line 922 "smarty_internal_templateparser.y" - function yy_r146(){ - $this->_retvalue = $this->yystack[$this->yyidx + 0]->minor; - } -#line 2822 "smarty_internal_templateparser.php" -#line 927 "smarty_internal_templateparser.y" - function yy_r147(){ - $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor; - } -#line 2827 "smarty_internal_templateparser.php" -#line 932 "smarty_internal_templateparser.y" - function yy_r148(){ - if ($this->security && substr($this->yystack[$this->yyidx + -1]->minor,0,1) == '_') { - $this->compiler->trigger_template_error (self::Err1); - } - $this->_retvalue = '->'.$this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor; - } -#line 2835 "smarty_internal_templateparser.php" -#line 939 "smarty_internal_templateparser.y" - function yy_r149(){ - if ($this->security) { - $this->compiler->trigger_template_error (self::Err2); - } - $this->_retvalue = '->{'.$this->compileVariable($this->yystack[$this->yyidx + -1]->minor).$this->yystack[$this->yyidx + 0]->minor.'}'; - } -#line 2843 "smarty_internal_templateparser.php" -#line 946 "smarty_internal_templateparser.y" - function yy_r150(){ - if ($this->security) { - $this->compiler->trigger_template_error (self::Err2); - } - $this->_retvalue = '->{'.$this->yystack[$this->yyidx + -2]->minor.$this->yystack[$this->yyidx + 0]->minor.'}'; - } -#line 2851 "smarty_internal_templateparser.php" -#line 953 "smarty_internal_templateparser.y" - function yy_r151(){ - if ($this->security) { - $this->compiler->trigger_template_error (self::Err2); - } - $this->_retvalue = '->{\''.$this->yystack[$this->yyidx + -4]->minor.'\'.'.$this->yystack[$this->yyidx + -2]->minor.$this->yystack[$this->yyidx + 0]->minor.'}'; - } -#line 2859 "smarty_internal_templateparser.php" -#line 961 "smarty_internal_templateparser.y" - function yy_r152(){ - $this->_retvalue = '->'.$this->yystack[$this->yyidx + 0]->minor; - } -#line 2864 "smarty_internal_templateparser.php" -#line 969 "smarty_internal_templateparser.y" - function yy_r153(){ - if (!$this->security || $this->smarty->security_policy->isTrustedPhpFunction($this->yystack[$this->yyidx + -3]->minor, $this->compiler)) { - if (strcasecmp($this->yystack[$this->yyidx + -3]->minor,'isset') === 0 || strcasecmp($this->yystack[$this->yyidx + -3]->minor,'empty') === 0 || strcasecmp($this->yystack[$this->yyidx + -3]->minor,'array') === 0 || is_callable($this->yystack[$this->yyidx + -3]->minor)) { - $func_name = strtolower($this->yystack[$this->yyidx + -3]->minor); - if ($func_name == 'isset') { - if (count($this->yystack[$this->yyidx + -1]->minor) == 0) { - $this->compiler->trigger_template_error ('Illegal number of paramer in "isset()"'); - } - $par = implode(',',$this->yystack[$this->yyidx + -1]->minor); - if (strncasecmp($par,'$_smarty_tpl->getConfigVariable',strlen('$_smarty_tpl->getConfigVariable')) === 0) { - $this->prefix_number++; - $this->compiler->prefix_code[] = 'prefix_number.'='.str_replace(')',', false)',$par).';?>'; - $isset_par = '$_tmp'.$this->prefix_number; - } else { - $isset_par=str_replace("')->value","',null,true,false)->value",$par); - } - $this->_retvalue = $this->yystack[$this->yyidx + -3]->minor . "(". $isset_par .")"; - } elseif (in_array($func_name,array('empty','reset','current','end','prev','next'))){ - if (count($this->yystack[$this->yyidx + -1]->minor) != 1) { - $this->compiler->trigger_template_error ('Illegal number of paramer in "empty()"'); - } - if ($func_name == 'empty') { - $this->_retvalue = $func_name.'('.str_replace("')->value","',null,true,false)->value",$this->yystack[$this->yyidx + -1]->minor[0]).')'; - } else { - $this->_retvalue = $func_name.'('.$this->yystack[$this->yyidx + -1]->minor[0].')'; - } - } else { - $this->_retvalue = $this->yystack[$this->yyidx + -3]->minor . "(". implode(',',$this->yystack[$this->yyidx + -1]->minor) .")"; - } - } else { - $this->compiler->trigger_template_error ("unknown function \"" . $this->yystack[$this->yyidx + -3]->minor . "\""); - } - } - } -#line 2900 "smarty_internal_templateparser.php" -#line 1007 "smarty_internal_templateparser.y" - function yy_r154(){ - if ($this->security && substr($this->yystack[$this->yyidx + -3]->minor,0,1) == '_') { - $this->compiler->trigger_template_error (self::Err1); - } - $this->_retvalue = $this->yystack[$this->yyidx + -3]->minor . "(". implode(',',$this->yystack[$this->yyidx + -1]->minor) .")"; - } -#line 2908 "smarty_internal_templateparser.php" -#line 1014 "smarty_internal_templateparser.y" - function yy_r155(){ - if ($this->security) { - $this->compiler->trigger_template_error (self::Err2); - } - $this->prefix_number++; - $this->compiler->prefix_code[] = 'prefix_number.'='.$this->compileVariable("'".$this->yystack[$this->yyidx + -3]->minor."'").';?>'; - $this->_retvalue = '$_tmp'.$this->prefix_number.'('. implode(',',$this->yystack[$this->yyidx + -1]->minor) .')'; - } -#line 2918 "smarty_internal_templateparser.php" -#line 1025 "smarty_internal_templateparser.y" - function yy_r156(){ - $this->_retvalue = array_merge($this->yystack[$this->yyidx + -2]->minor,array($this->yystack[$this->yyidx + 0]->minor)); - } -#line 2923 "smarty_internal_templateparser.php" -#line 1042 "smarty_internal_templateparser.y" - function yy_r159(){ - $this->_retvalue = array_merge($this->yystack[$this->yyidx + -2]->minor,array(array_merge($this->yystack[$this->yyidx + -1]->minor,$this->yystack[$this->yyidx + 0]->minor))); - } -#line 2928 "smarty_internal_templateparser.php" -#line 1046 "smarty_internal_templateparser.y" - function yy_r160(){ - $this->_retvalue = array(array_merge($this->yystack[$this->yyidx + -1]->minor,$this->yystack[$this->yyidx + 0]->minor)); - } -#line 2933 "smarty_internal_templateparser.php" -#line 1054 "smarty_internal_templateparser.y" - function yy_r162(){ - $this->_retvalue = array($this->yystack[$this->yyidx + 0]->minor); - } -#line 2938 "smarty_internal_templateparser.php" -#line 1062 "smarty_internal_templateparser.y" - function yy_r163(){ - $this->_retvalue = array_merge($this->yystack[$this->yyidx + -1]->minor,$this->yystack[$this->yyidx + 0]->minor); - } -#line 2943 "smarty_internal_templateparser.php" -#line 1096 "smarty_internal_templateparser.y" - function yy_r170(){ - $this->_retvalue = '$'.$this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor; - } -#line 2948 "smarty_internal_templateparser.php" -#line 1101 "smarty_internal_templateparser.y" - function yy_r171(){ - $this->_retvalue = '$'.$this->yystack[$this->yyidx + -2]->minor.$this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor; - } -#line 2953 "smarty_internal_templateparser.php" -#line 1107 "smarty_internal_templateparser.y" - function yy_r172(){ - $this->_retvalue = '=='; - } -#line 2958 "smarty_internal_templateparser.php" -#line 1111 "smarty_internal_templateparser.y" - function yy_r173(){ - $this->_retvalue = '!='; - } -#line 2963 "smarty_internal_templateparser.php" -#line 1115 "smarty_internal_templateparser.y" - function yy_r174(){ - $this->_retvalue = '>'; - } -#line 2968 "smarty_internal_templateparser.php" -#line 1119 "smarty_internal_templateparser.y" - function yy_r175(){ - $this->_retvalue = '<'; - } -#line 2973 "smarty_internal_templateparser.php" -#line 1123 "smarty_internal_templateparser.y" - function yy_r176(){ - $this->_retvalue = '>='; - } -#line 2978 "smarty_internal_templateparser.php" -#line 1127 "smarty_internal_templateparser.y" - function yy_r177(){ - $this->_retvalue = '<='; - } -#line 2983 "smarty_internal_templateparser.php" -#line 1131 "smarty_internal_templateparser.y" - function yy_r178(){ - $this->_retvalue = '==='; - } -#line 2988 "smarty_internal_templateparser.php" -#line 1135 "smarty_internal_templateparser.y" - function yy_r179(){ - $this->_retvalue = '!=='; - } -#line 2993 "smarty_internal_templateparser.php" -#line 1139 "smarty_internal_templateparser.y" - function yy_r180(){ - $this->_retvalue = '%'; - } -#line 2998 "smarty_internal_templateparser.php" -#line 1143 "smarty_internal_templateparser.y" - function yy_r181(){ - $this->_retvalue = '&&'; - } -#line 3003 "smarty_internal_templateparser.php" -#line 1147 "smarty_internal_templateparser.y" - function yy_r182(){ - $this->_retvalue = '||'; - } -#line 3008 "smarty_internal_templateparser.php" -#line 1151 "smarty_internal_templateparser.y" - function yy_r183(){ - $this->_retvalue = ' XOR '; - } -#line 3013 "smarty_internal_templateparser.php" -#line 1158 "smarty_internal_templateparser.y" - function yy_r184(){ - $this->_retvalue = 'array('.$this->yystack[$this->yyidx + -1]->minor.')'; - } -#line 3018 "smarty_internal_templateparser.php" -#line 1166 "smarty_internal_templateparser.y" - function yy_r186(){ - $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.','.$this->yystack[$this->yyidx + 0]->minor; - } -#line 3023 "smarty_internal_templateparser.php" -#line 1174 "smarty_internal_templateparser.y" - function yy_r188(){ - $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.'=>'.$this->yystack[$this->yyidx + 0]->minor; - } -#line 3028 "smarty_internal_templateparser.php" -#line 1178 "smarty_internal_templateparser.y" - function yy_r189(){ - $this->_retvalue = '\''.$this->yystack[$this->yyidx + -2]->minor.'\'=>'.$this->yystack[$this->yyidx + 0]->minor; - } -#line 3033 "smarty_internal_templateparser.php" -#line 1190 "smarty_internal_templateparser.y" - function yy_r191(){ - $this->_retvalue = "''"; - } -#line 3038 "smarty_internal_templateparser.php" -#line 1194 "smarty_internal_templateparser.y" - function yy_r192(){ - $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor->to_smarty_php(); - } -#line 3043 "smarty_internal_templateparser.php" -#line 1199 "smarty_internal_templateparser.y" - function yy_r193(){ - $this->yystack[$this->yyidx + -1]->minor->append_subtree($this->yystack[$this->yyidx + 0]->minor); - $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor; - } -#line 3049 "smarty_internal_templateparser.php" -#line 1204 "smarty_internal_templateparser.y" - function yy_r194(){ - $this->_retvalue = new _smarty_doublequoted($this, $this->yystack[$this->yyidx + 0]->minor); - } -#line 3054 "smarty_internal_templateparser.php" -#line 1208 "smarty_internal_templateparser.y" - function yy_r195(){ - $this->_retvalue = new _smarty_code($this, '(string)'.$this->yystack[$this->yyidx + -1]->minor); - } -#line 3059 "smarty_internal_templateparser.php" -#line 1216 "smarty_internal_templateparser.y" - function yy_r197(){ - $this->_retvalue = new _smarty_code($this, '(string)$_smarty_tpl->tpl_vars[\''. substr($this->yystack[$this->yyidx + 0]->minor,1) .'\']->value'); - } -#line 3064 "smarty_internal_templateparser.php" -#line 1224 "smarty_internal_templateparser.y" - function yy_r199(){ - $this->_retvalue = new _smarty_code($this, '(string)('.$this->yystack[$this->yyidx + -1]->minor.')'); - } -#line 3069 "smarty_internal_templateparser.php" -#line 1228 "smarty_internal_templateparser.y" - function yy_r200(){ - $this->_retvalue = new _smarty_tag($this, $this->yystack[$this->yyidx + 0]->minor); - } -#line 3074 "smarty_internal_templateparser.php" -#line 1232 "smarty_internal_templateparser.y" - function yy_r201(){ - $this->_retvalue = new _smarty_dq_content($this, $this->yystack[$this->yyidx + 0]->minor); - } -#line 3079 "smarty_internal_templateparser.php" - - private $_retvalue; - - function yy_reduce($yyruleno) - { - $yymsp = $this->yystack[$this->yyidx]; - if (self::$yyTraceFILE && $yyruleno >= 0 - && $yyruleno < count(self::$yyRuleName)) { - fprintf(self::$yyTraceFILE, "%sReduce (%d) [%s].\n", - self::$yyTracePrompt, $yyruleno, - self::$yyRuleName[$yyruleno]); - } - - $this->_retvalue = $yy_lefthand_side = null; - if (array_key_exists($yyruleno, self::$yyReduceMap)) { - // call the action - $this->_retvalue = null; - $this->{'yy_r' . self::$yyReduceMap[$yyruleno]}(); - $yy_lefthand_side = $this->_retvalue; - } - $yygoto = self::$yyRuleInfo[$yyruleno]['lhs']; - $yysize = self::$yyRuleInfo[$yyruleno]['rhs']; - $this->yyidx -= $yysize; - for($i = $yysize; $i; $i--) { - // pop all of the right-hand side parameters - array_pop($this->yystack); - } - $yyact = $this->yy_find_reduce_action($this->yystack[$this->yyidx]->stateno, $yygoto); - if ($yyact < self::YYNSTATE) { - if (!self::$yyTraceFILE && $yysize) { - $this->yyidx++; - $x = new TP_yyStackEntry; - $x->stateno = $yyact; - $x->major = $yygoto; - $x->minor = $yy_lefthand_side; - $this->yystack[$this->yyidx] = $x; - } else { - $this->yy_shift($yyact, $yygoto, $yy_lefthand_side); - } - } elseif ($yyact == self::YYNSTATE + self::YYNRULE + 1) { - $this->yy_accept(); - } - } - - function yy_parse_failed() - { - if (self::$yyTraceFILE) { - fprintf(self::$yyTraceFILE, "%sFail!\n", self::$yyTracePrompt); - } - while ($this->yyidx >= 0) { - $this->yy_pop_parser_stack(); - } - } - - function yy_syntax_error($yymajor, $TOKEN) - { -#line 77 "smarty_internal_templateparser.y" - - $this->internalError = true; - $this->yymajor = $yymajor; - $this->compiler->trigger_template_error(); -#line 3142 "smarty_internal_templateparser.php" - } - - function yy_accept() - { - if (self::$yyTraceFILE) { - fprintf(self::$yyTraceFILE, "%sAccept!\n", self::$yyTracePrompt); - } - while ($this->yyidx >= 0) { - $stack = $this->yy_pop_parser_stack(); - } -#line 69 "smarty_internal_templateparser.y" - - $this->successful = !$this->internalError; - $this->internalError = false; - $this->retvalue = $this->_retvalue; - //echo $this->retvalue."\n\n"; -#line 3160 "smarty_internal_templateparser.php" - } - - function doParse($yymajor, $yytokenvalue) - { - $yyerrorhit = 0; /* True if yymajor has invoked an error */ - - if ($this->yyidx === null || $this->yyidx < 0) { - $this->yyidx = 0; - $this->yyerrcnt = -1; - $x = new TP_yyStackEntry; - $x->stateno = 0; - $x->major = 0; - $this->yystack = array(); - array_push($this->yystack, $x); - } - $yyendofinput = ($yymajor==0); - - if (self::$yyTraceFILE) { - fprintf(self::$yyTraceFILE, "%sInput %s\n", - self::$yyTracePrompt, $this->yyTokenName[$yymajor]); - } - - do { - $yyact = $this->yy_find_shift_action($yymajor); - if ($yymajor < self::YYERRORSYMBOL && - !$this->yy_is_expected_token($yymajor)) { - // force a syntax error - $yyact = self::YY_ERROR_ACTION; - } - if ($yyact < self::YYNSTATE) { - $this->yy_shift($yyact, $yymajor, $yytokenvalue); - $this->yyerrcnt--; - if ($yyendofinput && $this->yyidx >= 0) { - $yymajor = 0; - } else { - $yymajor = self::YYNOCODE; - } - } elseif ($yyact < self::YYNSTATE + self::YYNRULE) { - $this->yy_reduce($yyact - self::YYNSTATE); - } elseif ($yyact == self::YY_ERROR_ACTION) { - if (self::$yyTraceFILE) { - fprintf(self::$yyTraceFILE, "%sSyntax Error!\n", - self::$yyTracePrompt); - } - if (self::YYERRORSYMBOL) { - if ($this->yyerrcnt < 0) { - $this->yy_syntax_error($yymajor, $yytokenvalue); - } - $yymx = $this->yystack[$this->yyidx]->major; - if ($yymx == self::YYERRORSYMBOL || $yyerrorhit ){ - if (self::$yyTraceFILE) { - fprintf(self::$yyTraceFILE, "%sDiscard input token %s\n", - self::$yyTracePrompt, $this->yyTokenName[$yymajor]); - } - $this->yy_destructor($yymajor, $yytokenvalue); - $yymajor = self::YYNOCODE; - } else { - while ($this->yyidx >= 0 && - $yymx != self::YYERRORSYMBOL && - ($yyact = $this->yy_find_shift_action(self::YYERRORSYMBOL)) >= self::YYNSTATE - ){ - $this->yy_pop_parser_stack(); - } - if ($this->yyidx < 0 || $yymajor==0) { - $this->yy_destructor($yymajor, $yytokenvalue); - $this->yy_parse_failed(); - $yymajor = self::YYNOCODE; - } elseif ($yymx != self::YYERRORSYMBOL) { - $u2 = 0; - $this->yy_shift($yyact, self::YYERRORSYMBOL, $u2); - } - } - $this->yyerrcnt = 3; - $yyerrorhit = 1; - } else { - if ($this->yyerrcnt <= 0) { - $this->yy_syntax_error($yymajor, $yytokenvalue); - } - $this->yyerrcnt = 3; - $this->yy_destructor($yymajor, $yytokenvalue); - if ($yyendofinput) { - $this->yy_parse_failed(); - } - $yymajor = self::YYNOCODE; - } - } else { - $this->yy_accept(); - $yymajor = self::YYNOCODE; - } - } while ($yymajor != self::YYNOCODE && $this->yyidx >= 0); - } -} diff --git a/lib/classes/Smarty-3.1.14/COPYING.lib b/lib/classes/Smarty-3.1.15/COPYING.lib similarity index 100% rename from lib/classes/Smarty-3.1.14/COPYING.lib rename to lib/classes/Smarty-3.1.15/COPYING.lib diff --git a/lib/classes/Smarty-3.1.14/README b/lib/classes/Smarty-3.1.15/README similarity index 99% rename from lib/classes/Smarty-3.1.14/README rename to lib/classes/Smarty-3.1.15/README index 0284c9f6..89230921 100644 --- a/lib/classes/Smarty-3.1.14/README +++ b/lib/classes/Smarty-3.1.15/README @@ -1,4 +1,4 @@ -Smarty 3.1.14 +Smarty 3.1.15 Author: Monte Ohrt Author: Uwe Tews diff --git a/lib/classes/Smarty-3.1.14/SMARTY_2_BC_NOTES.txt b/lib/classes/Smarty-3.1.15/SMARTY_2_BC_NOTES.txt similarity index 100% rename from lib/classes/Smarty-3.1.14/SMARTY_2_BC_NOTES.txt rename to lib/classes/Smarty-3.1.15/SMARTY_2_BC_NOTES.txt diff --git a/lib/classes/Smarty-3.1.14/SMARTY_3.0_BC_NOTES.txt b/lib/classes/Smarty-3.1.15/SMARTY_3.0_BC_NOTES.txt similarity index 100% rename from lib/classes/Smarty-3.1.14/SMARTY_3.0_BC_NOTES.txt rename to lib/classes/Smarty-3.1.15/SMARTY_3.0_BC_NOTES.txt diff --git a/lib/classes/Smarty-3.1.14/SMARTY_3.1_NOTES.txt b/lib/classes/Smarty-3.1.15/SMARTY_3.1_NOTES.txt similarity index 100% rename from lib/classes/Smarty-3.1.14/SMARTY_3.1_NOTES.txt rename to lib/classes/Smarty-3.1.15/SMARTY_3.1_NOTES.txt diff --git a/lib/classes/Smarty-3.1.14/change_log.txt b/lib/classes/Smarty-3.1.15/change_log.txt similarity index 96% rename from lib/classes/Smarty-3.1.14/change_log.txt rename to lib/classes/Smarty-3.1.15/change_log.txt index 46a421c6..bd967b30 100644 --- a/lib/classes/Smarty-3.1.14/change_log.txt +++ b/lib/classes/Smarty-3.1.15/change_log.txt @@ -1,4 +1,69 @@ -===== Smarty-3.1.14 ===== + ===== trunk ===== + ===== Smarty-3.1.15 ===== +01.10.2013 + - use current delimiters in compiler error messages (issue 157) + - improvement on performance when using error handler and multiple template folders (issue 152) + +17.09.2013 + - improvement added patch for additional SmartyCompilerException properties for better access to scource information (forum topic 24559) + +16.09.2013 + - bugfix recompiled templates did not show on first request with zend opcache cache (forum topic 24320) + +13.09.2013 + - bugfix html_select_time defaulting error for the Meridian dropdown (forum topic 24549) + +09.09.2012 +- bugfix incorrect compiled code with array(object,method) callback at registered Variable Filter (forum topic 24542) + +27.08.2013 +- bugfix delimiter followed by linebreak did not work as auto literal after update from 24.08.2013 (forum topic 24518) + +24.08.2013 +- bugfix and enhancement + Because several recent problems with template inheritance the {block} tag compiler has been rewriten + - Error messages shown now the correct child template file and line number + - The compiler could fail on some larger UTF-8 text block (forum topic 24455) + - The {strip} tag can now be placed outside {block} tags in child templates (forum topic 24289) +- change SmartyException::$escape is now false by default +- change PHP traceback has been remove for SmartyException and SmartyCompilerException + +14.08.2013 +- bugfix compiled filepath of config file did not observe different config_dir (forum topic 24493) + +13.08.2013 +- bugfix the internal resource cache did not observe config_dir changes (forum topic 24493) + +12.08.2013 +- bugfix internal $tmpx variables must be unique over all inheritance templates (Issue 149) + +10.08.2013 +- bugfix a newline was eaten when a was passed by a Smarty variable and caching was enabled (forum topic 24482) + +29.07.2013 +- bugfix headers already send warning thrown when using 'SMARTY_DEBUG=on' from URL (Issue 148) + +27.07.2013 +- enhancement allow access to properties of registered opjects for Smarty2 BC (forum topic 24344) + +26.07.2013 +- bugfix template inheritance nesting problem (forum topic 24387) + +15.7.2013 +- update code generated by PSR-2 standards fixer which introduced PHP 5.4 incompatibilities of 14.7.2013 + +14.7.2013 +- bugfix increase of internal maximum parser stacksize to allow more complex tag code {forum topic 24426} +- update for PHP 5.4 compatibility +- reformat source to PSR-2 standard + +12.7.2013 +- bugfix Do not remove '//' from file path at normalization (Issue 142) + +2.7.2013 +- bugfix trimwhitespace would replace captured items in wrong order (forum topic 24387) + +===== Smarty-3.1.14 ===== 27.06.2013 - bugfix removed PHP 5.5 deprecated preg_replace /e option in modifier capitalize (forum topic 24389) diff --git a/lib/classes/Smarty-3.1.14/demo/configs/test.conf b/lib/classes/Smarty-3.1.15/demo/configs/test.conf similarity index 100% rename from lib/classes/Smarty-3.1.14/demo/configs/test.conf rename to lib/classes/Smarty-3.1.15/demo/configs/test.conf diff --git a/lib/classes/Smarty-3.1.14/demo/index.php b/lib/classes/Smarty-3.1.15/demo/index.php similarity index 82% rename from lib/classes/Smarty-3.1.14/demo/index.php rename to lib/classes/Smarty-3.1.15/demo/index.php index 74c8e897..b7d988f5 100644 --- a/lib/classes/Smarty-3.1.14/demo/index.php +++ b/lib/classes/Smarty-3.1.15/demo/index.php @@ -5,12 +5,10 @@ * @package Example-application */ -require('../libs/Smarty.class.php'); +require '../libs/Smarty.class.php'; $smarty = new Smarty; - - //$smarty->force_compile = true; $smarty->debugging = true; $smarty->caching = true; @@ -20,14 +18,13 @@ $smarty->assign("Name","Fred Irving Johnathan Bradley Peppergill",true); $smarty->assign("FirstName",array("John","Mary","James","Henry")); $smarty->assign("LastName",array("Doe","Smith","Johnson","Case")); $smarty->assign("Class",array(array("A","B","C","D"), array("E", "F", "G", "H"), - array("I", "J", "K", "L"), array("M", "N", "O", "P"))); + array("I", "J", "K", "L"), array("M", "N", "O", "P"))); $smarty->assign("contacts", array(array("phone" => "1", "fax" => "2", "cell" => "3"), - array("phone" => "555-4444", "fax" => "555-3333", "cell" => "760-1234"))); + array("phone" => "555-4444", "fax" => "555-3333", "cell" => "760-1234"))); $smarty->assign("option_values", array("NY","NE","KS","IA","OK","TX")); $smarty->assign("option_output", array("New York","Nebraska","Kansas","Iowa","Oklahoma","Texas")); $smarty->assign("option_selected", "NE"); $smarty->display('index.tpl'); -?> diff --git a/lib/classes/Smarty-3.1.14/demo/plugins/cacheresource.apc.php b/lib/classes/Smarty-3.1.15/demo/plugins/cacheresource.apc.php similarity index 82% rename from lib/classes/Smarty-3.1.14/demo/plugins/cacheresource.apc.php rename to lib/classes/Smarty-3.1.15/demo/plugins/cacheresource.apc.php index 00ba5981..9854f638 100644 --- a/lib/classes/Smarty-3.1.14/demo/plugins/cacheresource.apc.php +++ b/lib/classes/Smarty-3.1.15/demo/plugins/cacheresource.apc.php @@ -9,12 +9,12 @@ * @package CacheResource-examples * @author Uwe Tews */ -class Smarty_CacheResource_Apc extends Smarty_CacheResource_KeyValueStore { - +class Smarty_CacheResource_Apc extends Smarty_CacheResource_KeyValueStore +{ public function __construct() { // test if APC is present - if(!function_exists('apc_cache_info')) { + if (!function_exists('apc_cache_info')) { throw new Exception('APC Template Caching Error: APC is not installed'); } } @@ -22,8 +22,8 @@ class Smarty_CacheResource_Apc extends Smarty_CacheResource_KeyValueStore { /** * Read values for a set of keys from cache * - * @param array $keys list of keys to fetch - * @return array list of values with the given keys used as indexes + * @param array $keys list of keys to fetch + * @return array list of values with the given keys used as indexes * @return boolean true on success, false on failure */ protected function read(array $keys) @@ -33,14 +33,15 @@ class Smarty_CacheResource_Apc extends Smarty_CacheResource_KeyValueStore { foreach ($res as $k => $v) { $_res[$k] = $v; } + return $_res; } /** * Save values for a set of keys to cache * - * @param array $keys list of values to save - * @param int $expire expiration time + * @param array $keys list of values to save + * @param int $expire expiration time * @return boolean true on success, false on failure */ protected function write(array $keys, $expire=null) @@ -48,13 +49,14 @@ class Smarty_CacheResource_Apc extends Smarty_CacheResource_KeyValueStore { foreach ($keys as $k => $v) { apc_store($k, $v, $expire); } + return true; } /** * Remove values from cache * - * @param array $keys list of keys to delete + * @param array $keys list of keys to delete * @return boolean true on success, false on failure */ protected function delete(array $keys) @@ -62,6 +64,7 @@ class Smarty_CacheResource_Apc extends Smarty_CacheResource_KeyValueStore { foreach ($keys as $k) { apc_delete($k); } + return true; } diff --git a/lib/classes/Smarty-3.1.14/demo/plugins/cacheresource.memcache.php b/lib/classes/Smarty-3.1.15/demo/plugins/cacheresource.memcache.php similarity index 87% rename from lib/classes/Smarty-3.1.14/demo/plugins/cacheresource.memcache.php rename to lib/classes/Smarty-3.1.15/demo/plugins/cacheresource.memcache.php index 230607d6..f38b00ac 100644 --- a/lib/classes/Smarty-3.1.14/demo/plugins/cacheresource.memcache.php +++ b/lib/classes/Smarty-3.1.15/demo/plugins/cacheresource.memcache.php @@ -12,24 +12,25 @@ * @package CacheResource-examples * @author Rodney Rehm */ -class Smarty_CacheResource_Memcache extends Smarty_CacheResource_KeyValueStore { +class Smarty_CacheResource_Memcache extends Smarty_CacheResource_KeyValueStore +{ /** * memcache instance * @var Memcache */ protected $memcache = null; - + public function __construct() { $this->memcache = new Memcache(); $this->memcache->addServer( '127.0.0.1', 11211 ); } - + /** * Read values for a set of keys from cache * - * @param array $keys list of keys to fetch - * @return array list of values with the given keys used as indexes + * @param array $keys list of keys to fetch + * @return array list of values with the given keys used as indexes * @return boolean true on success, false on failure */ protected function read(array $keys) @@ -45,14 +46,15 @@ class Smarty_CacheResource_Memcache extends Smarty_CacheResource_KeyValueStore { foreach ($res as $k => $v) { $_res[$lookup[$k]] = $v; } + return $_res; } - + /** * Save values for a set of keys to cache * - * @param array $keys list of values to save - * @param int $expire expiration time + * @param array $keys list of values to save + * @param int $expire expiration time * @return boolean true on success, false on failure */ protected function write(array $keys, $expire=null) @@ -61,13 +63,14 @@ class Smarty_CacheResource_Memcache extends Smarty_CacheResource_KeyValueStore { $k = sha1($k); $this->memcache->set($k, $v, 0, $expire); } + return true; } /** * Remove values from cache * - * @param array $keys list of keys to delete + * @param array $keys list of keys to delete * @return boolean true on success, false on failure */ protected function delete(array $keys) @@ -76,6 +79,7 @@ class Smarty_CacheResource_Memcache extends Smarty_CacheResource_KeyValueStore { $k = sha1($k); $this->memcache->delete($k); } + return true; } diff --git a/lib/classes/Smarty-3.1.14/demo/plugins/cacheresource.mysql.php b/lib/classes/Smarty-3.1.15/demo/plugins/cacheresource.mysql.php similarity index 76% rename from lib/classes/Smarty-3.1.14/demo/plugins/cacheresource.mysql.php rename to lib/classes/Smarty-3.1.15/demo/plugins/cacheresource.mysql.php index ab8c4751..73771e7b 100644 --- a/lib/classes/Smarty-3.1.14/demo/plugins/cacheresource.mysql.php +++ b/lib/classes/Smarty-3.1.15/demo/plugins/cacheresource.mysql.php @@ -24,16 +24,18 @@ * @package CacheResource-examples * @author Rodney Rehm */ -class Smarty_CacheResource_Mysql extends Smarty_CacheResource_Custom { +class Smarty_CacheResource_Mysql extends Smarty_CacheResource_Custom +{ // PDO instance protected $db; protected $fetch; protected $fetchTimestamp; protected $save; - - public function __construct() { + + public function __construct() + { try { - $this->db = new PDO("mysql:dbname=test;host=127.0.0.1", "smarty", "smarty"); + $this->db = new PDO("mysql:dbname=test;host=127.0.0.1", "smarty"); } catch (PDOException $e) { throw new SmartyException('Mysql Resource failed: ' . $e->getMessage()); } @@ -46,19 +48,19 @@ class Smarty_CacheResource_Mysql extends Smarty_CacheResource_Custom { /** * fetch cached content and its modification time from data source * - * @param string $id unique cache content identifier - * @param string $name template name - * @param string $cache_id cache id - * @param string $compile_id compile id - * @param string $content cached content - * @param integer $mtime cache modification timestamp (epoch) + * @param string $id unique cache content identifier + * @param string $name template name + * @param string $cache_id cache id + * @param string $compile_id compile id + * @param string $content cached content + * @param integer $mtime cache modification timestamp (epoch) * @return void */ protected function fetch($id, $name, $cache_id, $compile_id, &$content, &$mtime) { $this->fetch->execute(array('id' => $id)); $row = $this->fetch->fetch(); - $this->fetch->closeCursor(); + $this->fetch->closeCursor(); if ($row) { $content = $row['content']; $mtime = strtotime($row['modified']); @@ -67,15 +69,15 @@ class Smarty_CacheResource_Mysql extends Smarty_CacheResource_Custom { $mtime = null; } } - + /** * Fetch cached content's modification timestamp from data source * * @note implementing this method is optional. Only implement it if modification times can be accessed faster than loading the complete cached content. - * @param string $id unique cache content identifier - * @param string $name template name - * @param string $cache_id cache id - * @param string $compile_id compile id + * @param string $id unique cache content identifier + * @param string $name template name + * @param string $cache_id cache id + * @param string $compile_id compile id * @return integer|boolean timestamp (epoch) the template was modified, or false if not found */ protected function fetchTimestamp($id, $name, $cache_id, $compile_id) @@ -83,19 +85,20 @@ class Smarty_CacheResource_Mysql extends Smarty_CacheResource_Custom { $this->fetchTimestamp->execute(array('id' => $id)); $mtime = strtotime($this->fetchTimestamp->fetchColumn()); $this->fetchTimestamp->closeCursor(); + return $mtime; } - + /** * Save content to cache * - * @param string $id unique cache content identifier - * @param string $name template name - * @param string $cache_id cache id - * @param string $compile_id compile id - * @param integer|null $exp_time seconds till expiration time in seconds or null - * @param string $content content to cache - * @return boolean success + * @param string $id unique cache content identifier + * @param string $name template name + * @param string $cache_id cache id + * @param string $compile_id compile id + * @param integer|null $exp_time seconds till expiration time in seconds or null + * @param string $content content to cache + * @return boolean success */ protected function save($id, $name, $cache_id, $compile_id, $exp_time, $content) { @@ -106,17 +109,18 @@ class Smarty_CacheResource_Mysql extends Smarty_CacheResource_Custom { 'compile_id' => $compile_id, 'content' => $content, )); + return !!$this->save->rowCount(); } - + /** * Delete content from cache * - * @param string $name template name - * @param string $cache_id cache id - * @param string $compile_id compile id - * @param integer|null $exp_time seconds till expiration or null - * @return integer number of deleted caches + * @param string $name template name + * @param string $cache_id cache id + * @param string $compile_id compile id + * @param integer|null $exp_time seconds till expiration or null + * @return integer number of deleted caches */ protected function delete($name, $cache_id, $compile_id, $exp_time) { @@ -124,6 +128,7 @@ class Smarty_CacheResource_Mysql extends Smarty_CacheResource_Custom { if ($name === null && $cache_id === null && $compile_id === null && $exp_time === null) { // returning the number of deleted caches would require a second query to count them $query = $this->db->query('TRUNCATE TABLE output_cache'); + return -1; } // build the filter @@ -147,6 +152,7 @@ class Smarty_CacheResource_Mysql extends Smarty_CacheResource_Custom { } // run delete query $query = $this->db->query('DELETE FROM output_cache WHERE ' . join(' AND ', $where)); + return $query->rowCount(); } } diff --git a/lib/classes/Smarty-3.1.14/demo/plugins/resource.extendsall.php b/lib/classes/Smarty-3.1.15/demo/plugins/resource.extendsall.php similarity index 86% rename from lib/classes/Smarty-3.1.14/demo/plugins/resource.extendsall.php rename to lib/classes/Smarty-3.1.15/demo/plugins/resource.extendsall.php index d8c40b5b..586e6c8c 100644 --- a/lib/classes/Smarty-3.1.14/demo/plugins/resource.extendsall.php +++ b/lib/classes/Smarty-3.1.15/demo/plugins/resource.extendsall.php @@ -2,20 +2,20 @@ /** * Extends All Resource - * + * * Resource Implementation modifying the extends-Resource to walk * through the template_dirs and inherit all templates of the same name - * + * * @package Resource-examples * @author Rodney Rehm */ -class Smarty_Resource_Extendsall extends Smarty_Internal_Resource_Extends { - +class Smarty_Resource_Extendsall extends Smarty_Internal_Resource_Extends +{ /** * populate Source Object with meta data from Resource * - * @param Smarty_Template_Source $source source object - * @param Smarty_Internal_Template $_template template object + * @param Smarty_Template_Source $source source object + * @param Smarty_Internal_Template $_template template object * @return void */ public function populate(Smarty_Template_Source $source, Smarty_Internal_Template $_template=null) @@ -31,20 +31,20 @@ class Smarty_Resource_Extendsall extends Smarty_Internal_Resource_Extends { } $sources[$s->uid] = $s; $uid .= $s->filepath; - } - catch (SmartyException $e) {} + } catch (SmartyException $e) {} } - + if (!$sources) { $source->exists = false; $source->template = $_template; + return; } - + $sources = array_reverse($sources, true); reset($sources); $s = current($sources); - + $source->components = $sources; $source->filepath = $s->filepath; $source->uid = sha1($uid); @@ -55,6 +55,4 @@ class Smarty_Resource_Extendsall extends Smarty_Internal_Resource_Extends { // need the template at getContent() $source->template = $_template; } -} - -?> \ No newline at end of file +} diff --git a/lib/classes/Smarty-3.1.14/demo/plugins/resource.mysql.php b/lib/classes/Smarty-3.1.15/demo/plugins/resource.mysql.php similarity index 85% rename from lib/classes/Smarty-3.1.14/demo/plugins/resource.mysql.php rename to lib/classes/Smarty-3.1.15/demo/plugins/resource.mysql.php index 312f3fc7..af78394c 100644 --- a/lib/classes/Smarty-3.1.14/demo/plugins/resource.mysql.php +++ b/lib/classes/Smarty-3.1.15/demo/plugins/resource.mysql.php @@ -20,7 +20,8 @@ * @package Resource-examples * @author Rodney Rehm */ -class Smarty_Resource_Mysql extends Smarty_Resource_Custom { +class Smarty_Resource_Mysql extends Smarty_Resource_Custom +{ // PDO instance protected $db; // prepared fetch() statement @@ -28,22 +29,23 @@ class Smarty_Resource_Mysql extends Smarty_Resource_Custom { // prepared fetchTimestamp() statement protected $mtime; - public function __construct() { + public function __construct() + { try { - $this->db = new PDO("mysql:dbname=test;host=127.0.0.1", "smarty", "smarty"); + $this->db = new PDO("mysql:dbname=test;host=127.0.0.1", "smarty"); } catch (PDOException $e) { throw new SmartyException('Mysql Resource failed: ' . $e->getMessage()); } $this->fetch = $this->db->prepare('SELECT modified, source FROM templates WHERE name = :name'); $this->mtime = $this->db->prepare('SELECT modified FROM templates WHERE name = :name'); } - + /** * Fetch a template and its modification time from database * - * @param string $name template name - * @param string $source template source - * @param integer $mtime template modification timestamp (epoch) + * @param string $name template name + * @param string $source template source + * @param integer $mtime template modification timestamp (epoch) * @return void */ protected function fetch($name, &$source, &$mtime) @@ -59,18 +61,20 @@ class Smarty_Resource_Mysql extends Smarty_Resource_Custom { $mtime = null; } } - + /** * Fetch a template's modification time from database * * @note implementing this method is optional. Only implement it if modification times can be accessed faster than loading the comple template source. - * @param string $name template name + * @param string $name template name * @return integer timestamp (epoch) the template was modified */ - protected function fetchTimestamp($name) { + protected function fetchTimestamp($name) + { $this->mtime->execute(array('name' => $name)); $mtime = $this->mtime->fetchColumn(); $this->mtime->closeCursor(); + return strtotime($mtime); } } diff --git a/lib/classes/Smarty-3.1.14/demo/plugins/resource.mysqls.php b/lib/classes/Smarty-3.1.15/demo/plugins/resource.mysqls.php similarity index 85% rename from lib/classes/Smarty-3.1.14/demo/plugins/resource.mysqls.php rename to lib/classes/Smarty-3.1.15/demo/plugins/resource.mysqls.php index e22bed0a..d16ad4b5 100644 --- a/lib/classes/Smarty-3.1.14/demo/plugins/resource.mysqls.php +++ b/lib/classes/Smarty-3.1.15/demo/plugins/resource.mysqls.php @@ -23,27 +23,29 @@ * @package Resource-examples * @author Rodney Rehm */ -class Smarty_Resource_Mysqls extends Smarty_Resource_Custom { +class Smarty_Resource_Mysqls extends Smarty_Resource_Custom +{ // PDO instance protected $db; // prepared fetch() statement protected $fetch; - public function __construct() { + public function __construct() + { try { - $this->db = new PDO("mysql:dbname=test;host=127.0.0.1", "smarty", "smarty"); + $this->db = new PDO("mysql:dbname=test;host=127.0.0.1", "smarty"); } catch (PDOException $e) { throw new SmartyException('Mysql Resource failed: ' . $e->getMessage()); } $this->fetch = $this->db->prepare('SELECT modified, source FROM templates WHERE name = :name'); } - + /** * Fetch a template and its modification time from database * - * @param string $name template name - * @param string $source template source - * @param integer $mtime template modification timestamp (epoch) + * @param string $name template name + * @param string $source template source + * @param integer $mtime template modification timestamp (epoch) * @return void */ protected function fetch($name, &$source, &$mtime) diff --git a/lib/classes/Smarty-3.1.14/demo/templates/footer.tpl b/lib/classes/Smarty-3.1.15/demo/templates/footer.tpl similarity index 100% rename from lib/classes/Smarty-3.1.14/demo/templates/footer.tpl rename to lib/classes/Smarty-3.1.15/demo/templates/footer.tpl diff --git a/lib/classes/Smarty-3.1.14/demo/templates/header.tpl b/lib/classes/Smarty-3.1.15/demo/templates/header.tpl similarity index 100% rename from lib/classes/Smarty-3.1.14/demo/templates/header.tpl rename to lib/classes/Smarty-3.1.15/demo/templates/header.tpl diff --git a/lib/classes/Smarty-3.1.14/demo/templates/index.tpl b/lib/classes/Smarty-3.1.15/demo/templates/index.tpl similarity index 100% rename from lib/classes/Smarty-3.1.14/demo/templates/index.tpl rename to lib/classes/Smarty-3.1.15/demo/templates/index.tpl diff --git a/lib/classes/Smarty-3.1.14/libs/Smarty.class.php b/lib/classes/Smarty-3.1.15/libs/Smarty.class.php similarity index 88% rename from lib/classes/Smarty-3.1.14/libs/Smarty.class.php rename to lib/classes/Smarty-3.1.15/libs/Smarty.class.php index ae2133eb..732b2df3 100644 --- a/lib/classes/Smarty-3.1.14/libs/Smarty.class.php +++ b/lib/classes/Smarty-3.1.15/libs/Smarty.class.php @@ -2,7 +2,7 @@ /** * Project: Smarty: the PHP compiling template engine * File: Smarty.class.php - * SVN: $Id: Smarty.class.php 4742 2013-06-17 13:30:49Z Uwe.Tews@googlemail.com $ + * SVN: $Id: Smarty.class.php 4778 2013-09-17 20:44:41Z Uwe.Tews@googlemail.com $ * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -28,7 +28,7 @@ * @author Uwe Tews * @author Rodney Rehm * @package Smarty - * @version 3.1-DEV + * @version 3.1.15 */ /** @@ -104,8 +104,8 @@ include_once SMARTY_SYSPLUGINS_DIR.'smarty_internal_cacheresource_file.php'; * This is the main Smarty class * @package Smarty */ -class Smarty extends Smarty_Internal_TemplateBase { - +class Smarty extends Smarty_Internal_TemplateBase +{ /**#@+ * constant definitions */ @@ -113,7 +113,7 @@ class Smarty extends Smarty_Internal_TemplateBase { /** * smarty version */ - const SMARTY_VERSION = 'Smarty-3.1.14'; + const SMARTY_VERSION = 'Smarty-3.1.15'; /** * define variable scopes @@ -131,7 +131,7 @@ class Smarty extends Smarty_Internal_TemplateBase { /** * define constant for clearing cache files be saved expiration datees */ - const CLEAR_EXPIRED = -1; + const CLEAR_EXPIRED = -1; /** * define compile check modes @@ -633,7 +633,6 @@ class Smarty extends Smarty_Internal_TemplateBase { } } - /** * Class destructor */ @@ -650,14 +649,13 @@ class Smarty extends Smarty_Internal_TemplateBase { $this->smarty = $this; } - /** * <> Generic getter. * * Calls the appropriate getter function. * Issues an E_USER_NOTICE if no valid getter is found. * - * @param string $name property name + * @param string $name property name * @return mixed */ public function __get($name) @@ -706,7 +704,7 @@ class Smarty extends Smarty_Internal_TemplateBase { /** * Check if a template resource exists * - * @param string $resource_name template name + * @param string $resource_name template name * @return boolean status */ public function templateExists($resource_name) @@ -717,14 +715,15 @@ class Smarty extends Smarty_Internal_TemplateBase { // check if it does exists $result = $tpl->source->exists; $this->template_objects = $save; + return $result; } /** * Returns a single or all global variables * - * @param object $smarty - * @param string $varname variable name or null + * @param object $smarty + * @param string $varname variable name or null * @return string variable value or or array of variables */ public function getGlobal($varname = null) @@ -740,6 +739,7 @@ class Smarty extends Smarty_Internal_TemplateBase { foreach (self::$global_tpl_vars AS $key => $var) { $_result[$key] = $var->value; } + return $_result; } } @@ -747,26 +747,27 @@ class Smarty extends Smarty_Internal_TemplateBase { /** * Empty cache folder * - * @param integer $exp_time expiration time - * @param string $type resource type + * @param integer $exp_time expiration time + * @param string $type resource type * @return integer number of cache files deleted */ - function clearAllCache($exp_time = null, $type = null) + public function clearAllCache($exp_time = null, $type = null) { // load cache resource and call clearAll $_cache_resource = Smarty_CacheResource::load($this, $type); Smarty_CacheResource::invalidLoadedCache($this); + return $_cache_resource->clearAll($this, $exp_time); } /** * Empty cache for a specific template * - * @param string $template_name template name - * @param string $cache_id cache id - * @param string $compile_id compile id - * @param integer $exp_time expiration time - * @param string $type resource type + * @param string $template_name template name + * @param string $cache_id cache id + * @param string $compile_id compile id + * @param integer $exp_time expiration time + * @param string $type resource type * @return integer number of cache files deleted */ public function clearCache($template_name, $cache_id = null, $compile_id = null, $exp_time = null, $type = null) @@ -774,20 +775,22 @@ class Smarty extends Smarty_Internal_TemplateBase { // load cache resource and call clear $_cache_resource = Smarty_CacheResource::load($this, $type); Smarty_CacheResource::invalidLoadedCache($this); + return $_cache_resource->clear($this, $template_name, $cache_id, $compile_id, $exp_time); } /** * Loads security class and enables security * - * @param string|Smarty_Security $security_class if a string is used, it must be class-name - * @return Smarty current Smarty instance for chaining - * @throws SmartyException when an invalid class name is provided + * @param string|Smarty_Security $security_class if a string is used, it must be class-name + * @return Smarty current Smarty instance for chaining + * @throws SmartyException when an invalid class name is provided */ public function enableSecurity($security_class = null) { if ($security_class instanceof Smarty_Security) { $this->security_policy = $security_class; + return $this; } elseif (is_object($security_class)) { throw new SmartyException("Class '" . get_class($security_class) . "' must extend Smarty_Security."); @@ -820,8 +823,8 @@ class Smarty extends Smarty_Internal_TemplateBase { /** * Set template directory * - * @param string|array $template_dir directory(s) of template sources - * @return Smarty current Smarty instance for chaining + * @param string|array $template_dir directory(s) of template sources + * @return Smarty current Smarty instance for chaining */ public function setTemplateDir($template_dir) { @@ -831,15 +834,16 @@ class Smarty extends Smarty_Internal_TemplateBase { } $this->joined_template_dir = join(DIRECTORY_SEPARATOR, $this->template_dir); + return $this; } /** * Add template directory(s) * - * @param string|array $template_dir directory(s) of template sources - * @param string $key of the array element to assign the template dir to - * @return Smarty current Smarty instance for chaining + * @param string|array $template_dir directory(s) of template sources + * @param string $key of the array element to assign the template dir to + * @return Smarty current Smarty instance for chaining * @throws SmartyException when the given template directory is not valid */ public function addTemplateDir($template_dir, $key=null) @@ -865,6 +869,7 @@ class Smarty extends Smarty_Internal_TemplateBase { $this->template_dir[] = rtrim($template_dir, '/\\') . DS; } $this->joined_template_dir = join(DIRECTORY_SEPARATOR, $this->template_dir); + return $this; } @@ -880,14 +885,14 @@ class Smarty extends Smarty_Internal_TemplateBase { return isset($this->template_dir[$index]) ? $this->template_dir[$index] : null; } - return (array)$this->template_dir; + return (array) $this->template_dir; } /** * Set config directory * - * @param string|array $template_dir directory(s) of configuration sources - * @return Smarty current Smarty instance for chaining + * @param string|array $template_dir directory(s) of configuration sources + * @return Smarty current Smarty instance for chaining */ public function setConfigDir($config_dir) { @@ -897,6 +902,7 @@ class Smarty extends Smarty_Internal_TemplateBase { } $this->joined_config_dir = join(DIRECTORY_SEPARATOR, $this->config_dir); + return $this; } @@ -922,7 +928,7 @@ class Smarty extends Smarty_Internal_TemplateBase { $this->config_dir[$k] = rtrim($v, '/\\') . DS; } } - } elseif( $key !== null ) { + } elseif ($key !== null) { // override directory at specified index $this->config_dir[$key] = rtrim($config_dir, '/\\') . DS; } else { @@ -931,6 +937,7 @@ class Smarty extends Smarty_Internal_TemplateBase { } $this->joined_config_dir = join(DIRECTORY_SEPARATOR, $this->config_dir); + return $this; } @@ -946,19 +953,19 @@ class Smarty extends Smarty_Internal_TemplateBase { return isset($this->config_dir[$index]) ? $this->config_dir[$index] : null; } - return (array)$this->config_dir; + return (array) $this->config_dir; } /** * Set plugins directory * - * @param string|array $plugins_dir directory(s) of plugins - * @return Smarty current Smarty instance for chaining + * @param string|array $plugins_dir directory(s) of plugins + * @return Smarty current Smarty instance for chaining */ public function setPluginsDir($plugins_dir) { $this->plugins_dir = array(); - foreach ((array)$plugins_dir as $k => $v) { + foreach ((array) $plugins_dir as $k => $v) { $this->plugins_dir[$k] = rtrim($v, '/\\') . DS; } @@ -993,6 +1000,7 @@ class Smarty extends Smarty_Internal_TemplateBase { } $this->plugins_dir = array_unique($this->plugins_dir); + return $this; } @@ -1003,13 +1011,13 @@ class Smarty extends Smarty_Internal_TemplateBase { */ public function getPluginsDir() { - return (array)$this->plugins_dir; + return (array) $this->plugins_dir; } /** * Set compile directory * - * @param string $compile_dir directory to store compiled templates in + * @param string $compile_dir directory to store compiled templates in * @return Smarty current Smarty instance for chaining */ public function setCompileDir($compile_dir) @@ -1018,6 +1026,7 @@ class Smarty extends Smarty_Internal_TemplateBase { if (!isset(Smarty::$_muted_directories[$this->compile_dir])) { Smarty::$_muted_directories[$this->compile_dir] = null; } + return $this; } @@ -1034,7 +1043,7 @@ class Smarty extends Smarty_Internal_TemplateBase { /** * Set cache directory * - * @param string $cache_dir directory to store cached templates in + * @param string $cache_dir directory to store cached templates in * @return Smarty current Smarty instance for chaining */ public function setCacheDir($cache_dir) @@ -1043,6 +1052,7 @@ class Smarty extends Smarty_Internal_TemplateBase { if (!isset(Smarty::$_muted_directories[$this->cache_dir])) { Smarty::$_muted_directories[$this->cache_dir] = null; } + return $this; } @@ -1059,20 +1069,21 @@ class Smarty extends Smarty_Internal_TemplateBase { /** * Set default modifiers * - * @param array|string $modifiers modifier or list of modifiers to set - * @return Smarty current Smarty instance for chaining + * @param array|string $modifiers modifier or list of modifiers to set + * @return Smarty current Smarty instance for chaining */ public function setDefaultModifiers($modifiers) { $this->default_modifiers = (array) $modifiers; + return $this; } /** * Add default modifiers * - * @param array|string $modifiers modifier or list of modifiers to add - * @return Smarty current Smarty instance for chaining + * @param array|string $modifiers modifier or list of modifiers to add + * @return Smarty current Smarty instance for chaining */ public function addDefaultModifiers($modifiers) { @@ -1099,8 +1110,8 @@ class Smarty extends Smarty_Internal_TemplateBase { /** * Set autoload filters * - * @param array $filters filters to load automatically - * @param string $type "pre", "output", … specify the filter type to set. Defaults to none treating $filters' keys as the appropriate types + * @param array $filters filters to load automatically + * @param string $type "pre", "output", … specify the filter type to set. Defaults to none treating $filters' keys as the appropriate types * @return Smarty current Smarty instance for chaining */ public function setAutoloadFilters($filters, $type=null) @@ -1117,8 +1128,8 @@ class Smarty extends Smarty_Internal_TemplateBase { /** * Add autoload filters * - * @param array $filters filters to load automatically - * @param string $type "pre", "output", … specify the filter type to set. Defaults to none treating $filters' keys as the appropriate types + * @param array $filters filters to load automatically + * @param string $type "pre", "output", … specify the filter type to set. Defaults to none treating $filters' keys as the appropriate types * @return Smarty current Smarty instance for chaining */ public function addAutoloadFilters($filters, $type=null) @@ -1145,8 +1156,8 @@ class Smarty extends Smarty_Internal_TemplateBase { /** * Get autoload filters * - * @param string $type type of filter to get autoloads for. Defaults to all autoload filters - * @return array array( 'type1' => array( 'filter1', 'filter2', … ) ) or array( 'filter1', 'filter2', …) if $type was specified + * @param string $type type of filter to get autoloads for. Defaults to all autoload filters + * @return array array( 'type1' => array( 'filter1', 'filter2', … ) ) or array( 'filter1', 'filter2', …) if $type was specified */ public function getAutoloadFilters($type=null) { @@ -1170,8 +1181,8 @@ class Smarty extends Smarty_Internal_TemplateBase { /** * set the debug template * - * @param string $tpl_name - * @return Smarty current Smarty instance for chaining + * @param string $tpl_name + * @return Smarty current Smarty instance for chaining * @throws SmartyException if file is not readable */ public function setDebugTemplate($tpl_name) @@ -1187,12 +1198,12 @@ class Smarty extends Smarty_Internal_TemplateBase { /** * creates a template object * - * @param string $template the resource handle of the template file - * @param mixed $cache_id cache id to be used with this template - * @param mixed $compile_id compile id to be used with this template - * @param object $parent next higher level of Smarty variables - * @param boolean $do_clone flag is Smarty object shall be cloned - * @return object template object + * @param string $template the resource handle of the template file + * @param mixed $cache_id cache id to be used with this template + * @param mixed $compile_id compile id to be used with this template + * @param object $parent next higher level of Smarty variables + * @param boolean $do_clone flag is Smarty object shall be cloned + * @return object template object */ public function createTemplate($template, $cache_id = null, $compile_id = null, $parent = null, $do_clone = true) { @@ -1247,6 +1258,7 @@ class Smarty extends Smarty_Internal_TemplateBase { $tpl->tpl_vars[$_key] = new Smarty_variable($_val); } } + return $tpl; } @@ -1256,8 +1268,8 @@ class Smarty extends Smarty_Internal_TemplateBase { * class name format: Smarty_PluginType_PluginName * plugin filename format: plugintype.pluginname.php * - * @param string $plugin_name class plugin name to load - * @param bool $check check if already loaded + * @param string $plugin_name class plugin name to load + * @param bool $check check if already loaded * @return string |boolean filepath of loaded file or false */ public function loadPlugin($plugin_name, $check = true) @@ -1272,6 +1284,7 @@ class Smarty extends Smarty_Internal_TemplateBase { // count($_name_parts) < 3 === !isset($_name_parts[2]) if (!isset($_name_parts[2]) || strtolower($_name_parts[0]) !== 'smarty') { throw new SmartyException("plugin {$plugin_name} is not a valid name format"); + return false; } // if type is "internal", get plugin from sysplugins @@ -1279,6 +1292,7 @@ class Smarty extends Smarty_Internal_TemplateBase { $file = SMARTY_SYSPLUGINS_DIR . strtolower($plugin_name) . '.php'; if (file_exists($file)) { require_once($file); + return $file; } else { return false; @@ -1290,7 +1304,7 @@ class Smarty extends Smarty_Internal_TemplateBase { $_stream_resolve_include_path = function_exists('stream_resolve_include_path'); // loop through plugin dirs and find the plugin - foreach($this->getPluginsDir() as $_plugin_dir) { + foreach ($this->getPluginsDir() as $_plugin_dir) { $names = array( $_plugin_dir . $_plugin_filename, $_plugin_dir . strtolower($_plugin_filename), @@ -1298,6 +1312,7 @@ class Smarty extends Smarty_Internal_TemplateBase { foreach ($names as $file) { if (file_exists($file)) { require_once($file); + return $file; } if ($this->use_include_path && !preg_match('/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/', $_plugin_dir)) { @@ -1310,6 +1325,7 @@ class Smarty extends Smarty_Internal_TemplateBase { if ($file !== false) { require_once($file); + return $file; } } @@ -1322,10 +1338,10 @@ class Smarty extends Smarty_Internal_TemplateBase { /** * Compile all template files * - * @param string $extension file extension - * @param bool $force_compile force all to recompile - * @param int $time_limit - * @param int $max_errors + * @param string $extension file extension + * @param bool $force_compile force all to recompile + * @param int $time_limit + * @param int $max_errors * @return integer number of template files recompiled */ public function compileAllTemplates($extension = '.tpl', $force_compile = false, $time_limit = 0, $max_errors = null) @@ -1336,10 +1352,10 @@ class Smarty extends Smarty_Internal_TemplateBase { /** * Compile all config files * - * @param string $extension file extension - * @param bool $force_compile force all to recompile - * @param int $time_limit - * @param int $max_errors + * @param string $extension file extension + * @param bool $force_compile force all to recompile + * @param int $time_limit + * @param int $max_errors * @return integer number of template files recompiled */ public function compileAllConfig($extension = '.conf', $force_compile = false, $time_limit = 0, $max_errors = null) @@ -1350,9 +1366,9 @@ class Smarty extends Smarty_Internal_TemplateBase { /** * Delete compiled template file * - * @param string $resource_name template name - * @param string $compile_id compile id - * @param integer $exp_time expiration time + * @param string $resource_name template name + * @param string $compile_id compile id + * @param integer $exp_time expiration time * @return integer number of template files deleted */ public function clearCompiledTemplate($resource_name = null, $compile_id = null, $exp_time = null) @@ -1364,8 +1380,8 @@ class Smarty extends Smarty_Internal_TemplateBase { /** * Return array of tag/attributes of all tags used by an template * - * @param object $templae template object - * @return array of tag/attributes + * @param object $templae template object + * @return array of tag/attributes */ public function getTags(Smarty_Internal_Template $template) { @@ -1375,7 +1391,7 @@ class Smarty extends Smarty_Internal_TemplateBase { /** * Run installation test * - * @param array $errors Array to write errors into, rather than outputting them + * @param array $errors Array to write errors into, rather than outputting them * @return boolean true if setup is fine, false if something is wrong */ public function testInstall(&$errors=null) @@ -1387,7 +1403,7 @@ class Smarty extends Smarty_Internal_TemplateBase { * Error Handler to mute expected messages * * @link http://php.net/set_error_handler - * @param integer $errno Error level + * @param integer $errno Error level * @return boolean */ public static function mutingErrorHandler($errno, $errstr, $errfile, $errline, $errcontext) @@ -1492,10 +1508,13 @@ if (Smarty::$_CHARSET !== 'UTF-8') { * Smarty exception class * @package Smarty */ -class SmartyException extends Exception { - public static $escape = true; - public function __construct($message) { - $this->message = self::$escape ? htmlentities($message) : $message; +class SmartyException extends Exception +{ + public static $escape = false; + + public function __toString() + { + return ' --> Smarty: ' . (self::$escape ? htmlentities($this->message) : $this->message) . ' <-- '; } } @@ -1503,7 +1522,32 @@ class SmartyException extends Exception { * Smarty compiler exception class * @package Smarty */ -class SmartyCompilerException extends SmartyException { +class SmartyCompilerException extends SmartyException +{ + public function __toString() + { + return ' --> Smarty Compiler: ' . $this->message . ' <-- '; + } + /** + * The line number of the template error + * @type int|null + */ + public $line = null; + /** + * The template source snippet relating to the error + * @type string|null + */ + public $source = null; + /** + * The raw text of the error message + * @type string|null + */ + public $desc = null; + /** + * The resource identifier or template name + * @type string|null + */ + public $template = null; } /** @@ -1512,7 +1556,7 @@ class SmartyCompilerException extends SmartyException { function smartyAutoload($class) { $_class = strtolower($class); - $_classes = array( + static $_classes = array( 'smarty_config_source' => true, 'smarty_config_compiled' => true, 'smarty_security' => true, @@ -1529,5 +1573,3 @@ function smartyAutoload($class) include SMARTY_SYSPLUGINS_DIR . $_class . '.php'; } } - -?> diff --git a/lib/classes/Smarty-3.1.14/libs/SmartyBC.class.php b/lib/classes/Smarty-3.1.15/libs/SmartyBC.class.php similarity index 90% rename from lib/classes/Smarty-3.1.14/libs/SmartyBC.class.php rename to lib/classes/Smarty-3.1.15/libs/SmartyBC.class.php index 589dcca2..32f22289 100644 --- a/lib/classes/Smarty-3.1.14/libs/SmartyBC.class.php +++ b/lib/classes/Smarty-3.1.15/libs/SmartyBC.class.php @@ -39,8 +39,8 @@ require(dirname(__FILE__) . '/Smarty.class.php'); * * @package Smarty */ -class SmartyBC extends Smarty { - +class SmartyBC extends Smarty +{ /** * Smarty 2 BC * @var string @@ -118,10 +118,10 @@ class SmartyBC extends Smarty { /** * Registers object to be used in templates * - * @param string $object name of template object - * @param object $object_impl the referenced PHP object to register - * @param array $allowed list of allowed methods (empty = all) - * @param boolean $smarty_args smarty argument format, else traditional + * @param string $object name of template object + * @param object $object_impl the referenced PHP object to register + * @param array $allowed list of allowed methods (empty = all) + * @param boolean $smarty_args smarty argument format, else traditional * @param array $block_functs list of methods that are block format */ public function register_object($object, $object_impl, $allowed = array(), $smarty_args = true, $block_methods = array()) @@ -144,8 +144,8 @@ class SmartyBC extends Smarty { /** * Registers block function to be used in templates * - * @param string $block name of template block - * @param string $block_impl PHP function to register + * @param string $block name of template block + * @param string $block_impl PHP function to register * @param bool $cacheable * @param mixed $cache_attrs */ @@ -189,7 +189,7 @@ class SmartyBC extends Smarty { /** * Registers modifier to be used in templates * - * @param string $modifier name of template modifier + * @param string $modifier name of template modifier * @param string $modifier_impl name of PHP function to register */ public function register_modifier($modifier, $modifier_impl) @@ -305,10 +305,10 @@ class SmartyBC extends Smarty { /** * clear cached content for the given template and cache id * - * @param string $tpl_file name of template file - * @param string $cache_id name of cache_id - * @param string $compile_id name of compile_id - * @param string $exp_time expiration time + * @param string $tpl_file name of template file + * @param string $cache_id name of cache_id + * @param string $compile_id name of compile_id + * @param string $exp_time expiration time * @return boolean */ public function clear_cache($tpl_file = null, $cache_id = null, $compile_id = null, $exp_time = null) @@ -319,7 +319,7 @@ class SmartyBC extends Smarty { /** * clear the entire contents of cache (all templates) * - * @param string $exp_time expire time + * @param string $exp_time expire time * @return boolean */ public function clear_all_cache($exp_time = null) @@ -330,9 +330,9 @@ class SmartyBC extends Smarty { /** * test to see if valid cache exists for this template * - * @param string $tpl_file name of template file - * @param string $cache_id - * @param string $compile_id + * @param string $tpl_file name of template file + * @param string $cache_id + * @param string $compile_id * @return boolean */ public function is_cached($tpl_file, $cache_id = null, $compile_id = null) @@ -353,9 +353,9 @@ class SmartyBC extends Smarty { * or all compiled template files if one is not specified. * This function is for advanced use only, not normally needed. * - * @param string $tpl_file - * @param string $compile_id - * @param string $exp_time + * @param string $tpl_file + * @param string $compile_id + * @param string $exp_time * @return boolean results of {@link smarty_core_rm_auto()} */ public function clear_compiled_tpl($tpl_file = null, $compile_id = null, $exp_time = null) @@ -366,7 +366,7 @@ class SmartyBC extends Smarty { /** * Checks whether requested template exists. * - * @param string $tpl_file + * @param string $tpl_file * @return boolean */ public function template_exists($tpl_file) @@ -377,7 +377,7 @@ class SmartyBC extends Smarty { /** * Returns an array containing template variables * - * @param string $name + * @param string $name * @return array */ public function get_template_vars($name=null) @@ -388,7 +388,7 @@ class SmartyBC extends Smarty { /** * Returns an array containing config variables * - * @param string $name + * @param string $name * @return array */ public function get_config_vars($name=null) @@ -411,7 +411,7 @@ class SmartyBC extends Smarty { /** * return a reference to a registered object * - * @param string $name + * @param string $name * @return object */ public function get_registered_object($name) @@ -432,7 +432,7 @@ class SmartyBC extends Smarty { /** * trigger Smarty error * - * @param string $error_msg + * @param string $error_msg * @param integer $error_type */ public function trigger_error($error_msg, $error_type = E_USER_WARNING) @@ -454,7 +454,6 @@ class SmartyBC extends Smarty { function smarty_php_tag($params, $content, $template, &$repeat) { eval($content); + return ''; } - -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.14/libs/debug.tpl b/lib/classes/Smarty-3.1.15/libs/debug.tpl similarity index 100% rename from lib/classes/Smarty-3.1.14/libs/debug.tpl rename to lib/classes/Smarty-3.1.15/libs/debug.tpl diff --git a/lib/classes/Smarty-3.1.14/libs/plugins/block.textformat.php b/lib/classes/Smarty-3.1.15/libs/plugins/block.textformat.php similarity index 96% rename from lib/classes/Smarty-3.1.14/libs/plugins/block.textformat.php rename to lib/classes/Smarty-3.1.15/libs/plugins/block.textformat.php index b22b104a..b62a4f8e 100644 --- a/lib/classes/Smarty-3.1.14/libs/plugins/block.textformat.php +++ b/lib/classes/Smarty-3.1.15/libs/plugins/block.textformat.php @@ -53,17 +53,17 @@ function smarty_block_textformat($params, $content, $template, &$repeat) case 'indent_char': case 'wrap_char': case 'assign': - $$_key = (string)$_val; + $$_key = (string) $_val; break; case 'indent': case 'indent_first': case 'wrap': - $$_key = (int)$_val; + $$_key = (int) $_val; break; case 'wrap_cut': - $$_key = (bool)$_val; + $$_key = (bool) $_val; break; default: @@ -78,7 +78,6 @@ function smarty_block_textformat($params, $content, $template, &$repeat) $_paragraphs = preg_split('![\r\n]{2}!', $content); $_output = ''; - foreach ($_paragraphs as &$_paragraph) { if (!$_paragraph) { continue; @@ -102,12 +101,10 @@ function smarty_block_textformat($params, $content, $template, &$repeat) } } $_output = implode($wrap_char . $wrap_char, $_paragraphs); - + if ($assign) { $template->assign($assign, $_output); } else { return $_output; } } - -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.14/libs/plugins/function.counter.php b/lib/classes/Smarty-3.1.15/libs/plugins/function.counter.php similarity index 92% rename from lib/classes/Smarty-3.1.14/libs/plugins/function.counter.php rename to lib/classes/Smarty-3.1.15/libs/plugins/function.counter.php index 3906badf..cd147634 100644 --- a/lib/classes/Smarty-3.1.14/libs/plugins/function.counter.php +++ b/lib/classes/Smarty-3.1.15/libs/plugins/function.counter.php @@ -35,7 +35,7 @@ function smarty_function_counter($params, $template) $counter =& $counters[$name]; if (isset($params['start'])) { - $counter['start'] = $counter['count'] = (int)$params['start']; + $counter['start'] = $counter['count'] = (int) $params['start']; } if (!empty($params['assign'])) { @@ -45,9 +45,9 @@ function smarty_function_counter($params, $template) if (isset($counter['assign'])) { $template->assign($counter['assign'], $counter['count']); } - + if (isset($params['print'])) { - $print = (bool)$params['print']; + $print = (bool) $params['print']; } else { $print = empty($counter['assign']); } @@ -61,7 +61,7 @@ function smarty_function_counter($params, $template) if (isset($params['skip'])) { $counter['skip'] = $params['skip']; } - + if (isset($params['direction'])) { $counter['direction'] = $params['direction']; } @@ -70,9 +70,7 @@ function smarty_function_counter($params, $template) $counter['count'] -= $counter['skip']; else $counter['count'] += $counter['skip']; - - return $retval; - -} -?> \ No newline at end of file + return $retval; + +} diff --git a/lib/classes/Smarty-3.1.14/libs/plugins/function.cycle.php b/lib/classes/Smarty-3.1.15/libs/plugins/function.cycle.php similarity index 86% rename from lib/classes/Smarty-3.1.14/libs/plugins/function.cycle.php rename to lib/classes/Smarty-3.1.15/libs/plugins/function.cycle.php index 1778ffb5..9bf26f8c 100644 --- a/lib/classes/Smarty-3.1.14/libs/plugins/function.cycle.php +++ b/lib/classes/Smarty-3.1.15/libs/plugins/function.cycle.php @@ -48,13 +48,14 @@ function smarty_function_cycle($params, $template) static $cycle_vars; $name = (empty($params['name'])) ? 'default' : $params['name']; - $print = (isset($params['print'])) ? (bool)$params['print'] : true; - $advance = (isset($params['advance'])) ? (bool)$params['advance'] : true; - $reset = (isset($params['reset'])) ? (bool)$params['reset'] : false; + $print = (isset($params['print'])) ? (bool) $params['print'] : true; + $advance = (isset($params['advance'])) ? (bool) $params['advance'] : true; + $reset = (isset($params['reset'])) ? (bool) $params['reset'] : false; if (!isset($params['values'])) { - if(!isset($cycle_vars[$name]['values'])) { + if (!isset($cycle_vars[$name]['values'])) { trigger_error("cycle: missing 'values' parameter"); + return; } } else { @@ -71,13 +72,13 @@ function smarty_function_cycle($params, $template) $cycle_vars[$name]['delimiter'] = ','; } - if(is_array($cycle_vars[$name]['values'])) { + if (is_array($cycle_vars[$name]['values'])) { $cycle_array = $cycle_vars[$name]['values']; } else { $cycle_array = explode($cycle_vars[$name]['delimiter'],$cycle_vars[$name]['values']); } - if(!isset($cycle_vars[$name]['index']) || $reset ) { + if (!isset($cycle_vars[$name]['index']) || $reset ) { $cycle_vars[$name]['index'] = 0; } @@ -86,13 +87,13 @@ function smarty_function_cycle($params, $template) $template->assign($params['assign'], $cycle_array[$cycle_vars[$name]['index']]); } - if($print) { + if ($print) { $retval = $cycle_array[$cycle_vars[$name]['index']]; } else { $retval = null; } - if($advance) { + if ($advance) { if ( $cycle_vars[$name]['index'] >= count($cycle_array) -1 ) { $cycle_vars[$name]['index'] = 0; } else { @@ -102,5 +103,3 @@ function smarty_function_cycle($params, $template) return $retval; } - -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.14/libs/plugins/function.fetch.php b/lib/classes/Smarty-3.1.15/libs/plugins/function.fetch.php similarity index 79% rename from lib/classes/Smarty-3.1.14/libs/plugins/function.fetch.php rename to lib/classes/Smarty-3.1.15/libs/plugins/function.fetch.php index eca1182d..a4eaef37 100644 --- a/lib/classes/Smarty-3.1.14/libs/plugins/function.fetch.php +++ b/lib/classes/Smarty-3.1.15/libs/plugins/function.fetch.php @@ -24,28 +24,29 @@ function smarty_function_fetch($params, $template) { if (empty($params['file'])) { trigger_error("[plugin] fetch parameter 'file' cannot be empty",E_USER_NOTICE); + return; } - + // strip file protocol if (stripos($params['file'], 'file://') === 0) { $params['file'] = substr($params['file'], 7); } - + $protocol = strpos($params['file'], '://'); if ($protocol !== false) { $protocol = strtolower(substr($params['file'], 0, $protocol)); } - + if (isset($template->smarty->security_policy)) { if ($protocol) { // remote resource (or php stream, …) - if(!$template->smarty->security_policy->isTrustedUri($params['file'])) { + if (!$template->smarty->security_policy->isTrustedUri($params['file'])) { return; } } else { // local file - if(!$template->smarty->security_policy->isTrustedResourceDir($params['file'])) { + if (!$template->smarty->security_policy->isTrustedResourceDir($params['file'])) { return; } } @@ -54,7 +55,7 @@ function smarty_function_fetch($params, $template) $content = ''; if ($protocol == 'http') { // http fetch - if($uri_parts = parse_url($params['file'])) { + if ($uri_parts = parse_url($params['file'])) { // set defaults $host = $server_name = $uri_parts['host']; $timeout = 30; @@ -64,43 +65,44 @@ function smarty_function_fetch($params, $template) $uri = !empty($uri_parts['path']) ? $uri_parts['path'] : '/'; $uri .= !empty($uri_parts['query']) ? '?' . $uri_parts['query'] : ''; $_is_proxy = false; - if(empty($uri_parts['port'])) { + if (empty($uri_parts['port'])) { $port = 80; } else { $port = $uri_parts['port']; } - if(!empty($uri_parts['user'])) { + if (!empty($uri_parts['user'])) { $user = $uri_parts['user']; } - if(!empty($uri_parts['pass'])) { + if (!empty($uri_parts['pass'])) { $pass = $uri_parts['pass']; } // loop through parameters, setup headers - foreach($params as $param_key => $param_value) { - switch($param_key) { + foreach ($params as $param_key => $param_value) { + switch ($param_key) { case "file": case "assign": case "assign_headers": break; case "user": - if(!empty($param_value)) { + if (!empty($param_value)) { $user = $param_value; } break; case "pass": - if(!empty($param_value)) { + if (!empty($param_value)) { $pass = $param_value; } break; case "accept": - if(!empty($param_value)) { + if (!empty($param_value)) { $accept = $param_value; } break; case "header": - if(!empty($param_value)) { - if(!preg_match('![\w\d-]+: .+!',$param_value)) { + if (!empty($param_value)) { + if (!preg_match('![\w\d-]+: .+!',$param_value)) { trigger_error("[plugin] invalid header format '".$param_value."'",E_USER_NOTICE); + return; } else { $extra_headers[] = $param_value; @@ -108,80 +110,84 @@ function smarty_function_fetch($params, $template) } break; case "proxy_host": - if(!empty($param_value)) { + if (!empty($param_value)) { $proxy_host = $param_value; } break; case "proxy_port": - if(!preg_match('!\D!', $param_value)) { + if (!preg_match('!\D!', $param_value)) { $proxy_port = (int) $param_value; } else { trigger_error("[plugin] invalid value for attribute '".$param_key."'",E_USER_NOTICE); + return; } break; case "agent": - if(!empty($param_value)) { + if (!empty($param_value)) { $agent = $param_value; } break; case "referer": - if(!empty($param_value)) { + if (!empty($param_value)) { $referer = $param_value; } break; case "timeout": - if(!preg_match('!\D!', $param_value)) { + if (!preg_match('!\D!', $param_value)) { $timeout = (int) $param_value; } else { trigger_error("[plugin] invalid value for attribute '".$param_key."'",E_USER_NOTICE); + return; } break; default: trigger_error("[plugin] unrecognized attribute '".$param_key."'",E_USER_NOTICE); + return; } } - if(!empty($proxy_host) && !empty($proxy_port)) { + if (!empty($proxy_host) && !empty($proxy_port)) { $_is_proxy = true; $fp = fsockopen($proxy_host,$proxy_port,$errno,$errstr,$timeout); } else { $fp = fsockopen($server_name,$port,$errno,$errstr,$timeout); } - if(!$fp) { + if (!$fp) { trigger_error("[plugin] unable to fetch: $errstr ($errno)",E_USER_NOTICE); + return; } else { - if($_is_proxy) { + if ($_is_proxy) { fputs($fp, 'GET ' . $params['file'] . " HTTP/1.0\r\n"); } else { fputs($fp, "GET $uri HTTP/1.0\r\n"); } - if(!empty($host)) { + if (!empty($host)) { fputs($fp, "Host: $host\r\n"); } - if(!empty($accept)) { + if (!empty($accept)) { fputs($fp, "Accept: $accept\r\n"); } - if(!empty($agent)) { + if (!empty($agent)) { fputs($fp, "User-Agent: $agent\r\n"); } - if(!empty($referer)) { + if (!empty($referer)) { fputs($fp, "Referer: $referer\r\n"); } - if(isset($extra_headers) && is_array($extra_headers)) { - foreach($extra_headers as $curr_header) { + if (isset($extra_headers) && is_array($extra_headers)) { + foreach ($extra_headers as $curr_header) { fputs($fp, $curr_header."\r\n"); } } - if(!empty($user) && !empty($pass)) { + if (!empty($user) && !empty($pass)) { fputs($fp, "Authorization: BASIC ".base64_encode("$user:$pass")."\r\n"); } fputs($fp, "\r\n"); - while(!feof($fp)) { + while (!feof($fp)) { $content .= fgets($fp,4096); } fclose($fp); @@ -189,12 +195,13 @@ function smarty_function_fetch($params, $template) $content = $csplit[1]; - if(!empty($params['assign_headers'])) { + if (!empty($params['assign_headers'])) { $template->assign($params['assign_headers'],preg_split("!\r\n!",$csplit[0])); } } } else { trigger_error("[plugin fetch] unable to parse URL, check syntax",E_USER_NOTICE); + return; } } else { @@ -210,5 +217,3 @@ function smarty_function_fetch($params, $template) return $content; } } - -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.14/libs/plugins/function.html_checkboxes.php b/lib/classes/Smarty-3.1.15/libs/plugins/function.html_checkboxes.php similarity index 97% rename from lib/classes/Smarty-3.1.14/libs/plugins/function.html_checkboxes.php rename to lib/classes/Smarty-3.1.15/libs/plugins/function.html_checkboxes.php index 1866bc2f..ad0e9cd4 100644 --- a/lib/classes/Smarty-3.1.14/libs/plugins/function.html_checkboxes.php +++ b/lib/classes/Smarty-3.1.15/libs/plugins/function.html_checkboxes.php @@ -58,8 +58,8 @@ function smarty_function_html_checkboxes($params, $template) $extra = ''; - foreach($params as $_key => $_val) { - switch($_key) { + foreach ($params as $_key => $_val) { + switch ($_key) { case 'name': case 'separator': $$_key = (string) $_val; @@ -134,7 +134,7 @@ function smarty_function_html_checkboxes($params, $template) // omit break; to fall through! default: - if(!is_array($_val)) { + if (!is_array($_val)) { $extra .= ' '.$_key.'="'.smarty_function_escape_special_chars($_val).'"'; } else { trigger_error("html_checkboxes: extra attribute '$_key' cannot be an array", E_USER_NOTICE); @@ -159,7 +159,7 @@ function smarty_function_html_checkboxes($params, $template) } } - if(!empty($params['assign'])) { + if (!empty($params['assign'])) { $template->assign($params['assign'], $_html_result); } else { return implode("\n", $_html_result); @@ -167,52 +167,55 @@ function smarty_function_html_checkboxes($params, $template) } -function smarty_function_html_checkboxes_output($name, $value, $output, $selected, $extra, $separator, $labels, $label_ids, $escape=true) { +function smarty_function_html_checkboxes_output($name, $value, $output, $selected, $extra, $separator, $labels, $label_ids, $escape=true) +{ $_output = ''; - + if (is_object($value)) { if (method_exists($value, "__toString")) { $value = (string) $value->__toString(); } else { trigger_error("html_options: value is an object of class '". get_class($value) ."' without __toString() method", E_USER_NOTICE); + return ''; } } else { $value = (string) $value; } - + if (is_object($output)) { if (method_exists($output, "__toString")) { $output = (string) $output->__toString(); } else { trigger_error("html_options: output is an object of class '". get_class($output) ."' without __toString() method", E_USER_NOTICE); + return ''; } } else { $output = (string) $output; } - + if ($labels) { if ($label_ids) { $_id = smarty_function_escape_special_chars(preg_replace('![^\w\-\.]!' . Smarty::$_UTF8_MODIFIER, '_', $name . '_' . $value)); $_output .= ''; } else { $_output .= ''; - } + } } - + $name = smarty_function_escape_special_chars($name); $value = smarty_function_escape_special_chars($value); if ($escape) { $output = smarty_function_escape_special_chars($output); } - + $_output .= '' . $output; if ($labels) { $_output .= ''; } - + $_output .= $separator; + return $_output; } - -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.14/libs/plugins/function.html_image.php b/lib/classes/Smarty-3.1.15/libs/plugins/function.html_image.php similarity index 89% rename from lib/classes/Smarty-3.1.14/libs/plugins/function.html_image.php rename to lib/classes/Smarty-3.1.15/libs/plugins/function.html_image.php index 6521966b..1674a262 100644 --- a/lib/classes/Smarty-3.1.14/libs/plugins/function.html_image.php +++ b/lib/classes/Smarty-3.1.15/libs/plugins/function.html_image.php @@ -1,14 +1,14 @@ * Name: html_image * Date: Feb 24, 2003 @@ -23,21 +23,21 @@ * - basedir - (optional) - base directory for absolute paths, default is environment variable DOCUMENT_ROOT * - path_prefix - prefix for path output (optional, default empty) * - * + * * @link http://www.smarty.net/manual/en/language.function.html.image.php {html_image} * (Smarty online manual) - * @author Monte Ohrt - * @author credits to Duda + * @author Monte Ohrt + * @author credits to Duda * @version 1.0 * @param array $params parameters * @param Smarty_Internal_Template $template template object - * @return string + * @return string * @uses smarty_function_escape_special_chars() */ function smarty_function_html_image($params, $template) { require_once(SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php'); - + $alt = ''; $file = ''; $height = ''; @@ -47,7 +47,7 @@ function smarty_function_html_image($params, $template) $suffix = ''; $path_prefix = ''; $basedir = isset($_SERVER['DOCUMENT_ROOT']) ? $_SERVER['DOCUMENT_ROOT'] : ''; - foreach($params as $_key => $_val) { + foreach ($params as $_key => $_val) { switch ($_key) { case 'file': case 'height': @@ -63,7 +63,7 @@ function smarty_function_html_image($params, $template) $$_key = smarty_function_escape_special_chars($_val); } else { throw new SmartyException ("html_image: extra attribute '$_key' cannot be an array", E_USER_NOTICE); - } + } break; case 'link': @@ -77,41 +77,42 @@ function smarty_function_html_image($params, $template) $extra .= ' ' . $_key . '="' . smarty_function_escape_special_chars($_val) . '"'; } else { throw new SmartyException ("html_image: extra attribute '$_key' cannot be an array", E_USER_NOTICE); - } + } break; - } - } + } + } if (empty($file)) { trigger_error("html_image: missing 'file' parameter", E_USER_NOTICE); + return; - } + } if ($file[0] == '/') { $_image_path = $basedir . $file; } else { $_image_path = $file; } - + // strip file protocol if (stripos($params['file'], 'file://') === 0) { $params['file'] = substr($params['file'], 7); } - + $protocol = strpos($params['file'], '://'); if ($protocol !== false) { $protocol = strtolower(substr($params['file'], 0, $protocol)); } - + if (isset($template->smarty->security_policy)) { if ($protocol) { // remote resource (or php stream, …) - if(!$template->smarty->security_policy->isTrustedUri($params['file'])) { + if (!$template->smarty->security_policy->isTrustedUri($params['file'])) { return; } } else { // local file - if(!$template->smarty->security_policy->isTrustedResourceDir($params['file'])) { + if (!$template->smarty->security_policy->isTrustedResourceDir($params['file'])) { return; } } @@ -122,23 +123,26 @@ function smarty_function_html_image($params, $template) if (!$_image_data = @getimagesize($_image_path)) { if (!file_exists($_image_path)) { trigger_error("html_image: unable to find '$_image_path'", E_USER_NOTICE); + return; - } else if (!is_readable($_image_path)) { + } elseif (!is_readable($_image_path)) { trigger_error("html_image: unable to read '$_image_path'", E_USER_NOTICE); + return; } else { trigger_error("html_image: '$_image_path' is not a valid image file", E_USER_NOTICE); + return; - } + } } if (!isset($params['width'])) { $width = $_image_data[0]; - } + } if (!isset($params['height'])) { $height = $_image_data[1]; - } - } + } + } if (isset($params['dpi'])) { if (strstr($_SERVER['HTTP_USER_AGENT'], 'Mac')) { @@ -147,13 +151,11 @@ function smarty_function_html_image($params, $template) $dpi_default = 72; } else { $dpi_default = 96; - } + } $_resize = $dpi_default / $params['dpi']; $width = round($width * $_resize); $height = round($height * $_resize); - } + } return $prefix . '' . $suffix; -} - -?> \ No newline at end of file +} diff --git a/lib/classes/Smarty-3.1.14/libs/plugins/function.html_options.php b/lib/classes/Smarty-3.1.15/libs/plugins/function.html_options.php similarity index 96% rename from lib/classes/Smarty-3.1.14/libs/plugins/function.html_options.php rename to lib/classes/Smarty-3.1.15/libs/plugins/function.html_options.php index 68fa0524..5ff98750 100644 --- a/lib/classes/Smarty-3.1.14/libs/plugins/function.html_options.php +++ b/lib/classes/Smarty-3.1.15/libs/plugins/function.html_options.php @@ -1,14 +1,14 @@ * Name: html_options * Purpose: Prints the list of tags generated from @@ -23,14 +23,14 @@ * - id (optional) - string default not set * - class (optional) - string default not set * - * + * * @link http://www.smarty.net/manual/en/language.function.html.options.php {html_image} * (Smarty online manual) - * @author Monte Ohrt + * @author Monte Ohrt * @author Ralf Strehle (minor optimization) * @param array $params parameters * @param Smarty_Internal_Template $template template object - * @return string + * @return string * @uses smarty_function_escape_special_chars() */ function smarty_function_html_options($params, $template) @@ -90,36 +90,37 @@ function smarty_function_html_options($params, $template) $selected = smarty_function_escape_special_chars((string) $_val); } break; - + case 'strict': break; - + case 'disabled': case 'readonly': if (!empty($params['strict'])) { if (!is_scalar($_val)) { trigger_error("html_options: $_key attribute must be a scalar, only boolean true or string '$_key' will actually add the attribute", E_USER_NOTICE); } - + if ($_val === true || $_val === $_key) { $extra .= ' ' . $_key . '="' . smarty_function_escape_special_chars($_key) . '"'; } - + break; } // omit break; to fall through! - + default: if (!is_array($_val)) { $extra .= ' ' . $_key . '="' . smarty_function_escape_special_chars($_val) . '"'; } else { trigger_error("html_options: extra attribute '$_key' cannot be an array", E_USER_NOTICE); - } + } break; - } + } } if (!isset($options) && !isset($values)) { /* raise error here? */ + return ''; } @@ -134,14 +135,14 @@ function smarty_function_html_options($params, $template) foreach ($values as $_i => $_key) { $_val = isset($output[$_i]) ? $output[$_i] : ''; $_html_result .= smarty_function_html_options_optoutput($_key, $_val, $selected, $id, $class, $_idx); - } + } } if (!empty($name)) { $_html_class = !empty($class) ? ' class="'.$class.'"' : ''; $_html_id = !empty($id) ? ' id="'.$id.'"' : ''; $_html_result = '' . "\n" . $_html_result . '' . "\n"; - } + } return $_html_result; } @@ -165,6 +166,7 @@ function smarty_function_html_options_optoutput($key, $value, $selected, $id, $c $value = smarty_function_escape_special_chars((string) $value->__toString()); } else { trigger_error("html_options: value is an object of class '". get_class($value) ."' without __toString() method", E_USER_NOTICE); + return ''; } } else { @@ -177,17 +179,17 @@ function smarty_function_html_options_optoutput($key, $value, $selected, $id, $c $_html_result = smarty_function_html_options_optgroup($key, $value, $selected, !empty($id) ? ($id.'-'.$idx) : null, $class, $_idx); $idx++; } + return $_html_result; -} +} function smarty_function_html_options_optgroup($key, $values, $selected, $id, $class, &$idx) { $optgroup_html = '' . "\n"; foreach ($values as $key => $value) { $optgroup_html .= smarty_function_html_options_optoutput($key, $value, $selected, $id, $class, $idx); - } + } $optgroup_html .= "\n"; - return $optgroup_html; -} -?> \ No newline at end of file + return $optgroup_html; +} diff --git a/lib/classes/Smarty-3.1.14/libs/plugins/function.html_radios.php b/lib/classes/Smarty-3.1.15/libs/plugins/function.html_radios.php similarity index 95% rename from lib/classes/Smarty-3.1.14/libs/plugins/function.html_radios.php rename to lib/classes/Smarty-3.1.15/libs/plugins/function.html_radios.php index a2741f68..16606ebf 100644 --- a/lib/classes/Smarty-3.1.14/libs/plugins/function.html_radios.php +++ b/lib/classes/Smarty-3.1.15/libs/plugins/function.html_radios.php @@ -1,14 +1,14 @@ * Type: function * Name: html_radios @@ -31,15 +31,15 @@ * {html_radios values=$ids name='box' separator='' output=$names} * {html_radios values=$ids checked=$checked separator='' output=$names} * - * + * * @link http://smarty.php.net/manual/en/language.function.html.radios.php {html_radios} * (Smarty online manual) - * @author Christopher Kvarme - * @author credits to Monte Ohrt + * @author Christopher Kvarme + * @author credits to Monte Ohrt * @version 1.0 * @param array $params parameters * @param Smarty_Internal_Template $template template object - * @return string + * @return string * @uses smarty_function_escape_special_chars() */ function smarty_function_html_radios($params, $template) @@ -57,7 +57,7 @@ function smarty_function_html_radios($params, $template) $output = null; $extra = ''; - foreach($params as $_key => $_val) { + foreach ($params as $_key => $_val) { switch ($_key) { case 'name': case 'separator': @@ -76,7 +76,7 @@ function smarty_function_html_radios($params, $template) } } else { $selected = (string) $_val; - } + } break; case 'escape': @@ -124,13 +124,14 @@ function smarty_function_html_radios($params, $template) $extra .= ' ' . $_key . '="' . smarty_function_escape_special_chars($_val) . '"'; } else { trigger_error("html_radios: extra attribute '$_key' cannot be an array", E_USER_NOTICE); - } + } break; - } - } + } + } if (!isset($options) && !isset($values)) { /* raise error here? */ + return ''; } @@ -144,57 +145,59 @@ function smarty_function_html_radios($params, $template) foreach ($values as $_i => $_key) { $_val = isset($output[$_i]) ? $output[$_i] : ''; $_html_result[] = smarty_function_html_radios_output($name, $_key, $_val, $selected, $extra, $separator, $labels, $label_ids, $escape); - } - } + } + } if (!empty($params['assign'])) { $template->assign($params['assign'], $_html_result); } else { return implode("\n", $_html_result); - } -} + } +} function smarty_function_html_radios_output($name, $value, $output, $selected, $extra, $separator, $labels, $label_ids, $escape) { $_output = ''; - + if (is_object($value)) { if (method_exists($value, "__toString")) { $value = (string) $value->__toString(); } else { trigger_error("html_options: value is an object of class '". get_class($value) ."' without __toString() method", E_USER_NOTICE); + return ''; } } else { $value = (string) $value; } - + if (is_object($output)) { if (method_exists($output, "__toString")) { $output = (string) $output->__toString(); } else { trigger_error("html_options: output is an object of class '". get_class($output) ."' without __toString() method", E_USER_NOTICE); + return ''; } } else { $output = (string) $output; } - + if ($labels) { if ($label_ids) { $_id = smarty_function_escape_special_chars(preg_replace('![^\w\-\.]!' . Smarty::$_UTF8_MODIFIER, '_', $name . '_' . $value)); $_output .= ''; } else { $_output .= ''; - } + } } - + $name = smarty_function_escape_special_chars($name); $value = smarty_function_escape_special_chars($value); if ($escape) { $output = smarty_function_escape_special_chars($output); } - + $_output .= '' . $output; if ($labels) { $_output .= ''; } - - $_output .= $separator; - return $_output; -} -?> \ No newline at end of file + $_output .= $separator; + + return $_output; +} diff --git a/lib/classes/Smarty-3.1.14/libs/plugins/function.html_select_date.php b/lib/classes/Smarty-3.1.15/libs/plugins/function.html_select_date.php similarity index 93% rename from lib/classes/Smarty-3.1.14/libs/plugins/function.html_select_date.php rename to lib/classes/Smarty-3.1.15/libs/plugins/function.html_select_date.php index 13c50035..b1bfee2b 100644 --- a/lib/classes/Smarty-3.1.14/libs/plugins/function.html_select_date.php +++ b/lib/classes/Smarty-3.1.15/libs/plugins/function.html_select_date.php @@ -1,7 +1,7 @@ * Name: html_select_date * Purpose: Prints the dropdowns for date selection. - * + * * ChangeLog: * * - 1.0 initial release @@ -37,19 +37,19 @@ require_once(SMARTY_PLUGINS_DIR . 'shared.make_timestamp.php'); * dropdown to include given date unless explicitly set (Monte) * - 1.3.4 fix behaviour of 0000-00-00 00:00:00 dates to match that * of 0000-00-00 dates (cybot, boots) - * - 2.0 complete rewrite for performance, + * - 2.0 complete rewrite for performance, * added attributes month_names, *_id * - * + * * @link http://www.smarty.net/manual/en/language.function.html.select.date.php {html_select_date} * (Smarty online manual) * @version 2.0 - * @author Andrei Zmievski - * @author Monte Ohrt + * @author Andrei Zmievski + * @author Monte Ohrt * @author Rodney Rehm * @param array $params parameters * @param Smarty_Internal_Template $template template object - * @return string + * @return string */ function smarty_function_html_select_date($params, $template) { @@ -120,7 +120,7 @@ function smarty_function_html_select_date($params, $template) $time = smarty_make_timestamp($_value); } break; - + case 'month_names': if (is_array($_value) && count($_value) == 12) { $$_key = $_value; @@ -128,7 +128,7 @@ function smarty_function_html_select_date($params, $template) trigger_error("html_select_date: month_names must be an array of 12 strings", E_USER_NOTICE); } break; - + case 'prefix': case 'field_array': case 'start_year': @@ -155,7 +155,7 @@ function smarty_function_html_select_date($params, $template) case 'month_id': case 'day_id': case 'year_id': - $$_key = (string)$_value; + $$_key = (string) $_value; break; case 'display_days': @@ -163,7 +163,7 @@ function smarty_function_html_select_date($params, $template) case 'display_years': case 'year_as_text': case 'reverse_years': - $$_key = (bool)$_value; + $$_key = (bool) $_value; break; default: @@ -171,11 +171,11 @@ function smarty_function_html_select_date($params, $template) $extra_attrs .= ' ' . $_key . '="' . smarty_function_escape_special_chars($_value) . '"'; } else { trigger_error("html_select_date: extra attribute '$_key' cannot be an array", E_USER_NOTICE); - } + } break; - } + } } - + // Note: date() is faster than strftime() // Note: explode(date()) is faster than date() date() date() if (isset($params['time']) && is_array($params['time'])) { @@ -217,13 +217,13 @@ function smarty_function_html_select_date($params, $template) $key .= '_year'; $t = $$key; if ($t === null) { - $$key = (int)$_current_year; - } else if ($t[0] == '+') { - $$key = (int)($_current_year + trim(substr($t, 1))); - } else if ($t[0] == '-') { - $$key = (int)($_current_year - trim(substr($t, 1))); + $$key = (int) $_current_year; + } elseif ($t[0] == '+') { + $$key = (int) ($_current_year + trim(substr($t, 1))); + } elseif ($t[0] == '-') { + $$key = (int) ($_current_year - trim(substr($t, 1))); } else { - $$key = (int)$$key; + $$key = (int) $$key; } } @@ -241,40 +241,40 @@ function smarty_function_html_select_date($params, $template) $_name = $field_array ? ($field_array . '[' . $prefix . 'Year]') : ($prefix . 'Year'); if ($all_extra) { $_extra .= ' ' . $all_extra; - } + } if ($year_extra) { $_extra .= ' ' . $year_extra; } - + if ($year_as_text) { $_html_years = ''; } else { $_html_years = '' . $option_separator; - + if (isset($year_empty) || isset($all_empty)) { $_html_years .= '' . ( isset($year_empty) ? $year_empty : $all_empty ) . '' . $option_separator; } - + $op = $start_year > $end_year ? -1 : 1; for ($i=$start_year; $op > 0 ? $i <= $end_year : $i >= $end_year; $i += $op) { $_html_years .= '' . $i . '' . $option_separator; } - + $_html_years .= ''; } } - + // generate month or if ($display_months) { $_html_month = ''; @@ -282,26 +282,26 @@ function smarty_function_html_select_date($params, $template) $_name = $field_array ? ($field_array . '[' . $prefix . 'Month]') : ($prefix . 'Month'); if ($all_extra) { $_extra .= ' ' . $all_extra; - } + } if ($month_extra) { $_extra .= ' ' . $month_extra; } - + $_html_months = '' . $option_separator; - + if (isset($month_empty) || isset($all_empty)) { $_html_months .= '' . ( isset($month_empty) ? $month_empty : $all_empty ) . '' . $option_separator; } - + for ($i = 1; $i <= 12; $i++) { $_val = sprintf('%02d', $i); $_text = isset($month_names) ? smarty_function_escape_special_chars($month_names[$i]) : ($month_format == "%m" ? $_val : strftime($month_format, $_month_timestamps[$i])); @@ -310,10 +310,10 @@ function smarty_function_html_select_date($params, $template) . ($_val == $_month ? ' selected="selected"' : '') . '>' . $_text . '' . $option_separator; } - + $_html_months .= ''; } - + // generate day or if ($display_days) { $_html_day = ''; @@ -321,26 +321,26 @@ function smarty_function_html_select_date($params, $template) $_name = $field_array ? ($field_array . '[' . $prefix . 'Day]') : ($prefix . 'Day'); if ($all_extra) { $_extra .= ' ' . $all_extra; - } + } if ($day_extra) { $_extra .= ' ' . $day_extra; } - + $_html_days = '' . $option_separator; - + if (isset($day_empty) || isset($all_empty)) { $_html_days .= '' . ( isset($day_empty) ? $day_empty : $all_empty ) . '' . $option_separator; } - + for ($i = 1; $i <= 31; $i++) { $_val = sprintf('%02d', $i); $_text = $day_format == '%02d' ? $_val : sprintf($day_format, $i); @@ -349,7 +349,7 @@ function smarty_function_html_select_date($params, $template) . ($_val == $_day ? ' selected="selected"' : '') . '>' . $_text . '' . $option_separator; } - + $_html_days .= ''; } @@ -366,7 +366,7 @@ function smarty_function_html_select_date($params, $template) $_html .= $_html_years; } break; - + case 'm': case 'M': if (isset($_html_months)) { @@ -376,7 +376,7 @@ function smarty_function_html_select_date($params, $template) $_html .= $_html_months; } break; - + case 'd': case 'D': if (isset($_html_days)) { @@ -388,7 +388,6 @@ function smarty_function_html_select_date($params, $template) break; } } + return $_html; } - -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.14/libs/plugins/function.html_select_time.php b/lib/classes/Smarty-3.1.15/libs/plugins/function.html_select_time.php similarity index 97% rename from lib/classes/Smarty-3.1.14/libs/plugins/function.html_select_time.php rename to lib/classes/Smarty-3.1.15/libs/plugins/function.html_select_time.php index 9fb8038e..9e7f9117 100644 --- a/lib/classes/Smarty-3.1.14/libs/plugins/function.html_select_time.php +++ b/lib/classes/Smarty-3.1.15/libs/plugins/function.html_select_time.php @@ -117,7 +117,7 @@ function smarty_function_html_select_time($params, $template) case 'minute_value_format': case 'second_format': case 'second_value_format': - $$_key = (string)$_value; + $$_key = (string) $_value; break; case 'display_hours': @@ -125,7 +125,7 @@ function smarty_function_html_select_time($params, $template) case 'display_seconds': case 'display_meridian': case 'use_24_hours': - $$_key = (bool)$_value; + $$_key = (bool) $_value; break; case 'minute_interval': @@ -135,7 +135,7 @@ function smarty_function_html_select_time($params, $template) case 'minute_size': case 'second_size': case 'meridian_size': - $$_key = (int)$_value; + $$_key = (int) $_value; break; default: @@ -345,7 +345,7 @@ function smarty_function_html_select_time($params, $template) $_html_meridian .= '' . ( isset($meridian_empty) ? $meridian_empty : $all_empty ) . '' . $option_separator; } - $_html_meridian .= 'AM' . $option_separator + $_html_meridian .= ' 0 && $_hour < 12 ? ' selected="selected"' : '') .'>AM' . $option_separator . 'PM' . $option_separator . ''; } @@ -362,5 +362,3 @@ function smarty_function_html_select_time($params, $template) return $_html; } - -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.14/libs/plugins/function.html_table.php b/lib/classes/Smarty-3.1.15/libs/plugins/function.html_table.php similarity index 96% rename from lib/classes/Smarty-3.1.14/libs/plugins/function.html_table.php rename to lib/classes/Smarty-3.1.15/libs/plugins/function.html_table.php index 6b9cb9d1..275f6c24 100644 --- a/lib/classes/Smarty-3.1.14/libs/plugins/function.html_table.php +++ b/lib/classes/Smarty-3.1.15/libs/plugins/function.html_table.php @@ -64,13 +64,14 @@ function smarty_function_html_table($params, $template) if (!isset($params['loop'])) { trigger_error("html_table: missing 'loop' parameter",E_USER_WARNING); + return; } foreach ($params as $_key => $_value) { switch ($_key) { case 'loop': - $$_key = (array)$_value; + $$_key = (array) $_value; break; case 'cols': @@ -81,14 +82,14 @@ function smarty_function_html_table($params, $template) $cols = explode(',', $_value); $cols_count = count($cols); } elseif (!empty($_value)) { - $cols_count = (int)$_value; + $cols_count = (int) $_value; } else { $cols_count = $cols; } break; case 'rows': - $$_key = (int)$_value; + $$_key = (int) $_value; break; case 'table_attr': @@ -97,7 +98,7 @@ function smarty_function_html_table($params, $template) case 'vdir': case 'inner': case 'caption': - $$_key = (string)$_value; + $$_key = (string) $_value; break; case 'tr_attr': @@ -173,5 +174,3 @@ function smarty_function_html_table_cycle($name, $var, $no) return ($ret) ? ' ' . $ret : ''; } - -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.14/libs/plugins/function.mailto.php b/lib/classes/Smarty-3.1.15/libs/plugins/function.mailto.php similarity index 98% rename from lib/classes/Smarty-3.1.14/libs/plugins/function.mailto.php rename to lib/classes/Smarty-3.1.15/libs/plugins/function.mailto.php index 55d5c060..ac94ae04 100644 --- a/lib/classes/Smarty-3.1.14/libs/plugins/function.mailto.php +++ b/lib/classes/Smarty-3.1.15/libs/plugins/function.mailto.php @@ -55,6 +55,7 @@ function smarty_function_mailto($params, $template) if (empty($params['address'])) { trigger_error("mailto: missing 'address' parameter",E_USER_WARNING); + return; } else { $address = $params['address']; @@ -91,10 +92,11 @@ function smarty_function_mailto($params, $template) if ($mail_parms) { $address .= '?' . join('&', $mail_parms); } - + $encode = (empty($params['encode'])) ? 'none' : $params['encode']; if (!isset($_allowed_encoding[$encode])) { trigger_error("mailto: 'encode' parameter must be none, javascript, javascript_charcode or hex", E_USER_WARNING); + return; } // FIXME: (rodneyrehm) document.write() excues me what? 1998 has passed! @@ -110,7 +112,7 @@ function smarty_function_mailto($params, $template) } elseif ($encode == 'javascript_charcode') { $string = '' . $text . ''; - for($x = 0, $y = strlen($string); $x < $y; $x++) { + for ($x = 0, $y = strlen($string); $x < $y; $x++) { $ord[] = ord($string[$x]); } @@ -126,6 +128,7 @@ function smarty_function_mailto($params, $template) preg_match('!^(.*)(\?.*)$!', $address, $match); if (!empty($match[2])) { trigger_error("mailto: hex encoding does not work with extra attributes. Try javascript.",E_USER_WARNING); + return; } $address_encode = ''; @@ -142,11 +145,10 @@ function smarty_function_mailto($params, $template) } $mailto = "mailto:"; + return '' . $text_encode . ''; } else { // no encoding return '' . $text . ''; } } - -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.14/libs/plugins/function.math.php b/lib/classes/Smarty-3.1.15/libs/plugins/function.math.php similarity index 95% rename from lib/classes/Smarty-3.1.14/libs/plugins/function.math.php rename to lib/classes/Smarty-3.1.15/libs/plugins/function.math.php index f4d3f05e..7bcc8acf 100644 --- a/lib/classes/Smarty-3.1.14/libs/plugins/function.math.php +++ b/lib/classes/Smarty-3.1.15/libs/plugins/function.math.php @@ -31,6 +31,7 @@ function smarty_function_math($params, $template) // be sure equation parameter is present if (empty($params['equation'])) { trigger_error("math: missing equation parameter",E_USER_WARNING); + return; } @@ -39,28 +40,32 @@ function smarty_function_math($params, $template) // make sure parenthesis are balanced if (substr_count($equation,"(") != substr_count($equation,")")) { trigger_error("math: unbalanced parenthesis",E_USER_WARNING); + return; } // match all vars in equation, make sure all are passed preg_match_all("!(?:0x[a-fA-F0-9]+)|([a-zA-Z][a-zA-Z0-9_]*)!",$equation, $match); - foreach($match[1] as $curr_var) { + foreach ($match[1] as $curr_var) { if ($curr_var && !isset($params[$curr_var]) && !isset($_allowed_funcs[$curr_var])) { trigger_error("math: function call $curr_var not allowed",E_USER_WARNING); + return; } } - foreach($params as $key => $val) { + foreach ($params as $key => $val) { if ($key != "equation" && $key != "format" && $key != "assign") { // make sure value is not empty if (strlen($val)==0) { trigger_error("math: parameter $key is empty",E_USER_WARNING); + return; } if (!is_numeric($val)) { trigger_error("math: parameter $key: is not numeric",E_USER_WARNING); + return; } $equation = preg_replace("/\b$key\b/", " \$params['$key'] ", $equation); @@ -76,12 +81,10 @@ function smarty_function_math($params, $template) $template->assign($params['assign'],$smarty_math_result); } } else { - if (empty($params['assign'])){ + if (empty($params['assign'])) { printf($params['format'],$smarty_math_result); } else { $template->assign($params['assign'],sprintf($params['format'],$smarty_math_result)); } } } - -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.14/libs/plugins/modifier.capitalize.php b/lib/classes/Smarty-3.1.15/libs/plugins/modifier.capitalize.php similarity index 93% rename from lib/classes/Smarty-3.1.14/libs/plugins/modifier.capitalize.php rename to lib/classes/Smarty-3.1.15/libs/plugins/modifier.capitalize.php index 580e3d5c..b3036b86 100644 --- a/lib/classes/Smarty-3.1.14/libs/plugins/modifier.capitalize.php +++ b/lib/classes/Smarty-3.1.15/libs/plugins/modifier.capitalize.php @@ -1,14 +1,14 @@ * Name: capitalize * Purpose: capitalize words in the string @@ -19,7 +19,7 @@ * @param boolean $uc_digits also capitalize "x123" to "X123" * @param boolean $lc_rest capitalize first letters, lowercase all following letters "aAa" to "Aaa" * @return string capitalized string - * @author Monte Ohrt + * @author Monte Ohrt * @author Rodney Rehm */ function smarty_modifier_capitalize($string, $uc_digits = false, $lc_rest = false) @@ -35,31 +35,31 @@ function smarty_modifier_capitalize($string, $uc_digits = false, $lc_rest = fals // check uc_digits case if (!$uc_digits) { if (preg_match_all("!\b([\p{L}]*[\p{N}]+[\p{L}]*)\b!" . Smarty::$_UTF8_MODIFIER, $string, $matches, PREG_OFFSET_CAPTURE)) { - foreach($matches[1] as $match) { + foreach ($matches[1] as $match) { $upper_string = substr_replace($upper_string, mb_strtolower($match[0], Smarty::$_CHARSET), $match[1], strlen($match[0])); } - } + } } $upper_string = preg_replace_callback("!((^|\s)['\"])(\w)!" . Smarty::$_UTF8_MODIFIER, create_function ('$matches', 'return stripslashes($matches[1]).mb_convert_case(stripslashes($matches[3]),MB_CASE_UPPER, "' . addslashes(Smarty::$_CHARSET) . '");'), $upper_string); + return $upper_string; } - + // lowercase first if ($lc_rest) { $string = strtolower($string); } // uppercase (including hyphenated words) - $upper_string = preg_replace_callback("!(^|[^\p{L}'])([\p{Ll}])!S" . Smarty::$_UTF8_MODIFIER, create_function ('$matches', 'return stripslashes($matches[1]).ucfirst(stripslashes($matches[2]));'), $string); + $upper_string = preg_replace_callback("!(^|[^\p{L}'])([\p{Ll}])!S" . Smarty::$_UTF8_MODIFIER, create_function ('$matches', 'return stripslashes($matches[1]).ucfirst(stripslashes($matches[2]));'), $string); // check uc_digits case if (!$uc_digits) { if (preg_match_all("!\b([\p{L}]*[\p{N}]+[\p{L}]*)\b!" . Smarty::$_UTF8_MODIFIER, $string, $matches, PREG_OFFSET_CAPTURE)) { - foreach($matches[1] as $match) { + foreach ($matches[1] as $match) { $upper_string = substr_replace($upper_string, strtolower($match[0]), $match[1], strlen($match[0])); } - } + } } $upper_string = preg_replace_callback("!((^|\s)['\"])(\w)!" . Smarty::$_UTF8_MODIFIER, create_function ('$matches', 'return stripslashes($matches[1]).ucfirst(stripslashes($matches[3]));'), $upper_string); - return $upper_string; -} -?> \ No newline at end of file + return $upper_string; +} diff --git a/lib/classes/Smarty-3.1.14/libs/plugins/modifier.date_format.php b/lib/classes/Smarty-3.1.15/libs/plugins/modifier.date_format.php similarity index 91% rename from lib/classes/Smarty-3.1.14/libs/plugins/modifier.date_format.php rename to lib/classes/Smarty-3.1.15/libs/plugins/modifier.date_format.php index f3eaba05..e1a9d33e 100644 --- a/lib/classes/Smarty-3.1.14/libs/plugins/modifier.date_format.php +++ b/lib/classes/Smarty-3.1.15/libs/plugins/modifier.date_format.php @@ -1,14 +1,14 @@ * Name: date_format * Purpose: format datestamps via strftime @@ -16,9 +16,9 @@ * - string: input date string * - format: strftime format for output * - default_date: default date if $string is empty - * + * * @link http://www.smarty.net/manual/en/language.modifier.date.format.php date_format (Smarty online manual) - * @author Monte Ohrt + * @author Monte Ohrt * @param string $string input date string * @param string $format strftime format for output * @param string $default_date default date if $string is empty @@ -41,25 +41,24 @@ function smarty_modifier_date_format($string, $format=null, $default_date='', $f $timestamp = smarty_make_timestamp($default_date); } else { return; - } - if($formatter=='strftime'||($formatter=='auto'&&strpos($format,'%')!==false)) { + } + if ($formatter=='strftime'||($formatter=='auto'&&strpos($format,'%')!==false)) { if (DS == '\\') { $_win_from = array('%D', '%h', '%n', '%r', '%R', '%t', '%T'); $_win_to = array('%m/%d/%y', '%b', "\n", '%I:%M:%S %p', '%H:%M', "\t", '%H:%M:%S'); if (strpos($format, '%e') !== false) { $_win_from[] = '%e'; $_win_to[] = sprintf('%\' 2d', date('j', $timestamp)); - } + } if (strpos($format, '%l') !== false) { $_win_from[] = '%l'; $_win_to[] = sprintf('%\' 2d', date('h', $timestamp)); - } + } $format = str_replace($_win_from, $_win_to, $format); - } + } + return strftime($format, $timestamp); } else { return date($format, $timestamp); } -} - -?> \ No newline at end of file +} diff --git a/lib/classes/Smarty-3.1.14/libs/plugins/modifier.debug_print_var.php b/lib/classes/Smarty-3.1.15/libs/plugins/modifier.debug_print_var.php similarity index 93% rename from lib/classes/Smarty-3.1.14/libs/plugins/modifier.debug_print_var.php rename to lib/classes/Smarty-3.1.15/libs/plugins/modifier.debug_print_var.php index fa44100e..ea63c8a7 100644 --- a/lib/classes/Smarty-3.1.14/libs/plugins/modifier.debug_print_var.php +++ b/lib/classes/Smarty-3.1.15/libs/plugins/modifier.debug_print_var.php @@ -1,23 +1,23 @@ * Name: debug_print_var * Purpose: formats variable contents for display in the console * - * @author Monte Ohrt + * @author Monte Ohrt * @param array|object $var variable to be formatted * @param integer $depth maximum recursion depth if $var is an array * @param integer $length maximum string length if $var is a string - * @return string + * @return string */ function smarty_modifier_debug_print_var ($var, $depth = 0, $length = 40) { @@ -34,9 +34,9 @@ function smarty_modifier_debug_print_var ($var, $depth = 0, $length = 40) . '' . strtr($curr_key, $_replace) . ' => ' . smarty_modifier_debug_print_var($curr_val, ++$depth, $length); $depth--; - } + } break; - + case 'object' : $object_vars = get_object_vars($var); $results = '' . get_class($var) . ' Object (' . count($object_vars) . ')'; @@ -45,9 +45,9 @@ function smarty_modifier_debug_print_var ($var, $depth = 0, $length = 40) . ' ->' . strtr($curr_key, $_replace) . ' = ' . smarty_modifier_debug_print_var($curr_val, ++$depth, $length); $depth--; - } + } break; - + case 'boolean' : case 'NULL' : case 'resource' : @@ -59,15 +59,15 @@ function smarty_modifier_debug_print_var ($var, $depth = 0, $length = 40) $results = 'null'; } else { $results = htmlspecialchars((string) $var); - } + } $results = '' . $results . ''; break; - + case 'integer' : case 'float' : $results = htmlspecialchars((string) $var); break; - + case 'string' : $results = strtr($var, $_replace); if (Smarty::$_MBSTRING) { @@ -82,7 +82,7 @@ function smarty_modifier_debug_print_var ($var, $depth = 0, $length = 40) $results = htmlspecialchars('"' . $results . '"'); break; - + case 'unknown type' : default : $results = strtr((string) $var, $_replace); @@ -95,11 +95,9 @@ function smarty_modifier_debug_print_var ($var, $depth = 0, $length = 40) $results = substr($results, 0, $length - 3) . '...'; } } - + $results = htmlspecialchars($results); - } + } return $results; -} - -?> \ No newline at end of file +} diff --git a/lib/classes/Smarty-3.1.14/libs/plugins/modifier.escape.php b/lib/classes/Smarty-3.1.15/libs/plugins/modifier.escape.php similarity index 99% rename from lib/classes/Smarty-3.1.14/libs/plugins/modifier.escape.php rename to lib/classes/Smarty-3.1.15/libs/plugins/modifier.escape.php index 5ca8e779..bc8ad42a 100644 --- a/lib/classes/Smarty-3.1.14/libs/plugins/modifier.escape.php +++ b/lib/classes/Smarty-3.1.15/libs/plugins/modifier.escape.php @@ -27,7 +27,7 @@ function smarty_modifier_escape($string, $esc_type = 'html', $char_set = null, $ if ($_double_encode === null) { $_double_encode = version_compare(PHP_VERSION, '5.2.3', '>='); } - + if (!$char_set) { $char_set = Smarty::$_CHARSET; } @@ -46,6 +46,7 @@ function smarty_modifier_escape($string, $esc_type = 'html', $char_set = null, $ $string = preg_replace('!&(#?\w+);!', '%%%SMARTY_START%%%\\1%%%SMARTY_END%%%', $string); $string = htmlspecialchars($string, ENT_QUOTES, $char_set); $string = str_replace(array('%%%SMARTY_START%%%', '%%%SMARTY_END%%%'), array('&', ';'), $string); + return $string; } } @@ -65,10 +66,11 @@ function smarty_modifier_escape($string, $esc_type = 'html', $char_set = null, $ $string = preg_replace('!&(#?\w+);!', '%%%SMARTY_START%%%\\1%%%SMARTY_END%%%', $string); $string = htmlspecialchars($string, ENT_QUOTES, $char_set); $string = str_replace(array('%%%SMARTY_START%%%', '%%%SMARTY_END%%%'), array('&', ';'), $string); + return $string; } } - + // htmlentities() won't convert everything, so use mb_convert_encoding return mb_convert_encoding($string, 'HTML-ENTITIES', $char_set); } @@ -83,6 +85,7 @@ function smarty_modifier_escape($string, $esc_type = 'html', $char_set = null, $ $string = preg_replace('!&(#?\w+);!', '%%%SMARTY_START%%%\\1%%%SMARTY_END%%%', $string); $string = htmlentities($string, ENT_QUOTES, $char_set); $string = str_replace(array('%%%SMARTY_START%%%', '%%%SMARTY_END%%%'), array('&', ';'), $string); + return $string; } } @@ -105,6 +108,7 @@ function smarty_modifier_escape($string, $esc_type = 'html', $char_set = null, $ for ($x = 0; $x < $_length; $x++) { $return .= '%' . bin2hex($string[$x]); } + return $return; case 'hexentity': @@ -115,6 +119,7 @@ function smarty_modifier_escape($string, $esc_type = 'html', $char_set = null, $ foreach (smarty_mb_to_unicode($string, Smarty::$_CHARSET) as $unicode) { $return .= '' . strtoupper(dechex($unicode)) . ';'; } + return $return; } // no MBString fallback @@ -122,6 +127,7 @@ function smarty_modifier_escape($string, $esc_type = 'html', $char_set = null, $ for ($x = 0; $x < $_length; $x++) { $return .= '' . bin2hex($string[$x]) . ';'; } + return $return; case 'decentity': @@ -132,6 +138,7 @@ function smarty_modifier_escape($string, $esc_type = 'html', $char_set = null, $ foreach (smarty_mb_to_unicode($string, Smarty::$_CHARSET) as $unicode) { $return .= '' . $unicode . ';'; } + return $return; } // no MBString fallback @@ -139,6 +146,7 @@ function smarty_modifier_escape($string, $esc_type = 'html', $char_set = null, $ for ($x = 0; $x < $_length; $x++) { $return .= '' . ord($string[$x]) . ';'; } + return $return; case 'javascript': @@ -148,6 +156,7 @@ function smarty_modifier_escape($string, $esc_type = 'html', $char_set = null, $ case 'mail': if (Smarty::$_MBSTRING) { require_once(SMARTY_PLUGINS_DIR . 'shared.mb_str_replace.php'); + return smarty_mb_str_replace(array('@', '.'), array(' [AT] ', ' [DOT] '), $string); } // no MBString fallback @@ -165,6 +174,7 @@ function smarty_modifier_escape($string, $esc_type = 'html', $char_set = null, $ $return .= chr($unicode); } } + return $return; } @@ -178,11 +188,10 @@ function smarty_modifier_escape($string, $esc_type = 'html', $char_set = null, $ $return .= substr($string, $_i, 1); } } + return $return; default: return $string; } } - -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.14/libs/plugins/modifier.regex_replace.php b/lib/classes/Smarty-3.1.15/libs/plugins/modifier.regex_replace.php similarity index 95% rename from lib/classes/Smarty-3.1.14/libs/plugins/modifier.regex_replace.php rename to lib/classes/Smarty-3.1.15/libs/plugins/modifier.regex_replace.php index f9fd5fa5..a44afb5f 100644 --- a/lib/classes/Smarty-3.1.14/libs/plugins/modifier.regex_replace.php +++ b/lib/classes/Smarty-3.1.15/libs/plugins/modifier.regex_replace.php @@ -23,13 +23,14 @@ */ function smarty_modifier_regex_replace($string, $search, $replace) { - if(is_array($search)) { - foreach($search as $idx => $s) { + if (is_array($search)) { + foreach ($search as $idx => $s) { $search[$idx] = _smarty_regex_replace_check($s); } } else { $search = _smarty_regex_replace_check($search); } + return preg_replace($search, $replace, $string); } @@ -49,7 +50,6 @@ function _smarty_regex_replace_check($search) if (preg_match('!([a-zA-Z\s]+)$!s', $search, $match) && (strpos($match[1], 'e') !== false)) { $search = substr($search, 0, -strlen($match[1])) . preg_replace('![e\s]+!', '', $match[1]); } + return $search; } - -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.14/libs/plugins/modifier.replace.php b/lib/classes/Smarty-3.1.15/libs/plugins/modifier.replace.php similarity index 87% rename from lib/classes/Smarty-3.1.14/libs/plugins/modifier.replace.php rename to lib/classes/Smarty-3.1.15/libs/plugins/modifier.replace.php index 4d71a6e9..cf4f6459 100644 --- a/lib/classes/Smarty-3.1.14/libs/plugins/modifier.replace.php +++ b/lib/classes/Smarty-3.1.15/libs/plugins/modifier.replace.php @@ -7,27 +7,26 @@ /** * Smarty replace modifier plugin - * + * * Type: modifier * Name: replace * Purpose: simple search/replace - * + * * @link http://smarty.php.net/manual/en/language.modifier.replace.php replace (Smarty online manual) - * @author Monte Ohrt - * @author Uwe Tews + * @author Monte Ohrt + * @author Uwe Tews * @param string $string input string * @param string $search text to search for * @param string $replace replacement text - * @return string + * @return string */ function smarty_modifier_replace($string, $search, $replace) { if (Smarty::$_MBSTRING) { require_once(SMARTY_PLUGINS_DIR . 'shared.mb_str_replace.php'); + return smarty_mb_str_replace($search, $replace, $string); } - - return str_replace($search, $replace, $string); -} -?> \ No newline at end of file + return str_replace($search, $replace, $string); +} diff --git a/lib/classes/Smarty-3.1.14/libs/plugins/modifier.spacify.php b/lib/classes/Smarty-3.1.15/libs/plugins/modifier.spacify.php similarity index 91% rename from lib/classes/Smarty-3.1.14/libs/plugins/modifier.spacify.php rename to lib/classes/Smarty-3.1.15/libs/plugins/modifier.spacify.php index a907232f..1a5f425a 100644 --- a/lib/classes/Smarty-3.1.14/libs/plugins/modifier.spacify.php +++ b/lib/classes/Smarty-3.1.15/libs/plugins/modifier.spacify.php @@ -7,13 +7,13 @@ /** * Smarty spacify modifier plugin - * + * * Type: modifier * Name: spacify * Purpose: add spaces between characters in a string - * + * * @link http://smarty.php.net/manual/en/language.modifier.spacify.php spacify (Smarty online manual) - * @author Monte Ohrt + * @author Monte Ohrt * @param string $string input string * @param string $spacify_char string to insert between characters. * @return string @@ -22,6 +22,4 @@ function smarty_modifier_spacify($string, $spacify_char = ' ') { // well… what about charsets besides latin and UTF-8? return implode($spacify_char, preg_split('//' . Smarty::$_UTF8_MODIFIER, $string, -1, PREG_SPLIT_NO_EMPTY)); -} - -?> \ No newline at end of file +} diff --git a/lib/classes/Smarty-3.1.14/libs/plugins/modifier.truncate.php b/lib/classes/Smarty-3.1.15/libs/plugins/modifier.truncate.php similarity index 93% rename from lib/classes/Smarty-3.1.14/libs/plugins/modifier.truncate.php rename to lib/classes/Smarty-3.1.15/libs/plugins/modifier.truncate.php index 9a803ec9..e2810ed7 100644 --- a/lib/classes/Smarty-3.1.14/libs/plugins/modifier.truncate.php +++ b/lib/classes/Smarty-3.1.15/libs/plugins/modifier.truncate.php @@ -5,18 +5,18 @@ * @package Smarty * @subpackage PluginsModifier */ - + /** * Smarty truncate modifier plugin - * + * * Type: modifier * Name: truncate * Purpose: Truncate a string to a certain length if necessary, * optionally splitting in the middle of a word, and * appending the $etc string or inserting $etc into the middle. - * + * * @link http://smarty.php.net/manual/en/language.modifier.truncate.php truncate (Smarty online manual) - * @author Monte Ohrt + * @author Monte Ohrt * @param string $string input string * @param integer $length length of truncated text * @param string $etc end string @@ -24,7 +24,8 @@ * @param boolean $middle truncate in the middle of text * @return string truncated string */ -function smarty_modifier_truncate($string, $length = 80, $etc = '...', $break_words = false, $middle = false) { +function smarty_modifier_truncate($string, $length = 80, $etc = '...', $break_words = false, $middle = false) +{ if ($length == 0) return ''; @@ -33,27 +34,29 @@ function smarty_modifier_truncate($string, $length = 80, $etc = '...', $break_wo $length -= min($length, mb_strlen($etc, Smarty::$_CHARSET)); if (!$break_words && !$middle) { $string = preg_replace('/\s+?(\S+)?$/' . Smarty::$_UTF8_MODIFIER, '', mb_substr($string, 0, $length + 1, Smarty::$_CHARSET)); - } + } if (!$middle) { return mb_substr($string, 0, $length, Smarty::$_CHARSET) . $etc; } + return mb_substr($string, 0, $length / 2, Smarty::$_CHARSET) . $etc . mb_substr($string, - $length / 2, $length, Smarty::$_CHARSET); } + return $string; } - + // no MBString fallback if (isset($string[$length])) { $length -= min($length, strlen($etc)); if (!$break_words && !$middle) { $string = preg_replace('/\s+?(\S+)?$/', '', substr($string, 0, $length + 1)); - } + } if (!$middle) { return substr($string, 0, $length) . $etc; } + return substr($string, 0, $length / 2) . $etc . substr($string, - $length / 2); } - return $string; -} -?> \ No newline at end of file + return $string; +} diff --git a/lib/classes/Smarty-3.1.14/libs/plugins/modifiercompiler.cat.php b/lib/classes/Smarty-3.1.15/libs/plugins/modifiercompiler.cat.php similarity index 99% rename from lib/classes/Smarty-3.1.14/libs/plugins/modifiercompiler.cat.php rename to lib/classes/Smarty-3.1.15/libs/plugins/modifiercompiler.cat.php index 5049c63e..5dff7474 100644 --- a/lib/classes/Smarty-3.1.14/libs/plugins/modifiercompiler.cat.php +++ b/lib/classes/Smarty-3.1.15/libs/plugins/modifiercompiler.cat.php @@ -26,5 +26,3 @@ function smarty_modifiercompiler_cat($params, $compiler) { return '('.implode(').(', $params).')'; } - -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.14/libs/plugins/modifiercompiler.count_characters.php b/lib/classes/Smarty-3.1.15/libs/plugins/modifiercompiler.count_characters.php similarity index 99% rename from lib/classes/Smarty-3.1.14/libs/plugins/modifiercompiler.count_characters.php rename to lib/classes/Smarty-3.1.15/libs/plugins/modifiercompiler.count_characters.php index 0f269c9f..778d0385 100644 --- a/lib/classes/Smarty-3.1.14/libs/plugins/modifiercompiler.count_characters.php +++ b/lib/classes/Smarty-3.1.15/libs/plugins/modifiercompiler.count_characters.php @@ -29,5 +29,3 @@ function smarty_modifiercompiler_count_characters($params, $compiler) // no MBString fallback return 'strlen(' . $params[0] . ')'; } - -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.14/libs/plugins/modifiercompiler.count_paragraphs.php b/lib/classes/Smarty-3.1.15/libs/plugins/modifiercompiler.count_paragraphs.php similarity index 99% rename from lib/classes/Smarty-3.1.14/libs/plugins/modifiercompiler.count_paragraphs.php rename to lib/classes/Smarty-3.1.15/libs/plugins/modifiercompiler.count_paragraphs.php index 853f98f4..581d291c 100644 --- a/lib/classes/Smarty-3.1.14/libs/plugins/modifiercompiler.count_paragraphs.php +++ b/lib/classes/Smarty-3.1.15/libs/plugins/modifiercompiler.count_paragraphs.php @@ -24,5 +24,3 @@ function smarty_modifiercompiler_count_paragraphs($params, $compiler) // count \r or \n characters return '(preg_match_all(\'#[\r\n]+#\', ' . $params[0] . ', $tmp)+1)'; } - -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.14/libs/plugins/modifiercompiler.count_sentences.php b/lib/classes/Smarty-3.1.15/libs/plugins/modifiercompiler.count_sentences.php similarity index 99% rename from lib/classes/Smarty-3.1.14/libs/plugins/modifiercompiler.count_sentences.php rename to lib/classes/Smarty-3.1.15/libs/plugins/modifiercompiler.count_sentences.php index f8d79b3f..5cb0f2ae 100644 --- a/lib/classes/Smarty-3.1.14/libs/plugins/modifiercompiler.count_sentences.php +++ b/lib/classes/Smarty-3.1.15/libs/plugins/modifiercompiler.count_sentences.php @@ -24,5 +24,3 @@ function smarty_modifiercompiler_count_sentences($params, $compiler) // find periods, question marks, exclamation marks with a word before but not after. return 'preg_match_all("#\w[\.\?\!](\W|$)#S' . Smarty::$_UTF8_MODIFIER . '", ' . $params[0] . ', $tmp)'; } - -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.14/libs/plugins/modifiercompiler.count_words.php b/lib/classes/Smarty-3.1.15/libs/plugins/modifiercompiler.count_words.php similarity index 99% rename from lib/classes/Smarty-3.1.14/libs/plugins/modifiercompiler.count_words.php rename to lib/classes/Smarty-3.1.15/libs/plugins/modifiercompiler.count_words.php index f53443e2..9146900d 100644 --- a/lib/classes/Smarty-3.1.14/libs/plugins/modifiercompiler.count_words.php +++ b/lib/classes/Smarty-3.1.15/libs/plugins/modifiercompiler.count_words.php @@ -28,5 +28,3 @@ function smarty_modifiercompiler_count_words($params, $compiler) // no MBString fallback return 'str_word_count(' . $params[0] . ')'; } - -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.14/libs/plugins/modifiercompiler.default.php b/lib/classes/Smarty-3.1.15/libs/plugins/modifiercompiler.default.php similarity index 99% rename from lib/classes/Smarty-3.1.14/libs/plugins/modifiercompiler.default.php rename to lib/classes/Smarty-3.1.15/libs/plugins/modifiercompiler.default.php index 3554964e..83b3f365 100644 --- a/lib/classes/Smarty-3.1.14/libs/plugins/modifiercompiler.default.php +++ b/lib/classes/Smarty-3.1.15/libs/plugins/modifiercompiler.default.php @@ -24,12 +24,11 @@ function smarty_modifiercompiler_default ($params, $compiler) if (!isset($params[1])) { $params[1] = "''"; } - + array_shift($params); foreach ($params as $param) { $output = '(($tmp = @' . $output . ')===null||$tmp===\'\' ? ' . $param . ' : $tmp)'; } + return $output; } - -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.14/libs/plugins/modifiercompiler.escape.php b/lib/classes/Smarty-3.1.15/libs/plugins/modifiercompiler.escape.php similarity index 96% rename from lib/classes/Smarty-3.1.14/libs/plugins/modifiercompiler.escape.php rename to lib/classes/Smarty-3.1.15/libs/plugins/modifiercompiler.escape.php index c71a8b38..6c6a356a 100644 --- a/lib/classes/Smarty-3.1.14/libs/plugins/modifiercompiler.escape.php +++ b/lib/classes/Smarty-3.1.15/libs/plugins/modifiercompiler.escape.php @@ -29,7 +29,7 @@ function smarty_modifiercompiler_escape($params, $compiler) if ($_double_encode === null) { $_double_encode = version_compare(PHP_VERSION, '5.2.3', '>='); } - + try { $esc_type = smarty_literal_compiler_param($params, 1, 'html'); $char_set = smarty_literal_compiler_param($params, 2, Smarty::$_CHARSET); @@ -46,7 +46,7 @@ function smarty_modifiercompiler_escape($params, $compiler) . $params[0] .', ENT_QUOTES, ' . var_export($char_set, true) . ', ' . var_export($double_encode, true) . ')'; - } else if ($double_encode) { + } elseif ($double_encode) { return 'htmlspecialchars(' . $params[0] .', ENT_QUOTES, ' . var_export($char_set, true) . ')'; @@ -64,7 +64,7 @@ function smarty_modifiercompiler_escape($params, $compiler) . var_export($double_encode, true) . '), "HTML-ENTITIES", ' . var_export($char_set, true) . ')'; - } else if ($double_encode) { + } elseif ($double_encode) { // php <5.2.3 - only handle double encoding return 'mb_convert_encoding(htmlspecialchars(' . $params[0] .', ENT_QUOTES, ' @@ -83,7 +83,7 @@ function smarty_modifiercompiler_escape($params, $compiler) . $params[0] .', ENT_QUOTES, ' . var_export($char_set, true) . ', ' . var_export($double_encode, true) . ')'; - } else if ($double_encode) { + } elseif ($double_encode) { // php <5.2.3 - only handle double encoding return 'htmlentities(' . $params[0] .', ENT_QUOTES, ' @@ -107,7 +107,7 @@ function smarty_modifiercompiler_escape($params, $compiler) return 'strtr(' . $params[0] . ', array("\\\\" => "\\\\\\\\", "\'" => "\\\\\'", "\"" => "\\\\\"", "\\r" => "\\\\r", "\\n" => "\\\n", "" => "<\/" ))'; } - } catch(SmartyException $e) { + } catch (SmartyException $e) { // pass through to regular plugin fallback } @@ -119,7 +119,6 @@ function smarty_modifiercompiler_escape($params, $compiler) $compiler->template->required_plugins['compiled']['escape']['modifier']['file'] = SMARTY_PLUGINS_DIR .'modifier.escape.php'; $compiler->template->required_plugins['compiled']['escape']['modifier']['function'] = 'smarty_modifier_escape'; } + return 'smarty_modifier_escape(' . join( ', ', $params ) . ')'; } - -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.14/libs/plugins/modifiercompiler.from_charset.php b/lib/classes/Smarty-3.1.15/libs/plugins/modifiercompiler.from_charset.php similarity index 99% rename from lib/classes/Smarty-3.1.14/libs/plugins/modifiercompiler.from_charset.php rename to lib/classes/Smarty-3.1.15/libs/plugins/modifiercompiler.from_charset.php index 5d6b7889..1dfee367 100644 --- a/lib/classes/Smarty-3.1.14/libs/plugins/modifiercompiler.from_charset.php +++ b/lib/classes/Smarty-3.1.15/libs/plugins/modifiercompiler.from_charset.php @@ -30,5 +30,3 @@ function smarty_modifiercompiler_from_charset($params, $compiler) return 'mb_convert_encoding(' . $params[0] . ', "' . addslashes(Smarty::$_CHARSET) . '", ' . $params[1] . ')'; } - -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.14/libs/plugins/modifiercompiler.indent.php b/lib/classes/Smarty-3.1.15/libs/plugins/modifiercompiler.indent.php similarity index 99% rename from lib/classes/Smarty-3.1.14/libs/plugins/modifiercompiler.indent.php rename to lib/classes/Smarty-3.1.15/libs/plugins/modifiercompiler.indent.php index 26094b7c..85bc6105 100644 --- a/lib/classes/Smarty-3.1.14/libs/plugins/modifiercompiler.indent.php +++ b/lib/classes/Smarty-3.1.15/libs/plugins/modifiercompiler.indent.php @@ -26,7 +26,6 @@ function smarty_modifiercompiler_indent($params, $compiler) if (!isset($params[2])) { $params[2] = "' '"; } + return 'preg_replace(\'!^!m\',str_repeat(' . $params[2] . ',' . $params[1] . '),' . $params[0] . ')'; } - -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.14/libs/plugins/modifiercompiler.lower.php b/lib/classes/Smarty-3.1.15/libs/plugins/modifiercompiler.lower.php similarity index 99% rename from lib/classes/Smarty-3.1.14/libs/plugins/modifiercompiler.lower.php rename to lib/classes/Smarty-3.1.15/libs/plugins/modifiercompiler.lower.php index bc3abd72..b1a23186 100644 --- a/lib/classes/Smarty-3.1.14/libs/plugins/modifiercompiler.lower.php +++ b/lib/classes/Smarty-3.1.15/libs/plugins/modifiercompiler.lower.php @@ -27,5 +27,3 @@ function smarty_modifiercompiler_lower($params, $compiler) // no MBString fallback return 'strtolower(' . $params[0] . ')'; } - -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.14/libs/plugins/modifiercompiler.noprint.php b/lib/classes/Smarty-3.1.15/libs/plugins/modifiercompiler.noprint.php similarity index 99% rename from lib/classes/Smarty-3.1.14/libs/plugins/modifiercompiler.noprint.php rename to lib/classes/Smarty-3.1.15/libs/plugins/modifiercompiler.noprint.php index d7433e98..71f6bfae 100644 --- a/lib/classes/Smarty-3.1.14/libs/plugins/modifiercompiler.noprint.php +++ b/lib/classes/Smarty-3.1.15/libs/plugins/modifiercompiler.noprint.php @@ -21,5 +21,3 @@ function smarty_modifiercompiler_noprint($params, $compiler) { return "''"; } - -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.14/libs/plugins/modifiercompiler.string_format.php b/lib/classes/Smarty-3.1.15/libs/plugins/modifiercompiler.string_format.php similarity index 99% rename from lib/classes/Smarty-3.1.14/libs/plugins/modifiercompiler.string_format.php rename to lib/classes/Smarty-3.1.15/libs/plugins/modifiercompiler.string_format.php index 5a8d4357..defbf6e2 100644 --- a/lib/classes/Smarty-3.1.14/libs/plugins/modifiercompiler.string_format.php +++ b/lib/classes/Smarty-3.1.15/libs/plugins/modifiercompiler.string_format.php @@ -22,5 +22,3 @@ function smarty_modifiercompiler_string_format($params, $compiler) { return 'sprintf(' . $params[1] . ',' . $params[0] . ')'; } - -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.14/libs/plugins/modifiercompiler.strip.php b/lib/classes/Smarty-3.1.15/libs/plugins/modifiercompiler.strip.php similarity index 99% rename from lib/classes/Smarty-3.1.14/libs/plugins/modifiercompiler.strip.php rename to lib/classes/Smarty-3.1.15/libs/plugins/modifiercompiler.strip.php index 8d15ca43..6c732e81 100644 --- a/lib/classes/Smarty-3.1.14/libs/plugins/modifiercompiler.strip.php +++ b/lib/classes/Smarty-3.1.15/libs/plugins/modifiercompiler.strip.php @@ -27,7 +27,6 @@ function smarty_modifiercompiler_strip($params, $compiler) if (!isset($params[1])) { $params[1] = "' '"; } + return "preg_replace('!\s+!" . Smarty::$_UTF8_MODIFIER . "', {$params[1]},{$params[0]})"; } - -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.14/libs/plugins/modifiercompiler.strip_tags.php b/lib/classes/Smarty-3.1.15/libs/plugins/modifiercompiler.strip_tags.php similarity index 100% rename from lib/classes/Smarty-3.1.14/libs/plugins/modifiercompiler.strip_tags.php rename to lib/classes/Smarty-3.1.15/libs/plugins/modifiercompiler.strip_tags.php diff --git a/lib/classes/Smarty-3.1.14/libs/plugins/modifiercompiler.to_charset.php b/lib/classes/Smarty-3.1.15/libs/plugins/modifiercompiler.to_charset.php similarity index 99% rename from lib/classes/Smarty-3.1.14/libs/plugins/modifiercompiler.to_charset.php rename to lib/classes/Smarty-3.1.15/libs/plugins/modifiercompiler.to_charset.php index d6c0f296..af75779a 100644 --- a/lib/classes/Smarty-3.1.14/libs/plugins/modifiercompiler.to_charset.php +++ b/lib/classes/Smarty-3.1.15/libs/plugins/modifiercompiler.to_charset.php @@ -30,5 +30,3 @@ function smarty_modifiercompiler_to_charset($params, $compiler) return 'mb_convert_encoding(' . $params[0] . ', ' . $params[1] . ', "' . addslashes(Smarty::$_CHARSET) . '")'; } - -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.14/libs/plugins/modifiercompiler.unescape.php b/lib/classes/Smarty-3.1.15/libs/plugins/modifiercompiler.unescape.php similarity index 99% rename from lib/classes/Smarty-3.1.14/libs/plugins/modifiercompiler.unescape.php rename to lib/classes/Smarty-3.1.15/libs/plugins/modifiercompiler.unescape.php index 61354926..19474fcb 100644 --- a/lib/classes/Smarty-3.1.14/libs/plugins/modifiercompiler.unescape.php +++ b/lib/classes/Smarty-3.1.15/libs/plugins/modifiercompiler.unescape.php @@ -47,5 +47,3 @@ function smarty_modifiercompiler_unescape($params, $compiler) return $params[0]; } } - -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.14/libs/plugins/modifiercompiler.upper.php b/lib/classes/Smarty-3.1.15/libs/plugins/modifiercompiler.upper.php similarity index 94% rename from lib/classes/Smarty-3.1.14/libs/plugins/modifiercompiler.upper.php rename to lib/classes/Smarty-3.1.15/libs/plugins/modifiercompiler.upper.php index 8611fa87..f10ed187 100644 --- a/lib/classes/Smarty-3.1.14/libs/plugins/modifiercompiler.upper.php +++ b/lib/classes/Smarty-3.1.15/libs/plugins/modifiercompiler.upper.php @@ -8,13 +8,13 @@ /** * Smarty upper modifier plugin - * + * * Type: modifier * Name: lower * Purpose: convert string to uppercase - * + * * @link http://smarty.php.net/manual/en/language.modifier.upper.php lower (Smarty online manual) - * @author Uwe Tews + * @author Uwe Tews * @param array $params parameters * @return string with compiled code */ @@ -25,6 +25,4 @@ function smarty_modifiercompiler_upper($params, $compiler) } // no MBString fallback return 'strtoupper(' . $params[0] . ')'; -} - -?> \ No newline at end of file +} diff --git a/lib/classes/Smarty-3.1.14/libs/plugins/modifiercompiler.wordwrap.php b/lib/classes/Smarty-3.1.15/libs/plugins/modifiercompiler.wordwrap.php similarity index 96% rename from lib/classes/Smarty-3.1.14/libs/plugins/modifiercompiler.wordwrap.php rename to lib/classes/Smarty-3.1.15/libs/plugins/modifiercompiler.wordwrap.php index dc05c2a9..39312b41 100644 --- a/lib/classes/Smarty-3.1.14/libs/plugins/modifiercompiler.wordwrap.php +++ b/lib/classes/Smarty-3.1.15/libs/plugins/modifiercompiler.wordwrap.php @@ -8,13 +8,13 @@ /** * Smarty wordwrap modifier plugin - * + * * Type: modifier * Name: wordwrap * Purpose: wrap a string of text at a given length - * + * * @link http://smarty.php.net/manual/en/language.modifier.wordwrap.php wordwrap (Smarty online manual) - * @author Uwe Tews + * @author Uwe Tews * @param array $params parameters * @return string with compiled code */ @@ -22,13 +22,13 @@ function smarty_modifiercompiler_wordwrap($params, $compiler) { if (!isset($params[1])) { $params[1] = 80; - } + } if (!isset($params[2])) { $params[2] = '"\n"'; - } + } if (!isset($params[3])) { $params[3] = 'false'; - } + } $function = 'wordwrap'; if (Smarty::$_MBSTRING) { if ($compiler->template->caching && ($compiler->tag_nocache | $compiler->nocache)) { @@ -40,7 +40,6 @@ function smarty_modifiercompiler_wordwrap($params, $compiler) } $function = 'smarty_mb_wordwrap'; } - return $function . '(' . $params[0] . ',' . $params[1] . ',' . $params[2] . ',' . $params[3] . ')'; -} -?> \ No newline at end of file + return $function . '(' . $params[0] . ',' . $params[1] . ',' . $params[2] . ',' . $params[3] . ')'; +} diff --git a/lib/classes/Smarty-3.1.14/libs/plugins/outputfilter.trimwhitespace.php b/lib/classes/Smarty-3.1.15/libs/plugins/outputfilter.trimwhitespace.php similarity index 96% rename from lib/classes/Smarty-3.1.14/libs/plugins/outputfilter.trimwhitespace.php rename to lib/classes/Smarty-3.1.15/libs/plugins/outputfilter.trimwhitespace.php index ad4d6f6b..9da7f3db 100644 --- a/lib/classes/Smarty-3.1.14/libs/plugins/outputfilter.trimwhitespace.php +++ b/lib/classes/Smarty-3.1.15/libs/plugins/outputfilter.trimwhitespace.php @@ -74,13 +74,11 @@ function smarty_outputfilter_trimwhitespace($source, Smarty_Internal_Template $s // maybe a \0 byte or something is interfering? // $source = trim( $source ); - // capture html elements not to be messed with $_offset = 0; if (preg_match_all('#@!@SMARTY:([0-9]+):SMARTY@!@#is', $source, $matches, PREG_OFFSET_CAPTURE | PREG_SET_ORDER)) { foreach ($matches as $match) { - $store[] = $match[0][0]; $_length = strlen($match[0][0]); - $replace = array_shift($store); + $replace = $store[$match[1][0]]; $source = substr_replace($source, $replace, $match[0][1] + $_offset, $_length); $_offset += strlen($replace) - $_length; @@ -90,5 +88,3 @@ function smarty_outputfilter_trimwhitespace($source, Smarty_Internal_Template $s return $source; } - -?> diff --git a/lib/classes/Smarty-3.1.14/libs/plugins/shared.escape_special_chars.php b/lib/classes/Smarty-3.1.15/libs/plugins/shared.escape_special_chars.php similarity index 81% rename from lib/classes/Smarty-3.1.14/libs/plugins/shared.escape_special_chars.php rename to lib/classes/Smarty-3.1.15/libs/plugins/shared.escape_special_chars.php index d2609b67..95717605 100644 --- a/lib/classes/Smarty-3.1.14/libs/plugins/shared.escape_special_chars.php +++ b/lib/classes/Smarty-3.1.15/libs/plugins/shared.escape_special_chars.php @@ -15,7 +15,7 @@ if (version_compare(PHP_VERSION, '5.2.3', '>=')) { * special chars except for already escaped ones * * @author Monte Ohrt - * @param string $string text that should by escaped + * @param string $string text that should by escaped * @return string */ function smarty_function_escape_special_chars($string) @@ -23,9 +23,10 @@ if (version_compare(PHP_VERSION, '5.2.3', '>=')) { if (!is_array($string)) { $string = htmlspecialchars($string, ENT_COMPAT, Smarty::$_CHARSET, false); } + return $string; - } -} else { + } +} else { /** * escape_special_chars common function * @@ -34,7 +35,7 @@ if (version_compare(PHP_VERSION, '5.2.3', '>=')) { * special chars except for already escaped ones * * @author Monte Ohrt - * @param string $string text that should by escaped + * @param string $string text that should by escaped * @return string */ function smarty_function_escape_special_chars($string) @@ -42,10 +43,9 @@ if (version_compare(PHP_VERSION, '5.2.3', '>=')) { if (!is_array($string)) { $string = preg_replace('!&(#?\w+);!', '%%%SMARTY_START%%%\\1%%%SMARTY_END%%%', $string); $string = htmlspecialchars($string); - $string = str_replace(array('%%%SMARTY_START%%%', '%%%SMARTY_END%%%'), array('&', ';'), $string); + $string = str_replace(array('%%%SMARTY_START%%%', '%%%SMARTY_END%%%'), array('&', ';'), $string); } - return $string; - } -} -?> \ No newline at end of file + return $string; + } +} diff --git a/lib/classes/Smarty-3.1.14/libs/plugins/shared.literal_compiler_param.php b/lib/classes/Smarty-3.1.15/libs/plugins/shared.literal_compiler_param.php similarity index 99% rename from lib/classes/Smarty-3.1.14/libs/plugins/shared.literal_compiler_param.php rename to lib/classes/Smarty-3.1.15/libs/plugins/shared.literal_compiler_param.php index dbcd9374..1420a0e2 100644 --- a/lib/classes/Smarty-3.1.14/libs/plugins/shared.literal_compiler_param.php +++ b/lib/classes/Smarty-3.1.15/libs/plugins/shared.literal_compiler_param.php @@ -29,5 +29,6 @@ function smarty_literal_compiler_param($params, $index, $default=null) $t = null; eval("\$t = " . $params[$index] . ";"); + return $t; } diff --git a/lib/classes/Smarty-3.1.14/libs/plugins/shared.make_timestamp.php b/lib/classes/Smarty-3.1.15/libs/plugins/shared.make_timestamp.php similarity index 99% rename from lib/classes/Smarty-3.1.14/libs/plugins/shared.make_timestamp.php rename to lib/classes/Smarty-3.1.15/libs/plugins/shared.make_timestamp.php index 5d7c97e9..1400a15d 100644 --- a/lib/classes/Smarty-3.1.14/libs/plugins/shared.make_timestamp.php +++ b/lib/classes/Smarty-3.1.15/libs/plugins/shared.make_timestamp.php @@ -35,8 +35,7 @@ function smarty_make_timestamp($string) // strtotime() was not able to parse $string, use "now": return time(); } + return $time; } } - -?> diff --git a/lib/classes/Smarty-3.1.14/libs/plugins/shared.mb_str_replace.php b/lib/classes/Smarty-3.1.15/libs/plugins/shared.mb_str_replace.php similarity index 87% rename from lib/classes/Smarty-3.1.14/libs/plugins/shared.mb_str_replace.php rename to lib/classes/Smarty-3.1.15/libs/plugins/shared.mb_str_replace.php index ecafeb74..b2925c28 100644 --- a/lib/classes/Smarty-3.1.14/libs/plugins/shared.mb_str_replace.php +++ b/lib/classes/Smarty-3.1.15/libs/plugins/shared.mb_str_replace.php @@ -10,10 +10,10 @@ if (!function_exists('smarty_mb_str_replace')) { /** * Multibyte string replace * - * @param string $search the string to be searched - * @param string $replace the replacement string - * @param string $subject the source string - * @param int &$count number of matches found + * @param string $search the string to be searched + * @param string $replace the replacement string + * @param string $subject the source string + * @param int &$count number of matches found * @return string replaced string * @author Rodney Rehm */ @@ -48,8 +48,8 @@ if (!function_exists('smarty_mb_str_replace')) { $count = count($parts) - 1; $subject = implode($replace, $parts); } + return $subject; } } -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.14/libs/plugins/shared.mb_unicode.php b/lib/classes/Smarty-3.1.15/libs/plugins/shared.mb_unicode.php similarity index 89% rename from lib/classes/Smarty-3.1.14/libs/plugins/shared.mb_unicode.php rename to lib/classes/Smarty-3.1.15/libs/plugins/shared.mb_unicode.php index e7f839ec..41fba143 100644 --- a/lib/classes/Smarty-3.1.14/libs/plugins/shared.mb_unicode.php +++ b/lib/classes/Smarty-3.1.15/libs/plugins/shared.mb_unicode.php @@ -15,12 +15,14 @@ * @return array sequence of unicodes * @author Rodney Rehm */ -function smarty_mb_to_unicode($string, $encoding=null) { +function smarty_mb_to_unicode($string, $encoding=null) +{ if ($encoding) { $expanded = mb_convert_encoding($string, "UTF-32BE", $encoding); } else { $expanded = mb_convert_encoding($string, "UTF-32BE"); } + return unpack("N*", $expanded); } @@ -33,16 +35,16 @@ function smarty_mb_to_unicode($string, $encoding=null) { * @return string unicode as character sequence in given $encoding * @author Rodney Rehm */ -function smarty_mb_from_unicode($unicode, $encoding=null) { +function smarty_mb_from_unicode($unicode, $encoding=null) +{ $t = ''; if (!$encoding) { $encoding = mb_internal_encoding(); } - foreach((array) $unicode as $utf32be) { + foreach ((array) $unicode as $utf32be) { $character = pack("N*", $utf32be); $t .= mb_convert_encoding($character, $encoding, "UTF-32BE"); } + return $t; } - -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.14/libs/plugins/shared.mb_wordwrap.php b/lib/classes/Smarty-3.1.15/libs/plugins/shared.mb_wordwrap.php similarity index 86% rename from lib/classes/Smarty-3.1.14/libs/plugins/shared.mb_wordwrap.php rename to lib/classes/Smarty-3.1.15/libs/plugins/shared.mb_wordwrap.php index ba3498c7..ea74253d 100644 --- a/lib/classes/Smarty-3.1.14/libs/plugins/shared.mb_wordwrap.php +++ b/lib/classes/Smarty-3.1.15/libs/plugins/shared.mb_wordwrap.php @@ -6,17 +6,17 @@ * @subpackage PluginsShared */ -if(!function_exists('smarty_mb_wordwrap')) { +if (!function_exists('smarty_mb_wordwrap')) { /** * Wrap a string to a given number of characters * * @link http://php.net/manual/en/function.wordwrap.php for similarity - * @param string $str the string to wrap - * @param int $width the width of the output - * @param string $break the character used to break the line - * @param boolean $cut ignored parameter, just for the sake of - * @return string wrapped string + * @param string $str the string to wrap + * @param int $width the width of the output + * @param string $break the character used to break the line + * @param boolean $cut ignored parameter, just for the sake of + * @return string wrapped string * @author Rodney Rehm */ function smarty_mb_wordwrap($str, $width=75, $break="\n", $cut=false) @@ -63,7 +63,7 @@ if(!function_exists('smarty_mb_wordwrap')) { $length = 0; continue; } - } else if ($token == "\n") { + } elseif ($token == "\n") { // hard break must reset counters $_previous = 0; $length = 0; @@ -80,4 +80,3 @@ if(!function_exists('smarty_mb_wordwrap')) { } } -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.14/libs/plugins/variablefilter.htmlspecialchars.php b/lib/classes/Smarty-3.1.15/libs/plugins/variablefilter.htmlspecialchars.php similarity index 99% rename from lib/classes/Smarty-3.1.14/libs/plugins/variablefilter.htmlspecialchars.php rename to lib/classes/Smarty-3.1.15/libs/plugins/variablefilter.htmlspecialchars.php index aff711e4..85da1594 100644 --- a/lib/classes/Smarty-3.1.14/libs/plugins/variablefilter.htmlspecialchars.php +++ b/lib/classes/Smarty-3.1.15/libs/plugins/variablefilter.htmlspecialchars.php @@ -17,5 +17,3 @@ function smarty_variablefilter_htmlspecialchars($source, $smarty) { return htmlspecialchars($source, ENT_QUOTES, Smarty::$_CHARSET); } - -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_cacheresource.php b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_cacheresource.php similarity index 95% rename from lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_cacheresource.php rename to lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_cacheresource.php index a6852998..efdc1abe 100644 --- a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_cacheresource.php +++ b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_cacheresource.php @@ -13,7 +13,8 @@ * @subpackage Cacher * @author Rodney Rehm */ -abstract class Smarty_CacheResource { +abstract class Smarty_CacheResource +{ /** * cache for Smarty_CacheResource instances * @var array @@ -35,7 +36,7 @@ abstract class Smarty_CacheResource { * @param Smarty_Internal_Template $_template template object * @return void */ - public abstract function populate(Smarty_Template_Cached $cached, Smarty_Internal_Template $_template); + abstract public function populate(Smarty_Template_Cached $cached, Smarty_Internal_Template $_template); /** * populate Cached Object with timestamp and exists from Resource @@ -43,7 +44,7 @@ abstract class Smarty_CacheResource { * @param Smarty_Template_Cached $source cached object * @return void */ - public abstract function populateTimestamp(Smarty_Template_Cached $cached); + abstract public function populateTimestamp(Smarty_Template_Cached $cached); /** * Read the cached template and process header @@ -52,7 +53,7 @@ abstract class Smarty_CacheResource { * @param Smarty_Template_Cached $cached cached object * @return booelan true or false if the cached content does not exist */ - public abstract function process(Smarty_Internal_Template $_template, Smarty_Template_Cached $cached=null); + abstract public function process(Smarty_Internal_Template $_template, Smarty_Template_Cached $cached=null); /** * Write the rendered template output to cache @@ -61,7 +62,7 @@ abstract class Smarty_CacheResource { * @param string $content content to cache * @return boolean success */ - public abstract function writeCachedContent(Smarty_Internal_Template $_template, $content); + abstract public function writeCachedContent(Smarty_Internal_Template $_template, $content); /** * Return cached content @@ -74,8 +75,10 @@ abstract class Smarty_CacheResource { if ($_template->cached->handler->process($_template)) { ob_start(); $_template->properties['unifunc']($_template); + return ob_get_clean(); } + return null; } @@ -86,7 +89,7 @@ abstract class Smarty_CacheResource { * @param integer $exp_time expiration time (number of seconds, not timestamp) * @return integer number of cache files deleted */ - public abstract function clearAll(Smarty $smarty, $exp_time=null); + abstract public function clearAll(Smarty $smarty, $exp_time=null); /** * Empty cache for a specific template @@ -98,8 +101,7 @@ abstract class Smarty_CacheResource { * @param integer $exp_time expiration time (number of seconds, not timestamp) * @return integer number of cache files deleted */ - public abstract function clear(Smarty $smarty, $resource_name, $cache_id, $compile_id, $exp_time); - + abstract public function clear(Smarty $smarty, $resource_name, $cache_id, $compile_id, $exp_time); public function locked(Smarty $smarty, Smarty_Template_Cached $cached) { @@ -114,6 +116,7 @@ abstract class Smarty_CacheResource { } sleep(1); } + return $hadLock; } @@ -135,7 +138,6 @@ abstract class Smarty_CacheResource { return true; } - /** * Load Cache Resource Handler * @@ -153,7 +155,7 @@ abstract class Smarty_CacheResource { if (isset($smarty->_cacheresource_handlers[$type])) { return $smarty->_cacheresource_handlers[$type]; } - + // try registered resource if (isset($smarty->registered_cache_resources[$type])) { // do not cache these instances as they may vary from instance to instance @@ -165,6 +167,7 @@ abstract class Smarty_CacheResource { $cache_resource_class = 'Smarty_Internal_CacheResource_' . ucfirst($type); self::$resources[$type] = new $cache_resource_class(); } + return $smarty->_cacheresource_handlers[$type] = self::$resources[$type]; } // try plugins dir @@ -173,6 +176,7 @@ abstract class Smarty_CacheResource { if (!isset(self::$resources[$type])) { self::$resources[$type] = new $cache_resource_class(); } + return $smarty->_cacheresource_handlers[$type] = self::$resources[$type]; } // give up @@ -204,7 +208,8 @@ abstract class Smarty_CacheResource { * @subpackage TemplateResources * @author Rodney Rehm */ -class Smarty_Template_Cached { +class Smarty_Template_Cached +{ /** * Source Filepath * @var string @@ -300,6 +305,7 @@ class Smarty_Template_Cached { // if (!($_template->caching == Smarty::CACHING_LIFETIME_CURRENT || $_template->caching == Smarty::CACHING_LIFETIME_SAVED) || $_template->source->recompiled) { $handler->populate($this, $_template); + return; } while (true) { @@ -328,7 +334,7 @@ class Smarty_Template_Cached { if ($smarty->debugging) { Smarty_Internal_Debug::start_cache($_template); } - if($handler->process($_template, $this) === false) { + if ($handler->process($_template, $this) === false) { $this->valid = false; } else { $this->processed = true; @@ -347,6 +353,7 @@ class Smarty_Template_Cached { } if (!$this->valid && $_template->smarty->cache_locking) { $this->handler->acquireLock($_template->smarty, $this); + return; } else { return; @@ -371,11 +378,12 @@ class Smarty_Template_Cached { if ($_template->smarty->cache_locking) { $this->handler->releaseLock($_template->smarty, $this); } + return true; } } + return false; } } -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_cacheresource_custom.php b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_cacheresource_custom.php similarity index 66% rename from lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_cacheresource_custom.php rename to lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_cacheresource_custom.php index ee9de157..a81b545a 100644 --- a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_cacheresource_custom.php +++ b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_cacheresource_custom.php @@ -13,20 +13,20 @@ * @subpackage Cacher * @author Rodney Rehm */ -abstract class Smarty_CacheResource_Custom extends Smarty_CacheResource { - +abstract class Smarty_CacheResource_Custom extends Smarty_CacheResource +{ /** * fetch cached content and its modification time from data source * - * @param string $id unique cache content identifier - * @param string $name template name - * @param string $cache_id cache id - * @param string $compile_id compile id - * @param string $content cached content - * @param integer $mtime cache modification timestamp (epoch) + * @param string $id unique cache content identifier + * @param string $name template name + * @param string $cache_id cache id + * @param string $compile_id compile id + * @param string $content cached content + * @param integer $mtime cache modification timestamp (epoch) * @return void */ - protected abstract function fetch($id, $name, $cache_id, $compile_id, &$content, &$mtime); + abstract protected function fetch($id, $name, $cache_id, $compile_id, &$content, &$mtime); /** * Fetch cached content's modification timestamp from data source @@ -34,10 +34,10 @@ abstract class Smarty_CacheResource_Custom extends Smarty_CacheResource { * {@internal implementing this method is optional. * Only implement it if modification times can be accessed faster than loading the complete cached content.}} * - * @param string $id unique cache content identifier - * @param string $name template name - * @param string $cache_id cache id - * @param string $compile_id compile id + * @param string $id unique cache content identifier + * @param string $name template name + * @param string $cache_id cache id + * @param string $compile_id compile id * @return integer|boolean timestamp (epoch) the template was modified, or false if not found */ protected function fetchTimestamp($id, $name, $cache_id, $compile_id) @@ -48,32 +48,32 @@ abstract class Smarty_CacheResource_Custom extends Smarty_CacheResource { /** * Save content to cache * - * @param string $id unique cache content identifier - * @param string $name template name - * @param string $cache_id cache id - * @param string $compile_id compile id - * @param integer|null $exp_time seconds till expiration or null - * @param string $content content to cache - * @return boolean success + * @param string $id unique cache content identifier + * @param string $name template name + * @param string $cache_id cache id + * @param string $compile_id compile id + * @param integer|null $exp_time seconds till expiration or null + * @param string $content content to cache + * @return boolean success */ - protected abstract function save($id, $name, $cache_id, $compile_id, $exp_time, $content); + abstract protected function save($id, $name, $cache_id, $compile_id, $exp_time, $content); /** * Delete content from cache * - * @param string $name template name - * @param string $cache_id cache id - * @param string $compile_id compile id - * @param integer|null $exp_time seconds till expiration time in seconds or null - * @return integer number of deleted caches + * @param string $name template name + * @param string $cache_id cache id + * @param string $compile_id compile id + * @param integer|null $exp_time seconds till expiration time in seconds or null + * @return integer number of deleted caches */ - protected abstract function delete($name, $cache_id, $compile_id, $exp_time); + abstract protected function delete($name, $cache_id, $compile_id, $exp_time); /** * populate Cached Object with meta data from Resource * - * @param Smarty_Template_Cached $cached cached object - * @param Smarty_Internal_Template $_template template object + * @param Smarty_Template_Cached $cached cached object + * @param Smarty_Internal_Template $_template template object * @return void */ public function populate(Smarty_Template_Cached $cached, Smarty_Internal_Template $_template) @@ -88,7 +88,7 @@ abstract class Smarty_CacheResource_Custom extends Smarty_CacheResource { /** * populate Cached Object with timestamp and exists from Resource * - * @param Smarty_Template_Cached $source cached object + * @param Smarty_Template_Cached $source cached object * @return void */ public function populateTimestamp(Smarty_Template_Cached $cached) @@ -97,6 +97,7 @@ abstract class Smarty_CacheResource_Custom extends Smarty_CacheResource { if ($mtime !== null) { $cached->timestamp = $mtime; $cached->exists = !!$cached->timestamp; + return; } $timestamp = null; @@ -108,9 +109,9 @@ abstract class Smarty_CacheResource_Custom extends Smarty_CacheResource { /** * Read the cached template and process the header * - * @param Smarty_Internal_Template $_template template object - * @param Smarty_Template_Cached $cached cached object - * @return booelan true or false if the cached content does not exist + * @param Smarty_Internal_Template $_template template object + * @param Smarty_Template_Cached $cached cached object + * @return booelan true or false if the cached content does not exist */ public function process(Smarty_Internal_Template $_template, Smarty_Template_Cached $cached=null) { @@ -132,17 +133,19 @@ abstract class Smarty_CacheResource_Custom extends Smarty_CacheResource { if (isset($content)) { $_smarty_tpl = $_template; eval("?>" . $content); + return true; } + return false; } /** * Write the rendered template output to cache * - * @param Smarty_Internal_Template $_template template object - * @param string $content content to cache - * @return boolean success + * @param Smarty_Internal_Template $_template template object + * @param string $content content to cache + * @return boolean success */ public function writeCachedContent(Smarty_Internal_Template $_template, $content) { @@ -159,38 +162,40 @@ abstract class Smarty_CacheResource_Custom extends Smarty_CacheResource { /** * Empty cache * - * @param Smarty $smarty Smarty object - * @param integer $exp_time expiration time (number of seconds, not timestamp) + * @param Smarty $smarty Smarty object + * @param integer $exp_time expiration time (number of seconds, not timestamp) * @return integer number of cache files deleted */ public function clearAll(Smarty $smarty, $exp_time=null) { $this->cache = array(); + return $this->delete(null, null, null, $exp_time); } /** * Empty cache for a specific template * - * @param Smarty $smarty Smarty object - * @param string $resource_name template name - * @param string $cache_id cache id - * @param string $compile_id compile id - * @param integer $exp_time expiration time (number of seconds, not timestamp) + * @param Smarty $smarty Smarty object + * @param string $resource_name template name + * @param string $cache_id cache id + * @param string $compile_id compile id + * @param integer $exp_time expiration time (number of seconds, not timestamp) * @return integer number of cache files deleted */ public function clear(Smarty $smarty, $resource_name, $cache_id, $compile_id, $exp_time) { $this->cache = array(); + return $this->delete($resource_name, $cache_id, $compile_id, $exp_time); } /** * Check is cache is locked for this template * - * @param Smarty $smarty Smarty object - * @param Smarty_Template_Cached $cached cached object - * @return booelan true or false if cache is locked + * @param Smarty $smarty Smarty object + * @param Smarty_Template_Cached $cached cached object + * @return booelan true or false if cache is locked */ public function hasLock(Smarty $smarty, Smarty_Template_Cached $cached) { @@ -208,7 +213,7 @@ abstract class Smarty_CacheResource_Custom extends Smarty_CacheResource { /** * Lock cache for this template * - * @param Smarty $smarty Smarty object + * @param Smarty $smarty Smarty object * @param Smarty_Template_Cached $cached cached object */ public function acquireLock(Smarty $smarty, Smarty_Template_Cached $cached) @@ -223,7 +228,7 @@ abstract class Smarty_CacheResource_Custom extends Smarty_CacheResource { /** * Unlock cache for this template * - * @param Smarty $smarty Smarty object + * @param Smarty $smarty Smarty object * @param Smarty_Template_Cached $cached cached object */ public function releaseLock(Smarty $smarty, Smarty_Template_Cached $cached) @@ -234,4 +239,3 @@ abstract class Smarty_CacheResource_Custom extends Smarty_CacheResource { $this->delete($name, null, null, null); } } -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_cacheresource_keyvaluestore.php b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_cacheresource_keyvaluestore.php similarity index 80% rename from lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_cacheresource_keyvaluestore.php rename to lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_cacheresource_keyvaluestore.php index dff9b65a..0b927aab 100644 --- a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_cacheresource_keyvaluestore.php +++ b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_cacheresource_keyvaluestore.php @@ -31,8 +31,8 @@ * @subpackage Cacher * @author Rodney Rehm */ -abstract class Smarty_CacheResource_KeyValueStore extends Smarty_CacheResource { - +abstract class Smarty_CacheResource_KeyValueStore extends Smarty_CacheResource +{ /** * cache for contents * @var array @@ -47,8 +47,8 @@ abstract class Smarty_CacheResource_KeyValueStore extends Smarty_CacheResource { /** * populate Cached Object with meta data from Resource * - * @param Smarty_Template_Cached $cached cached object - * @param Smarty_Internal_Template $_template template object + * @param Smarty_Template_Cached $cached cached object + * @param Smarty_Internal_Template $_template template object * @return void */ public function populate(Smarty_Template_Cached $cached, Smarty_Internal_Template $_template) @@ -64,7 +64,7 @@ abstract class Smarty_CacheResource_KeyValueStore extends Smarty_CacheResource { /** * populate Cached Object with timestamp and exists from Resource * - * @param Smarty_Template_Cached $cached cached object + * @param Smarty_Template_Cached $cached cached object * @return void */ public function populateTimestamp(Smarty_Template_Cached $cached) @@ -80,9 +80,9 @@ abstract class Smarty_CacheResource_KeyValueStore extends Smarty_CacheResource { /** * Read the cached template and process the header * - * @param Smarty_Internal_Template $_template template object - * @param Smarty_Template_Cached $cached cached object - * @return booelan true or false if the cached content does not exist + * @param Smarty_Internal_Template $_template template object + * @param Smarty_Template_Cached $cached cached object + * @return booelan true or false if the cached content does not exist */ public function process(Smarty_Internal_Template $_template, Smarty_Template_Cached $cached=null) { @@ -99,21 +99,24 @@ abstract class Smarty_CacheResource_KeyValueStore extends Smarty_CacheResource { if (isset($content)) { $_smarty_tpl = $_template; eval("?>" . $content); + return true; } + return false; } /** * Write the rendered template output to cache * - * @param Smarty_Internal_Template $_template template object - * @param string $content content to cache - * @return boolean success + * @param Smarty_Internal_Template $_template template object + * @param string $content content to cache + * @return boolean success */ public function writeCachedContent(Smarty_Internal_Template $_template, $content) { $this->addMetaTimestamp($content); + return $this->write(array($_template->cached->filepath => $content), $_template->properties['cache_lifetime']); } @@ -122,8 +125,8 @@ abstract class Smarty_CacheResource_KeyValueStore extends Smarty_CacheResource { * * {@internal the $exp_time argument is ignored altogether }} * - * @param Smarty $smarty Smarty object - * @param integer $exp_time expiration time [being ignored] + * @param Smarty $smarty Smarty object + * @param integer $exp_time expiration time [being ignored] * @return integer number of cache files deleted [always -1] * @uses purge() to clear the whole store * @uses invalidate() to mark everything outdated if purge() is inapplicable @@ -133,6 +136,7 @@ abstract class Smarty_CacheResource_KeyValueStore extends Smarty_CacheResource { if (!$this->purge()) { $this->invalidate(null); } + return -1; } @@ -141,11 +145,11 @@ abstract class Smarty_CacheResource_KeyValueStore extends Smarty_CacheResource { * * {@internal the $exp_time argument is ignored altogether}} * - * @param Smarty $smarty Smarty object - * @param string $resource_name template name - * @param string $cache_id cache id - * @param string $compile_id compile id - * @param integer $exp_time expiration time [being ignored] + * @param Smarty $smarty Smarty object + * @param string $resource_name template name + * @param string $cache_id cache id + * @param string $compile_id compile id + * @param integer $exp_time expiration time [being ignored] * @return integer number of cache files deleted [always -1] * @uses buildCachedFilepath() to generate the CacheID * @uses invalidate() to mark CacheIDs parent chain as outdated @@ -157,15 +161,16 @@ abstract class Smarty_CacheResource_KeyValueStore extends Smarty_CacheResource { $cid = $uid . '#' . $this->sanitize($resource_name) . '#' . $this->sanitize($cache_id) . '#' . $this->sanitize($compile_id); $this->delete(array($cid)); $this->invalidate($cid, $resource_name, $cache_id, $compile_id, $uid); + return -1; } /** * Get template's unique ID * - * @param Smarty $smarty Smarty object - * @param string $resource_name template name - * @param string $cache_id cache id - * @param string $compile_id compile id + * @param Smarty $smarty Smarty object + * @param string $resource_name template name + * @param string $cache_id cache id + * @param string $compile_id compile id * @return string filepath of cache file */ protected function getTemplateUid(Smarty $smarty, $resource_name, $cache_id, $compile_id) @@ -176,7 +181,7 @@ abstract class Smarty_CacheResource_KeyValueStore extends Smarty_CacheResource { if ($tpl->source->exists) { $uid = $tpl->source->uid; } - + // remove from template cache if ($smarty->allow_ambiguous_resources) { $_templateId = $tpl->source->unique_resource . $tpl->cache_id . $tpl->compile_id; @@ -188,13 +193,14 @@ abstract class Smarty_CacheResource_KeyValueStore extends Smarty_CacheResource { } unset($smarty->template_objects[$_templateId]); } + return $uid; } /** * Sanitize CacheID components * - * @param string $string CacheID component to sanitize + * @param string $string CacheID component to sanitize * @return string sanitized CacheID component */ protected function sanitize($string) @@ -204,19 +210,20 @@ abstract class Smarty_CacheResource_KeyValueStore extends Smarty_CacheResource { if (!$string) { return null; } + return preg_replace('#[^\w\|]+#S', '_', $string); } /** * Fetch and prepare a cache object. * - * @param string $cid CacheID to fetch - * @param string $resource_name template name - * @param string $cache_id cache id - * @param string $compile_id compile id - * @param string $content cached content - * @param integer &$timestamp cached timestamp (epoch) - * @param string $resource_uid resource's uid + * @param string $cid CacheID to fetch + * @param string $resource_name template name + * @param string $cache_id cache id + * @param string $compile_id compile id + * @param string $content cached content + * @param integer &$timestamp cached timestamp (epoch) + * @param string $resource_uid resource's uid * @return boolean success */ protected function fetch($cid, $resource_name = null, $cache_id = null, $compile_id = null, &$content = null, &$timestamp = null, $resource_uid = null) @@ -253,25 +260,26 @@ abstract class Smarty_CacheResource_KeyValueStore extends Smarty_CacheResource { /** * Extract the timestamp the $content was cached * - * @param string &$content the cached content - * @return float the microtime the content was cached + * @param string &$content the cached content + * @return float the microtime the content was cached */ protected function getMetaTimestamp(&$content) { $s = unpack("N", substr($content, 0, 4)); $m = unpack("N", substr($content, 4, 4)); $content = substr($content, 8); + return $s[1] + ($m[1] / 100000000); } /** * Invalidate CacheID * - * @param string $cid CacheID - * @param string $resource_name template name - * @param string $cache_id cache id - * @param string $compile_id compile id - * @param string $resource_uid source's uid + * @param string $cid CacheID + * @param string $resource_name template name + * @param string $cache_id cache id + * @param string $compile_id compile id + * @param string $resource_uid source's uid * @return void */ protected function invalidate($cid = null, $resource_name = null, $cache_id = null, $compile_id = null, $resource_uid = null) @@ -304,12 +312,12 @@ abstract class Smarty_CacheResource_KeyValueStore extends Smarty_CacheResource { /** * Determine the latest timestamp known to the invalidation chain * - * @param string $cid CacheID to determine latest invalidation timestamp of - * @param string $resource_name template name - * @param string $cache_id cache id - * @param string $compile_id compile id - * @param string $resource_uid source's filepath - * @return float the microtime the CacheID was invalidated + * @param string $cid CacheID to determine latest invalidation timestamp of + * @param string $resource_name template name + * @param string $cache_id cache id + * @param string $compile_id compile id + * @param string $resource_uid source's filepath + * @return float the microtime the CacheID was invalidated */ protected function getLatestInvalidationTimestamp($cid, $resource_name = null, $cache_id = null, $compile_id = null, $resource_uid = null) { @@ -321,13 +329,14 @@ abstract class Smarty_CacheResource_KeyValueStore extends Smarty_CacheResource { if (!($_cid = $this->listInvalidationKeys($cid, $resource_name, $cache_id, $compile_id, $resource_uid))) { return 0; } - + // there are no InValidationKeys if (!($values = $this->read($_cid))) { return 0; } // make sure we're dealing with floats $values = array_map('floatval', $values); + return max($values); } @@ -336,12 +345,12 @@ abstract class Smarty_CacheResource_KeyValueStore extends Smarty_CacheResource { * * Splits "some|chain|into|an|array" into array( '#clearAll#', 'some', 'some|chain', 'some|chain|into', ... ) * - * @param string $cid CacheID to translate - * @param string $resource_name template name - * @param string $cache_id cache id - * @param string $compile_id compile id - * @param string $resource_uid source's filepath - * @return array list of InvalidationKeys + * @param string $cid CacheID to translate + * @param string $resource_name template name + * @param string $cache_id cache id + * @param string $compile_id compile id + * @param string $resource_uid source's filepath + * @return array list of InvalidationKeys * @uses $invalidationKeyPrefix to prepend to each InvalidationKey */ protected function listInvalidationKeys($cid, $resource_name = null, $cache_id = null, $compile_id = null, $resource_uid = null) @@ -380,27 +389,29 @@ abstract class Smarty_CacheResource_KeyValueStore extends Smarty_CacheResource { // skip past delimiter position $i++; } + return $t; } /** * Check is cache is locked for this template * - * @param Smarty $smarty Smarty object - * @param Smarty_Template_Cached $cached cached object - * @return booelan true or false if cache is locked + * @param Smarty $smarty Smarty object + * @param Smarty_Template_Cached $cached cached object + * @return booelan true or false if cache is locked */ public function hasLock(Smarty $smarty, Smarty_Template_Cached $cached) { $key = 'LOCK#' . $cached->filepath; $data = $this->read(array($key)); + return $data && time() - $data[$key] < $smarty->locking_timeout; } /** * Lock cache for this template * - * @param Smarty $smarty Smarty object + * @param Smarty $smarty Smarty object * @param Smarty_Template_Cached $cached cached object */ public function acquireLock(Smarty $smarty, Smarty_Template_Cached $cached) @@ -413,7 +424,7 @@ abstract class Smarty_CacheResource_KeyValueStore extends Smarty_CacheResource { /** * Unlock cache for this template * - * @param Smarty $smarty Smarty object + * @param Smarty $smarty Smarty object * @param Smarty_Template_Cached $cached cached object */ public function releaseLock(Smarty $smarty, Smarty_Template_Cached $cached) @@ -426,27 +437,27 @@ abstract class Smarty_CacheResource_KeyValueStore extends Smarty_CacheResource { /** * Read values for a set of keys from cache * - * @param array $keys list of keys to fetch + * @param array $keys list of keys to fetch * @return array list of values with the given keys used as indexes */ - protected abstract function read(array $keys); + abstract protected function read(array $keys); /** * Save values for a set of keys to cache * - * @param array $keys list of values to save - * @param int $expire expiration time + * @param array $keys list of values to save + * @param int $expire expiration time * @return boolean true on success, false on failure */ - protected abstract function write(array $keys, $expire=null); + abstract protected function write(array $keys, $expire=null); /** * Remove values from cache * - * @param array $keys list of keys to delete + * @param array $keys list of keys to delete * @return boolean true on success, false on failure */ - protected abstract function delete(array $keys); + abstract protected function delete(array $keys); /** * Remove *all* values from cache @@ -459,5 +470,3 @@ abstract class Smarty_CacheResource_KeyValueStore extends Smarty_CacheResource { } } - -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_config_source.php b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_config_source.php similarity index 73% rename from lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_config_source.php rename to lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_config_source.php index 043ff13e..5db11bea 100644 --- a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_config_source.php +++ b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_config_source.php @@ -19,17 +19,17 @@ * @property int $timestamp * @property bool $exists */ -class Smarty_Config_Source extends Smarty_Template_Source { - +class Smarty_Config_Source extends Smarty_Template_Source +{ /** * create Config Object container * - * @param Smarty_Resource $handler Resource Handler this source object communicates with - * @param Smarty $smarty Smarty instance this source object belongs to - * @param string $resource full config_resource - * @param string $type type of resource - * @param string $name resource name - * @param string $unique_resource unqiue resource name + * @param Smarty_Resource $handler Resource Handler this source object communicates with + * @param Smarty $smarty Smarty instance this source object belongs to + * @param string $resource full config_resource + * @param string $type type of resource + * @param string $name resource name + * @param string $unique_resource unqiue resource name */ public function __construct(Smarty_Resource $handler, Smarty $smarty, $resource, $type, $name, $unique_resource) { @@ -50,8 +50,8 @@ class Smarty_Config_Source extends Smarty_Template_Source { /** * <> Generic setter. * - * @param string $property_name valid: content, timestamp, exists - * @param mixed $value newly assigned value (not check for correct type) + * @param string $property_name valid: content, timestamp, exists + * @param mixed $value newly assigned value (not check for correct type) * @throws SmartyException when the given property name is not valid */ public function __set($property_name, $value) @@ -71,7 +71,7 @@ class Smarty_Config_Source extends Smarty_Template_Source { /** * <> Generic getter. * - * @param string $property_name valid: content, timestamp, exists + * @param string $property_name valid: content, timestamp, exists * @throws SmartyException when the given property name is not valid */ public function __get($property_name) @@ -80,6 +80,7 @@ class Smarty_Config_Source extends Smarty_Template_Source { case 'timestamp': case 'exists': $this->handler->populateTimestamp($this); + return $this->$property_name; case 'content': @@ -91,5 +92,3 @@ class Smarty_Config_Source extends Smarty_Template_Source { } } - -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_cacheresource_file.php b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_cacheresource_file.php similarity index 97% rename from lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_cacheresource_file.php rename to lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_cacheresource_file.php index fca897d9..049cc91b 100644 --- a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_cacheresource_file.php +++ b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_cacheresource_file.php @@ -16,8 +16,8 @@ * @package Smarty * @subpackage Cacher */ - class Smarty_Internal_CacheResource_File extends Smarty_CacheResource { - + class Smarty_Internal_CacheResource_File extends Smarty_CacheResource + { /** * populate Cached Object with meta data from Resource * @@ -87,6 +87,7 @@ public function process(Smarty_Internal_Template $_template, Smarty_Template_Cached $cached=null) { $_smarty_tpl = $_template; + return @include $_template->cached->filepath; } @@ -106,6 +107,7 @@ return true; } } + return false; } @@ -186,7 +188,7 @@ @rmdir($_file->getPathname()); } } else { - $_parts = explode($_dir_sep, str_replace('\\', '/', substr((string)$_file, $_dir_length))); + $_parts = explode($_dir_sep, str_replace('\\', '/', substr((string) $_file, $_dir_length))); $_parts_count = count($_parts); // check name if (isset($resource_name)) { @@ -209,23 +211,24 @@ if ($_parts[$i] != $_cache_id_parts[$i]) continue 2; } } - // expired ? - if (isset($exp_time)) { + // expired ? + if (isset($exp_time)) { if ($exp_time < 0) { - preg_match('#\'cache_lifetime\' =>\s*(\d*)#', file_get_contents($_file), $match); - if ($_time < (@filemtime($_file) + $match[1])) { - continue; + preg_match('#\'cache_lifetime\' =>\s*(\d*)#', file_get_contents($_file), $match); + if ($_time < (@filemtime($_file) + $match[1])) { + continue; } } else { if ($_time - @filemtime($_file) < $exp_time) { continue; - } + } } } $_count += @unlink((string) $_file) ? 1 : 0; } } } + return $_count; } @@ -244,6 +247,7 @@ clearstatcache(); } $t = @filemtime($cached->lock_id); + return $t && (time() - $t < $smarty->locking_timeout); } @@ -271,5 +275,3 @@ @unlink($cached->lock_id); } } - -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_append.php b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_append.php similarity index 87% rename from lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_append.php rename to lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_append.php index f6036e88..de901db8 100644 --- a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_append.php +++ b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_append.php @@ -15,14 +15,14 @@ * @package Smarty * @subpackage Compiler */ -class Smarty_Internal_Compile_Append extends Smarty_Internal_Compile_Assign { - +class Smarty_Internal_Compile_Append extends Smarty_Internal_Compile_Assign +{ /** * Compiles code for the {append} tag * - * @param array $args array with attributes from parser - * @param object $compiler compiler object - * @param array $parameter array with compilation parameter + * @param array $args array with attributes from parser + * @param object $compiler compiler object + * @param array $parameter array with compilation parameter * @return string compiled code */ public function compile($args, $compiler, $parameter) @@ -49,5 +49,3 @@ class Smarty_Internal_Compile_Append extends Smarty_Internal_Compile_Assign { } } - -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_assign.php b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_assign.php similarity index 94% rename from lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_assign.php rename to lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_assign.php index f2dfedfb..40e45ca9 100644 --- a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_assign.php +++ b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_assign.php @@ -15,14 +15,14 @@ * @package Smarty * @subpackage Compiler */ -class Smarty_Internal_Compile_Assign extends Smarty_Internal_CompileBase { - +class Smarty_Internal_Compile_Assign extends Smarty_Internal_CompileBase +{ /** * Compiles code for the {assign} tag * - * @param array $args array with attributes from parser - * @param object $compiler compiler object - * @param array $parameter array with compilation parameter + * @param array $args array with attributes from parser + * @param object $compiler compiler object + * @param array $parameter array with compilation parameter * @return string compiled code */ public function compile($args, $compiler, $parameter) @@ -76,13 +76,12 @@ class Smarty_Internal_Compile_Assign extends Smarty_Internal_CompileBase { } elseif ($_scope == Smarty::SCOPE_ROOT || $_scope == Smarty::SCOPE_GLOBAL) { $output .= "\n\$_ptr = \$_smarty_tpl->parent; while (\$_ptr != null) {\$_ptr->tpl_vars[$_attr[var]] = clone \$_smarty_tpl->tpl_vars[$_attr[var]]; \$_ptr = \$_ptr->parent; }"; } - if ( $_scope == Smarty::SCOPE_GLOBAL) { + if ($_scope == Smarty::SCOPE_GLOBAL) { $output .= "\nSmarty::\$global_tpl_vars[$_attr[var]] = clone \$_smarty_tpl->tpl_vars[$_attr[var]];"; } $output .= '?>'; + return $output; } } - -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_block.php b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_block.php new file mode 100644 index 00000000..ea62d98b --- /dev/null +++ b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_block.php @@ -0,0 +1,428 @@ +getAttributes($compiler, $args); + $_name = trim($_attr['name'], "\"'"); + + // check if we process an inheritance child template + if ($compiler->inheritance_child) { + array_unshift(self::$nested_block_names, $_name); + $this->template->block_data[$_name]['source'] = ''; + // build {block} for child block + self::$block_data[$_name]['source'] = + "{$compiler->smarty->left_delimiter}private_child_block name={$_attr['name']} file='{$compiler->template->source->filepath}'" . + " uid='{$compiler->template->source->uid}' line={$compiler->lex->line}"; + if ($_attr['nocache']) { + self::$block_data[$_name]['source'] .= ' nocache'; + } + self::$block_data[$_name]['source'] .= $compiler->smarty->right_delimiter; + + $save = array($_attr, $compiler->inheritance); + $this->openTag($compiler, 'block', $save); + // set flag for {block} tag + $compiler->inheritance = true; + $compiler->lex->yypushstate(Smarty_Internal_Templatelexer::CHILDBLOCK); + $compiler->has_code = false; + return; + } + // must merge includes + if ($_attr['nocache'] == true) { + $compiler->tag_nocache = true; + } + $save = array($_attr, $compiler->inheritance, $compiler->parser->current_buffer, $compiler->nocache); + $this->openTag($compiler, 'block', $save); + $compiler->inheritance = true; + $compiler->nocache = $compiler->nocache | $compiler->tag_nocache; + + $compiler->parser->current_buffer = new _smarty_template_buffer($compiler->parser); + $compiler->has_code = false; + + return true; + } + + + /** + * Compile saved child block source + * + * @param object $compiler compiler object + * @param string $_name optional name of child block + * @return string compiled code of child block + */ + static function compileChildBlock($compiler, $_name = null) + { + if ($compiler->inheritance_child) { + $name1 = Smarty_Internal_Compile_Block::$nested_block_names[0]; + if (isset($compiler->template->block_data[$name1])) { + // replace inner block name with generic + Smarty_Internal_Compile_Block::$block_data[$name1]['source'] .= $compiler->template->block_data[$name1]['source']; + Smarty_Internal_Compile_Block::$block_data[$name1]['child'] = true; + } + $compiler->lex->yypushstate(Smarty_Internal_Templatelexer::CHILDBLOCK); + $compiler->has_code = false; + return; + } + // if called by {$smarty.block.child} we must search the name of enclosing {block} + if ($_name == null) { + $stack_count = count($compiler->_tag_stack); + while (--$stack_count >= 0) { + if ($compiler->_tag_stack[$stack_count][0] == 'block') { + $_name = trim($compiler->_tag_stack[$stack_count][1][0]['name'], "\"'"); + break; + } + } + } + if ($_name == null) { + $compiler->trigger_template_error(' tag {$smarty.block.child} used outside {block} tags ', $compiler->lex->taglineno); + } + // undefined child? + if (!isset($compiler->template->block_data[$_name]['source'])) { + $compiler->popTrace(); + return ''; + } + // flag that child is already compile by {$smarty.block.child} inclusion + $compiler->template->block_data[$_name]['compiled'] = true; + $_tpl = new Smarty_Internal_template('string:' . $compiler->template->block_data[$_name]['source'], $compiler->smarty, $compiler->template, $compiler->template->cache_id, + $compiler->template->compile_id, $compiler->template->caching, $compiler->template->cache_lifetime); + if ($compiler->smarty->debugging) { + Smarty_Internal_Debug::ignore($_tpl); + } + $_tpl->variable_filters = $compiler->template->variable_filters; + $_tpl->properties['nocache_hash'] = $compiler->template->properties['nocache_hash']; + $_tpl->allow_relative_path = true; + $_tpl->compiler->inheritance = true; + $_tpl->compiler->suppressHeader = true; + $_tpl->compiler->suppressFilter = true; + $_tpl->compiler->suppressTemplatePropertyHeader = true; + $_tpl->compiler->suppressMergedTemplates = true; + $nocache = $compiler->nocache || $compiler->tag_nocache; + if (strpos($compiler->template->block_data[$_name]['source'], self::parent) !== false) { + $_output = str_replace(self::parent, $compiler->parser->current_buffer->to_smarty_php(), $_tpl->compiler->compileTemplate($_tpl, $nocache)); + } elseif ($compiler->template->block_data[$_name]['mode'] == 'prepend') { + $_output = $_tpl->compiler->compileTemplate($_tpl, $nocache) . $compiler->parser->current_buffer->to_smarty_php(); + } elseif ($compiler->template->block_data[$_name]['mode'] == 'append') { + $_output = $compiler->parser->current_buffer->to_smarty_php() . $_tpl->compiler->compileTemplate($_tpl, $nocache); + } elseif (!empty($compiler->template->block_data[$_name])) { + $_output = $_tpl->compiler->compileTemplate($_tpl, $nocache); + } + $compiler->template->properties['file_dependency'] = array_merge($compiler->template->properties['file_dependency'], $_tpl->properties['file_dependency']); + $compiler->template->properties['function'] = array_merge($compiler->template->properties['function'], $_tpl->properties['function']); + $compiler->merged_templates = array_merge($compiler->merged_templates, $_tpl->compiler->merged_templates); + $compiler->template->variable_filters = $_tpl->variable_filters; + if ($_tpl->has_nocache_code) { + $compiler->template->has_nocache_code = true; + } + foreach ($_tpl->required_plugins as $key => $tmp1) { + if ($compiler->nocache && $compiler->template->caching) { + $code = 'nocache'; + } else { + $code = $key; + } + foreach ($tmp1 as $name => $tmp) { + foreach ($tmp as $type => $data) { + $compiler->template->required_plugins[$code][$name][$type] = $data; + } + } + } + unset($_tpl); + $compiler->has_code = true; + return $_output; + } + + /** + * Compile $smarty.block.parent + * + * @param object $compiler compiler object + * @param string $_name optional name of child block + * @return string compiled code of schild block + */ + static function compileParentBlock($compiler, $_name = null) + { + // if called by {$smarty.block.parent} we must search the name of enclosing {block} + if ($_name == null) { + $stack_count = count($compiler->_tag_stack); + while (--$stack_count >= 0) { + if ($compiler->_tag_stack[$stack_count][0] == 'block') { + $_name = trim($compiler->_tag_stack[$stack_count][1][0]['name'], "\"'"); + break; + } + } + } + if ($_name == null) { + $compiler->trigger_template_error(' tag {$smarty.block.parent} used outside {block} tags ', $compiler->lex->taglineno); + } + if (empty(Smarty_Internal_Compile_Block::$nested_block_names)) { + $compiler->trigger_template_error(' illegal {$smarty.block.parent} in parent template ', $compiler->lex->taglineno); + } + Smarty_Internal_Compile_Block::$block_data[Smarty_Internal_Compile_Block::$nested_block_names[0]]['source'] .= Smarty_Internal_Compile_Block::parent; + $compiler->lex->yypushstate(Smarty_Internal_Templatelexer::CHILDBLOCK); + $compiler->has_code = false; + return; + } + + /** + * Process block source + * + * @param string $source source text + * @return '' + */ + static function blockSource($compiler, $source) + { + Smarty_Internal_Compile_Block::$block_data[Smarty_Internal_Compile_Block::$nested_block_names[0]]['source'] .= $source; + } + +} + + +/** + * Smarty Internal Plugin Compile BlockClose Class + * + * @package Smarty + * @subpackage Compiler + */ +class Smarty_Internal_Compile_Blockclose extends Smarty_Internal_CompileBase +{ + /** + * Compiles code for the {/block} tag + * + * @param array $args array with attributes from parser + * @param object $compiler compiler object + * @return string compiled code + */ + public function compile($args, $compiler) + { + $compiler->has_code = true; + // check and get attributes + $_attr = $this->getAttributes($compiler, $args); + $saved_data = $this->closeTag($compiler, array('block')); + $_name = trim($saved_data[0]['name'], "\"'"); + // reset flag for {block} tag + $compiler->inheritance = $saved_data[1]; + // check if we process an inheritance child template + if ($compiler->inheritance_child) { + $name1 = Smarty_Internal_Compile_Block::$nested_block_names[0]; + Smarty_Internal_Compile_Block::$block_data[$name1]['source'] .= "{$compiler->smarty->left_delimiter}/private_child_block{$compiler->smarty->right_delimiter}"; + $level = count(Smarty_Internal_Compile_Block::$nested_block_names); + array_shift(Smarty_Internal_Compile_Block::$nested_block_names); + if (!empty(Smarty_Internal_Compile_Block::$nested_block_names)) { + $name2 = Smarty_Internal_Compile_Block::$nested_block_names[0]; + if (isset($compiler->template->block_data[$name1]) || !$saved_data[0]['hide']) { + if (isset(Smarty_Internal_Compile_Block::$block_data[$name1]['child']) || !isset($compiler->template->block_data[$name1])) { + Smarty_Internal_Compile_Block::$block_data[$name2]['source'] .= Smarty_Internal_Compile_Block::$block_data[$name1]['source']; + } else { + if ($compiler->template->block_data[$name1]['mode'] == 'append') { + Smarty_Internal_Compile_Block::$block_data[$name2]['source'] .= Smarty_Internal_Compile_Block::$block_data[$name1]['source'] . $compiler->template->block_data[$name1]['source']; + } elseif ($compiler->template->block_data[$name1]['mode'] == 'prepend') { + Smarty_Internal_Compile_Block::$block_data[$name2]['source'] .= $compiler->template->block_data[$name1]['source'] . Smarty_Internal_Compile_Block::$block_data[$name1]['source']; + } else { + Smarty_Internal_Compile_Block::$block_data[$name2]['source'] .= $compiler->template->block_data[$name1]['source']; + } + } + } + unset(Smarty_Internal_Compile_Block::$block_data[$name1]); + $compiler->lex->yypushstate(Smarty_Internal_Templatelexer::CHILDBLOCK); + } else { + if (isset($compiler->template->block_data[$name1]) || !$saved_data[0]['hide']) { + if (isset($compiler->template->block_data[$name1]) && !isset(Smarty_Internal_Compile_Block::$block_data[$name1]['child'])) { + if (strpos($compiler->template->block_data[$name1]['source'], Smarty_Internal_Compile_Block::parent) !== false) { + $compiler->template->block_data[$name1]['source'] = + str_replace(Smarty_Internal_Compile_Block::parent, Smarty_Internal_Compile_Block::$block_data[$name1]['source'], $compiler->template->block_data[$name1]['source']); + } elseif ($compiler->template->block_data[$name1]['mode'] == 'prepend') { + $compiler->template->block_data[$name1]['source'] .= Smarty_Internal_Compile_Block::$block_data[$name1]['source']; + } elseif ($compiler->template->block_data[$name1]['mode'] == 'append') { + $compiler->template->block_data[$name1]['source'] = Smarty_Internal_Compile_Block::$block_data[$name1]['source'] . $compiler->template->block_data[$name1]['source']; + } + } else { + $compiler->template->block_data[$name1]['source'] = Smarty_Internal_Compile_Block::$block_data[$name1]['source']; + } + $compiler->template->block_data[$name1]['mode'] = 'replace'; + if ($saved_data[0]['append']) { + $compiler->template->block_data[$name1]['mode'] = 'append'; + } + if ($saved_data[0]['prepend']) { + $compiler->template->block_data[$name1]['mode'] = 'prepend'; + } + } + unset(Smarty_Internal_Compile_Block::$block_data[$name1]); + $compiler->lex->yypushstate(Smarty_Internal_Templatelexer::CHILDBODY); + } + $compiler->has_code = false; + return; + } + if (isset($compiler->template->block_data[$_name]) && !isset($compiler->template->block_data[$_name]['compiled'])) { + $_output = Smarty_Internal_Compile_Block::compileChildBlock($compiler, $_name); + } else { + if ($saved_data[0]['hide'] && !isset($compiler->template->block_data[$_name]['source'])) { + $_output = ''; + } else { + $_output = $compiler->parser->current_buffer->to_smarty_php(); + } + unset($compiler->template->block_data[$_name]['compiled']); + } + // reset flags + $compiler->parser->current_buffer = $saved_data[2]; + if ($compiler->nocache) { + $compiler->tag_nocache = true; + } + $compiler->nocache = $saved_data[3]; + // $_output content has already nocache code processed + $compiler->suppressNocacheProcessing = true; + + return $_output; + } +} + +/** + * Smarty Internal Plugin Compile Child Block Class + * + * @package Smarty + * @subpackage Compiler + */ +class Smarty_Internal_Compile_Private_Child_Block extends Smarty_Internal_CompileBase +{ + + /** + * Attribute definition: Overwrites base class. + * + * @var array + * @see Smarty_Internal_CompileBase + */ + public $required_attributes = array('name', 'file', 'uid', 'line'); + + + /** + * Compiles code for the {private_child_block} tag + * + * @param array $args array with attributes from parser + * @param object $compiler compiler object + * @return boolean true + */ + public function compile($args, $compiler) + { + // check and get attributes + $_attr = $this->getAttributes($compiler, $args); + + // must merge includes + if ($_attr['nocache'] == true) { + $compiler->tag_nocache = true; + } + $save = array($_attr, $compiler->nocache); + + // set trace back to child block + $compiler->pushTrace(trim($_attr['file'], "\"'"), trim($_attr['uid'], "\"'"), $_attr['line'] - $compiler->lex->line); + + $this->openTag($compiler, 'private_child_block', $save); + + $compiler->nocache = $compiler->nocache | $compiler->tag_nocache; + $compiler->has_code = false; + + return true; + } +} + +/** + * Smarty Internal Plugin Compile Child Block Close Class + * + * @package Smarty + * @subpackage Compiler + */ +class Smarty_Internal_Compile_Private_Child_Blockclose extends Smarty_Internal_CompileBase +{ + + + /** + * Compiles code for the {/private_child_block} tag + * + * @param array $args array with attributes from parser + * @param object $compiler compiler object + * @return boolean true + */ + public function compile($args, $compiler) + { + // check and get attributes + $_attr = $this->getAttributes($compiler, $args); + + $saved_data = $this->closeTag($compiler, array('private_child_block')); + + // end of child block + $compiler->popTrace(); + + $compiler->nocache = $saved_data[1]; + $compiler->has_code = false; + + return true; + } +} diff --git a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_break.php b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_break.php similarity index 90% rename from lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_break.php rename to lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_break.php index b25bef6c..5df51ba1 100644 --- a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_break.php +++ b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_break.php @@ -14,8 +14,8 @@ * @package Smarty * @subpackage Compiler */ -class Smarty_Internal_Compile_Break extends Smarty_Internal_CompileBase { - +class Smarty_Internal_Compile_Break extends Smarty_Internal_CompileBase +{ /** * Attribute definition: Overwrites base class. * @@ -34,9 +34,9 @@ class Smarty_Internal_Compile_Break extends Smarty_Internal_CompileBase { /** * Compiles code for the {break} tag * - * @param array $args array with attributes from parser - * @param object $compiler compiler object - * @param array $parameter array with compilation parameter + * @param array $args array with attributes from parser + * @param object $compiler compiler object + * @param array $parameter array with compilation parameter * @return string compiled code */ public function compile($args, $compiler, $parameter) @@ -68,10 +68,8 @@ class Smarty_Internal_Compile_Break extends Smarty_Internal_CompileBase { if ($level_count != 0) { $compiler->trigger_template_error("cannot break {$_levels} level(s)", $compiler->lex->taglineno); } - $compiler->has_code = true; + return ""; } } - -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_call.php b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_call.php similarity index 95% rename from lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_call.php rename to lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_call.php index af12a048..993ecde9 100644 --- a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_call.php +++ b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_call.php @@ -15,8 +15,8 @@ * @package Smarty * @subpackage Compiler */ -class Smarty_Internal_Compile_Call extends Smarty_Internal_CompileBase { - +class Smarty_Internal_Compile_Call extends Smarty_Internal_CompileBase +{ /** * Attribute definition: Overwrites base class. * @@ -42,9 +42,9 @@ class Smarty_Internal_Compile_Call extends Smarty_Internal_CompileBase { /** * Compiles the calls of user defined tags defined by {function} * - * @param array $args array with attributes from parser - * @param object $compiler compiler object - * @param array $parameter array with compilation parameter + * @param array $args array with attributes from parser + * @param object $compiler compiler object + * @param array $parameter array with compilation parameter * @return string compiled code */ public function compile($args, $compiler) @@ -122,9 +122,8 @@ class Smarty_Internal_Compile_Call extends Smarty_Internal_CompileBase { $_output = "\n"; } } + return $_output; } } - -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_capture.php b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_capture.php similarity index 91% rename from lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_capture.php rename to lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_capture.php index 9a5071eb..5d7bd549 100644 --- a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_capture.php +++ b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_capture.php @@ -15,8 +15,8 @@ * @package Smarty * @subpackage Compiler */ -class Smarty_Internal_Compile_Capture extends Smarty_Internal_CompileBase { - +class Smarty_Internal_Compile_Capture extends Smarty_Internal_CompileBase +{ /** * Attribute definition: Overwrites base class. * @@ -35,8 +35,8 @@ class Smarty_Internal_Compile_Capture extends Smarty_Internal_CompileBase { /** * Compiles code for the {capture} tag * - * @param array $args array with attributes from parser - * @param object $compiler compiler object + * @param array $args array with attributes from parser + * @param object $compiler compiler object * @return string compiled code */ public function compile($args, $compiler) @@ -64,13 +64,13 @@ class Smarty_Internal_Compile_Capture extends Smarty_Internal_CompileBase { * @package Smarty * @subpackage Compiler */ -class Smarty_Internal_Compile_CaptureClose extends Smarty_Internal_CompileBase { - +class Smarty_Internal_Compile_CaptureClose extends Smarty_Internal_CompileBase +{ /** * Compiles code for the {/capture} tag * - * @param array $args array with attributes from parser - * @param object $compiler compiler object + * @param array $args array with attributes from parser + * @param object $compiler compiler object * @return string compiled code */ public function compile($args, $compiler) @@ -90,9 +90,8 @@ class Smarty_Internal_Compile_CaptureClose extends Smarty_Internal_CompileBase { $_output .= " if (isset( \$_capture_append)) \$_smarty_tpl->append( \$_capture_append, ob_get_contents());\n"; $_output .= " Smarty::\$_smarty_vars['capture'][\$_capture_buffer]=ob_get_clean();\n"; $_output .= "} else \$_smarty_tpl->capture_error();?>"; + return $_output; } } - -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_config_load.php b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_config_load.php similarity index 94% rename from lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_config_load.php rename to lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_config_load.php index deaa052c..df4c65de 100644 --- a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_config_load.php +++ b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_config_load.php @@ -15,8 +15,8 @@ * @package Smarty * @subpackage Compiler */ -class Smarty_Internal_Compile_Config_Load extends Smarty_Internal_CompileBase { - +class Smarty_Internal_Compile_Config_Load extends Smarty_Internal_CompileBase +{ /** * Attribute definition: Overwrites base class. * @@ -42,8 +42,8 @@ class Smarty_Internal_Compile_Config_Load extends Smarty_Internal_CompileBase { /** * Compiles code for the {config_load} tag * - * @param array $args array with attributes from parser - * @param object $compiler compiler object + * @param array $args array with attributes from parser + * @param object $compiler compiler object * @return string compiled code */ public function compile($args, $compiler) @@ -56,7 +56,6 @@ class Smarty_Internal_Compile_Config_Load extends Smarty_Internal_CompileBase { $compiler->trigger_template_error('nocache option not allowed', $compiler->lex->taglineno); } - // save posible attributes $conf_file = $_attr['file']; if (isset($_attr['section'])) { @@ -77,9 +76,8 @@ class Smarty_Internal_Compile_Config_Load extends Smarty_Internal_CompileBase { // create config object $_output = "smarty, \$_smarty_tpl);"; $_output .= "\$_config->loadConfigVars($section, '$scope'); ?>"; + return $_output; } } - -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_continue.php b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_continue.php similarity index 89% rename from lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_continue.php rename to lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_continue.php index 72a5f865..40c564a2 100644 --- a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_continue.php +++ b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_continue.php @@ -15,8 +15,8 @@ * @package Smarty * @subpackage Compiler */ -class Smarty_Internal_Compile_Continue extends Smarty_Internal_CompileBase { - +class Smarty_Internal_Compile_Continue extends Smarty_Internal_CompileBase +{ /** * Attribute definition: Overwrites base class. * @@ -35,9 +35,9 @@ class Smarty_Internal_Compile_Continue extends Smarty_Internal_CompileBase { /** * Compiles code for the {continue} tag * - * @param array $args array with attributes from parser - * @param object $compiler compiler object - * @param array $parameter array with compilation parameter + * @param array $args array with attributes from parser + * @param object $compiler compiler object + * @param array $parameter array with compilation parameter * @return string compiled code */ public function compile($args, $compiler, $parameter) @@ -69,10 +69,8 @@ class Smarty_Internal_Compile_Continue extends Smarty_Internal_CompileBase { if ($level_count != 0) { $compiler->trigger_template_error("cannot continue {$_levels} level(s)", $compiler->lex->taglineno); } - $compiler->has_code = true; + return ""; } } - -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_debug.php b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_debug.php similarity index 87% rename from lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_debug.php rename to lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_debug.php index f50c7aee..98d019b4 100644 --- a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_debug.php +++ b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_debug.php @@ -16,13 +16,13 @@ * @package Smarty * @subpackage Compiler */ -class Smarty_Internal_Compile_Debug extends Smarty_Internal_CompileBase { - +class Smarty_Internal_Compile_Debug extends Smarty_Internal_CompileBase +{ /** * Compiles code for the {debug} tag * - * @param array $args array with attributes from parser - * @param object $compiler compiler object + * @param array $args array with attributes from parser + * @param object $compiler compiler object * @return string compiled code */ public function compile($args, $compiler) @@ -35,9 +35,8 @@ class Smarty_Internal_Compile_Debug extends Smarty_Internal_CompileBase { // display debug template $_output = "smarty->loadPlugin('Smarty_Internal_Debug'); Smarty_Internal_Debug::display_debug(\$_smarty_tpl); ?>"; + return $_output; } } - -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_eval.php b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_eval.php similarity index 93% rename from lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_eval.php rename to lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_eval.php index 6cf481b5..1c7ec123 100644 --- a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_eval.php +++ b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_eval.php @@ -15,8 +15,8 @@ * @package Smarty * @subpackage Compiler */ -class Smarty_Internal_Compile_Eval extends Smarty_Internal_CompileBase { - +class Smarty_Internal_Compile_Eval extends Smarty_Internal_CompileBase +{ /** * Attribute definition: Overwrites base class. * @@ -42,8 +42,8 @@ class Smarty_Internal_Compile_Eval extends Smarty_Internal_CompileBase { /** * Compiles code for the {eval} tag * - * @param array $args array with attributes from parser - * @param object $compiler compiler object + * @param array $args array with attributes from parser + * @param object $compiler compiler object * @return string compiled code */ public function compile($args, $compiler) @@ -65,9 +65,8 @@ class Smarty_Internal_Compile_Eval extends Smarty_Internal_CompileBase { } else { $_output .= "echo \$_template->fetch();"; } + return ""; } } - -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_extends.php b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_extends.php new file mode 100644 index 00000000..aa3d6df3 --- /dev/null +++ b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_extends.php @@ -0,0 +1,87 @@ +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 ''; + } +} diff --git a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_for.php b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_for.php similarity index 79% rename from lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_for.php rename to lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_for.php index 057f4fb7..40b2886a 100644 --- a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_for.php +++ b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_for.php @@ -15,8 +15,8 @@ * @package Smarty * @subpackage Compiler */ -class Smarty_Internal_Compile_For extends Smarty_Internal_CompileBase { - +class Smarty_Internal_Compile_For extends Smarty_Internal_CompileBase +{ /** * Compiles code for the {for} tag * @@ -31,9 +31,9 @@ class Smarty_Internal_Compile_For extends Smarty_Internal_CompileBase { * The parser is gereration different sets of attribute by which this compiler can * determin which syntax is used. * - * @param array $args array with attributes from parser - * @param object $compiler compiler object - * @param array $parameter array with compilation parameter + * @param array $args array with attributes from parser + * @param object $compiler compiler object + * @param array $parameter array with compilation parameter * @return string compiled code */ public function compile($args, $compiler, $parameter) @@ -54,7 +54,7 @@ class Smarty_Internal_Compile_For extends Smarty_Internal_CompileBase { $output .= " \$_smarty_tpl->tpl_vars[$_statement[var]] = new Smarty_Variable;"; $output .= " \$_smarty_tpl->tpl_vars[$_statement[var]]->value = $_statement[value];\n"; } - $output .= " if ($_attr[ifexp]){ for (\$_foo=true;$_attr[ifexp]; \$_smarty_tpl->tpl_vars[$_attr[var]]->value$_attr[step]){\n"; + $output .= " if ($_attr[ifexp]) { for (\$_foo=true;$_attr[ifexp]; \$_smarty_tpl->tpl_vars[$_attr[var]]->value$_attr[step]) {\n"; } else { $_statement = $_attr['start']; $output .= "\$_smarty_tpl->tpl_vars[$_statement[var]] = new Smarty_Variable;"; @@ -64,12 +64,12 @@ class Smarty_Internal_Compile_For extends Smarty_Internal_CompileBase { $output .= "\$_smarty_tpl->tpl_vars[$_statement[var]]->step = 1;"; } if (isset($_attr['max'])) { - $output .= "\$_smarty_tpl->tpl_vars[$_statement[var]]->total = (int)min(ceil((\$_smarty_tpl->tpl_vars[$_statement[var]]->step > 0 ? $_attr[to]+1 - ($_statement[value]) : $_statement[value]-($_attr[to])+1)/abs(\$_smarty_tpl->tpl_vars[$_statement[var]]->step)),$_attr[max]);\n"; + $output .= "\$_smarty_tpl->tpl_vars[$_statement[var]]->total = (int) min(ceil((\$_smarty_tpl->tpl_vars[$_statement[var]]->step > 0 ? $_attr[to]+1 - ($_statement[value]) : $_statement[value]-($_attr[to])+1)/abs(\$_smarty_tpl->tpl_vars[$_statement[var]]->step)),$_attr[max]);\n"; } else { - $output .= "\$_smarty_tpl->tpl_vars[$_statement[var]]->total = (int)ceil((\$_smarty_tpl->tpl_vars[$_statement[var]]->step > 0 ? $_attr[to]+1 - ($_statement[value]) : $_statement[value]-($_attr[to])+1)/abs(\$_smarty_tpl->tpl_vars[$_statement[var]]->step));\n"; + $output .= "\$_smarty_tpl->tpl_vars[$_statement[var]]->total = (int) ceil((\$_smarty_tpl->tpl_vars[$_statement[var]]->step > 0 ? $_attr[to]+1 - ($_statement[value]) : $_statement[value]-($_attr[to])+1)/abs(\$_smarty_tpl->tpl_vars[$_statement[var]]->step));\n"; } - $output .= "if (\$_smarty_tpl->tpl_vars[$_statement[var]]->total > 0){\n"; - $output .= "for (\$_smarty_tpl->tpl_vars[$_statement[var]]->value = $_statement[value], \$_smarty_tpl->tpl_vars[$_statement[var]]->iteration = 1;\$_smarty_tpl->tpl_vars[$_statement[var]]->iteration <= \$_smarty_tpl->tpl_vars[$_statement[var]]->total;\$_smarty_tpl->tpl_vars[$_statement[var]]->value += \$_smarty_tpl->tpl_vars[$_statement[var]]->step, \$_smarty_tpl->tpl_vars[$_statement[var]]->iteration++){\n"; + $output .= "if (\$_smarty_tpl->tpl_vars[$_statement[var]]->total > 0) {\n"; + $output .= "for (\$_smarty_tpl->tpl_vars[$_statement[var]]->value = $_statement[value], \$_smarty_tpl->tpl_vars[$_statement[var]]->iteration = 1;\$_smarty_tpl->tpl_vars[$_statement[var]]->iteration <= \$_smarty_tpl->tpl_vars[$_statement[var]]->total;\$_smarty_tpl->tpl_vars[$_statement[var]]->value += \$_smarty_tpl->tpl_vars[$_statement[var]]->step, \$_smarty_tpl->tpl_vars[$_statement[var]]->iteration++) {\n"; $output .= "\$_smarty_tpl->tpl_vars[$_statement[var]]->first = \$_smarty_tpl->tpl_vars[$_statement[var]]->iteration == 1;"; $output .= "\$_smarty_tpl->tpl_vars[$_statement[var]]->last = \$_smarty_tpl->tpl_vars[$_statement[var]]->iteration == \$_smarty_tpl->tpl_vars[$_statement[var]]->total;"; } @@ -90,14 +90,14 @@ class Smarty_Internal_Compile_For extends Smarty_Internal_CompileBase { * @package Smarty * @subpackage Compiler */ -class Smarty_Internal_Compile_Forelse extends Smarty_Internal_CompileBase { - +class Smarty_Internal_Compile_Forelse extends Smarty_Internal_CompileBase +{ /** * Compiles code for the {forelse} tag * - * @param array $args array with attributes from parser - * @param object $compiler compiler object - * @param array $parameter array with compilation parameter + * @param array $args array with attributes from parser + * @param object $compiler compiler object + * @param array $parameter array with compilation parameter * @return string compiled code */ public function compile($args, $compiler, $parameter) @@ -107,6 +107,7 @@ class Smarty_Internal_Compile_Forelse extends Smarty_Internal_CompileBase { list($openTag, $nocache) = $this->closeTag($compiler, array('for')); $this->openTag($compiler, 'forelse', array('forelse', $nocache)); + return ""; } @@ -118,14 +119,14 @@ class Smarty_Internal_Compile_Forelse extends Smarty_Internal_CompileBase { * @package Smarty * @subpackage Compiler */ -class Smarty_Internal_Compile_Forclose extends Smarty_Internal_CompileBase { - +class Smarty_Internal_Compile_Forclose extends Smarty_Internal_CompileBase +{ /** * Compiles code for the {/for} tag * - * @param array $args array with attributes from parser - * @param object $compiler compiler object - * @param array $parameter array with compilation parameter + * @param array $args array with attributes from parser + * @param object $compiler compiler object + * @param array $parameter array with compilation parameter * @return string compiled code */ public function compile($args, $compiler, $parameter) @@ -147,5 +148,3 @@ class Smarty_Internal_Compile_Forclose extends Smarty_Internal_CompileBase { } } - -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_foreach.php b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_foreach.php similarity index 92% rename from lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_foreach.php rename to lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_foreach.php index 1354c89d..7d138398 100644 --- a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_foreach.php +++ b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_foreach.php @@ -15,7 +15,8 @@ * @package Smarty * @subpackage Compiler */ -class Smarty_Internal_Compile_Foreach extends Smarty_Internal_CompileBase { +class Smarty_Internal_Compile_Foreach extends Smarty_Internal_CompileBase +{ /** * Attribute definition: Overwrites base class. * @@ -41,9 +42,9 @@ class Smarty_Internal_Compile_Foreach extends Smarty_Internal_CompileBase { /** * Compiles code for the {foreach} tag * - * @param array $args array with attributes from parser - * @param object $compiler compiler object - * @param array $parameter array with compilation parameter + * @param array $args array with attributes from parser + * @param object $compiler compiler object + * @param array $parameter array with compilation parameter * @return string compiled code */ public function compile($args, $compiler, $parameter) @@ -131,7 +132,7 @@ class Smarty_Internal_Compile_Foreach extends Smarty_Internal_CompileBase { $output .= " \$_smarty_tpl->tpl_vars['smarty']->value['foreach'][$name]['show']=(\$_smarty_tpl->tpl_vars[$item]->total > 0);\n"; } } - $output .= "foreach (\$_from as \$_smarty_tpl->tpl_vars[$item]->key => \$_smarty_tpl->tpl_vars[$item]->value){\n\$_smarty_tpl->tpl_vars[$item]->_loop = true;\n"; + $output .= "foreach (\$_from as \$_smarty_tpl->tpl_vars[$item]->key => \$_smarty_tpl->tpl_vars[$item]->value) {\n\$_smarty_tpl->tpl_vars[$item]->_loop = true;\n"; if ($key != null) { $output .= " \$_smarty_tpl->tpl_vars[$key]->value = \$_smarty_tpl->tpl_vars[$item]->key;\n"; } @@ -173,14 +174,14 @@ class Smarty_Internal_Compile_Foreach extends Smarty_Internal_CompileBase { * @package Smarty * @subpackage Compiler */ -class Smarty_Internal_Compile_Foreachelse extends Smarty_Internal_CompileBase { - +class Smarty_Internal_Compile_Foreachelse extends Smarty_Internal_CompileBase +{ /** * Compiles code for the {foreachelse} tag * - * @param array $args array with attributes from parser - * @param object $compiler compiler object - * @param array $parameter array with compilation parameter + * @param array $args array with attributes from parser + * @param object $compiler compiler object + * @param array $parameter array with compilation parameter * @return string compiled code */ public function compile($args, $compiler, $parameter) @@ -202,14 +203,14 @@ class Smarty_Internal_Compile_Foreachelse extends Smarty_Internal_CompileBase { * @package Smarty * @subpackage Compiler */ -class Smarty_Internal_Compile_Foreachclose extends Smarty_Internal_CompileBase { - +class Smarty_Internal_Compile_Foreachclose extends Smarty_Internal_CompileBase +{ /** * Compiles code for the {/foreach} tag * - * @param array $args array with attributes from parser - * @param object $compiler compiler object - * @param array $parameter array with compilation parameter + * @param array $args array with attributes from parser + * @param object $compiler compiler object + * @param array $parameter array with compilation parameter * @return string compiled code */ public function compile($args, $compiler, $parameter) @@ -227,5 +228,3 @@ class Smarty_Internal_Compile_Foreachclose extends Smarty_Internal_CompileBase { } } - -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_function.php b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_function.php similarity index 91% rename from lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_function.php rename to lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_function.php index 7821d203..f04dc4e5 100644 --- a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_function.php +++ b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_function.php @@ -15,8 +15,8 @@ * @package Smarty * @subpackage Compiler */ -class Smarty_Internal_Compile_Function extends Smarty_Internal_CompileBase { - +class Smarty_Internal_Compile_Function extends Smarty_Internal_CompileBase +{ /** * Attribute definition: Overwrites base class. * @@ -42,9 +42,9 @@ class Smarty_Internal_Compile_Function extends Smarty_Internal_CompileBase { /** * Compiles code for the {function} tag * - * @param array $args array with attributes from parser - * @param object $compiler compiler object - * @param array $parameter array with compilation parameter + * @param array $args array with attributes from parser + * @param object $compiler compiler object + * @param array $parameter array with compilation parameter * @return boolean true */ public function compile($args, $compiler, $parameter) @@ -97,14 +97,14 @@ class Smarty_Internal_Compile_Function extends Smarty_Internal_CompileBase { * @package Smarty * @subpackage Compiler */ -class Smarty_Internal_Compile_Functionclose extends Smarty_Internal_CompileBase { - +class Smarty_Internal_Compile_Functionclose extends Smarty_Internal_CompileBase +{ /** * Compiles code for the {/function} tag * - * @param array $args array with attributes from parser - * @param object $compiler compiler object - * @param array $parameter array with compilation parameter + * @param array $args array with attributes from parser + * @param object $compiler compiler object + * @param array $parameter array with compilation parameter * @return boolean true */ public function compile($args, $compiler, $parameter) @@ -116,8 +116,8 @@ class Smarty_Internal_Compile_Functionclose extends Smarty_Internal_CompileBase $plugins_string = ''; if (!empty($compiler->template->required_plugins['compiled'])) { $plugins_string = 'template->required_plugins['compiled'] as $tmp) { - foreach($tmp as $data) { + foreach ($compiler->template->required_plugins['compiled'] as $tmp) { + foreach ($tmp as $data) { $plugins_string .= "if (!is_callable('{$data['function']}')) include '{$data['file']}';\n"; } } @@ -125,8 +125,8 @@ class Smarty_Internal_Compile_Functionclose extends Smarty_Internal_CompileBase } if (!empty($compiler->template->required_plugins['nocache'])) { $plugins_string .= "template->properties['nocache_hash']}%%*/template->required_plugins['nocache'] as $tmp) { - foreach($tmp as $data) { + foreach ($compiler->template->required_plugins['nocache'] as $tmp) { + foreach ($tmp as $data) { $plugins_string .= "if (!is_callable(\'{$data['function']}\')) include \'{$data['file']}\';\n"; } } @@ -158,9 +158,8 @@ foreach (Smarty::\$global_tpl_vars as \$key => \$value) if(!isset(\$_smarty_tpl- $compiler->parser->current_buffer = $saved_data[1]; $compiler->template->has_nocache_code = $compiler->template->has_nocache_code | $saved_data[2]; $compiler->template->required_plugins = $saved_data[3]; + return $output; } } - -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_if.php b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_if.php similarity index 81% rename from lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_if.php rename to lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_if.php index 8794b014..7e57e2f7 100644 --- a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_if.php +++ b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_if.php @@ -15,8 +15,8 @@ * @package Smarty * @subpackage Compiler */ -class Smarty_Internal_Compile_If extends Smarty_Internal_CompileBase { - +class Smarty_Internal_Compile_If extends Smarty_Internal_CompileBase +{ /** * Compiles code for the {if} tag * @@ -51,14 +51,15 @@ class Smarty_Internal_Compile_If extends Smarty_Internal_CompileBase { } if (is_array($parameter['if condition']['var'])) { $_output = "tpl_vars[".$parameter['if condition']['var']['var']."]) || !is_array(\$_smarty_tpl->tpl_vars[".$parameter['if condition']['var']['var']."]->value)) \$_smarty_tpl->createLocalArrayVariable(".$parameter['if condition']['var']['var']."$_nocache);\n"; - $_output .= "if (\$_smarty_tpl->tpl_vars[".$parameter['if condition']['var']['var']."]->value".$parameter['if condition']['var']['smarty_internal_index']." = ".$parameter['if condition']['value']."){?>"; + $_output .= "if (\$_smarty_tpl->tpl_vars[".$parameter['if condition']['var']['var']."]->value".$parameter['if condition']['var']['smarty_internal_index']." = ".$parameter['if condition']['value'].") {?>"; } else { $_output = "tpl_vars[".$parameter['if condition']['var']."])) \$_smarty_tpl->tpl_vars[".$parameter['if condition']['var']."] = new Smarty_Variable(null{$_nocache});"; - $_output .= "if (\$_smarty_tpl->tpl_vars[".$parameter['if condition']['var']."]->value = ".$parameter['if condition']['value']."){?>"; + $_output .= "if (\$_smarty_tpl->tpl_vars[".$parameter['if condition']['var']."]->value = ".$parameter['if condition']['value'].") {?>"; } + return $_output; } else { - return ""; + return ""; } } @@ -70,8 +71,8 @@ class Smarty_Internal_Compile_If extends Smarty_Internal_CompileBase { * @package Smarty * @subpackage Compiler */ -class Smarty_Internal_Compile_Else extends Smarty_Internal_CompileBase { - +class Smarty_Internal_Compile_Else extends Smarty_Internal_CompileBase +{ /** * Compiles code for the {else} tag * @@ -85,7 +86,7 @@ class Smarty_Internal_Compile_Else extends Smarty_Internal_CompileBase { list($nesting, $compiler->tag_nocache) = $this->closeTag($compiler, array('if', 'elseif')); $this->openTag($compiler, 'else', array($nesting, $compiler->tag_nocache)); - return ""; + return ""; } } @@ -96,8 +97,8 @@ class Smarty_Internal_Compile_Else extends Smarty_Internal_CompileBase { * @package Smarty * @subpackage Compiler */ -class Smarty_Internal_Compile_Elseif extends Smarty_Internal_CompileBase { - +class Smarty_Internal_Compile_Elseif extends Smarty_Internal_CompileBase +{ /** * Compiles code for the {elseif} tag * @@ -138,16 +139,18 @@ class Smarty_Internal_Compile_Elseif extends Smarty_Internal_CompileBase { if ($condition_by_assign) { $this->openTag($compiler, 'elseif', array($nesting + 1, $compiler->tag_nocache)); if (is_array($parameter['if condition']['var'])) { - $_output = "tpl_vars[" . $parameter['if condition']['var']['var'] . "]) || !is_array(\$_smarty_tpl->tpl_vars[" . $parameter['if condition']['var']['var'] . "]->value)) \$_smarty_tpl->createLocalArrayVariable(" . $parameter['if condition']['var']['var'] . "$_nocache);\n"; - $_output .= "if (\$_smarty_tpl->tpl_vars[" . $parameter['if condition']['var']['var'] . "]->value" . $parameter['if condition']['var']['smarty_internal_index'] . " = " . $parameter['if condition']['value'] . "){?>"; + $_output = "tpl_vars[" . $parameter['if condition']['var']['var'] . "]) || !is_array(\$_smarty_tpl->tpl_vars[" . $parameter['if condition']['var']['var'] . "]->value)) \$_smarty_tpl->createLocalArrayVariable(" . $parameter['if condition']['var']['var'] . "$_nocache);\n"; + $_output .= "if (\$_smarty_tpl->tpl_vars[" . $parameter['if condition']['var']['var'] . "]->value" . $parameter['if condition']['var']['smarty_internal_index'] . " = " . $parameter['if condition']['value'] . ") {?>"; } else { - $_output = "tpl_vars[" . $parameter['if condition']['var'] . "])) \$_smarty_tpl->tpl_vars[" . $parameter['if condition']['var'] . "] = new Smarty_Variable(null{$_nocache});"; - $_output .= "if (\$_smarty_tpl->tpl_vars[" . $parameter['if condition']['var'] . "]->value = " . $parameter['if condition']['value'] . "){?>"; + $_output = "tpl_vars[" . $parameter['if condition']['var'] . "])) \$_smarty_tpl->tpl_vars[" . $parameter['if condition']['var'] . "] = new Smarty_Variable(null{$_nocache});"; + $_output .= "if (\$_smarty_tpl->tpl_vars[" . $parameter['if condition']['var'] . "]->value = " . $parameter['if condition']['value'] . ") {?>"; } + return $_output; } else { $this->openTag($compiler, 'elseif', array($nesting, $compiler->tag_nocache)); - return ""; + + return ""; } } else { $tmp = ''; @@ -157,15 +160,16 @@ class Smarty_Internal_Compile_Elseif extends Smarty_Internal_CompileBase { $this->openTag($compiler, 'elseif', array($nesting + 1, $compiler->tag_nocache)); if ($condition_by_assign) { if (is_array($parameter['if condition']['var'])) { - $_output = "{$tmp}tpl_vars[" . $parameter['if condition']['var']['var'] . "]) || !is_array(\$_smarty_tpl->tpl_vars[" . $parameter['if condition']['var']['var'] . "]->value)) \$_smarty_tpl->createLocalArrayVariable(" . $parameter['if condition']['var']['var'] . "$_nocache);\n"; - $_output .= "if (\$_smarty_tpl->tpl_vars[" . $parameter['if condition']['var']['var'] . "]->value" . $parameter['if condition']['var']['smarty_internal_index'] . " = " . $parameter['if condition']['value'] . "){?>"; + $_output = "{$tmp}tpl_vars[" . $parameter['if condition']['var']['var'] . "]) || !is_array(\$_smarty_tpl->tpl_vars[" . $parameter['if condition']['var']['var'] . "]->value)) \$_smarty_tpl->createLocalArrayVariable(" . $parameter['if condition']['var']['var'] . "$_nocache);\n"; + $_output .= "if (\$_smarty_tpl->tpl_vars[" . $parameter['if condition']['var']['var'] . "]->value" . $parameter['if condition']['var']['smarty_internal_index'] . " = " . $parameter['if condition']['value'] . ") {?>"; } else { - $_output = "{$tmp}tpl_vars[" . $parameter['if condition']['var'] . "])) \$_smarty_tpl->tpl_vars[" . $parameter['if condition']['var'] . "] = new Smarty_Variable(null{$_nocache});"; - $_output .= "if (\$_smarty_tpl->tpl_vars[" . $parameter['if condition']['var'] . "]->value = " . $parameter['if condition']['value'] . "){?>"; + $_output = "{$tmp}tpl_vars[" . $parameter['if condition']['var'] . "])) \$_smarty_tpl->tpl_vars[" . $parameter['if condition']['var'] . "] = new Smarty_Variable(null{$_nocache});"; + $_output .= "if (\$_smarty_tpl->tpl_vars[" . $parameter['if condition']['var'] . "]->value = " . $parameter['if condition']['value'] . ") {?>"; } + return $_output; } else { - return "{$tmp}"; + return "{$tmp}"; } } } @@ -178,8 +182,8 @@ class Smarty_Internal_Compile_Elseif extends Smarty_Internal_CompileBase { * @package Smarty * @subpackage Compiler */ -class Smarty_Internal_Compile_Ifclose extends Smarty_Internal_CompileBase { - +class Smarty_Internal_Compile_Ifclose extends Smarty_Internal_CompileBase +{ /** * Compiles code for the {/if} tag * @@ -199,9 +203,8 @@ class Smarty_Internal_Compile_Ifclose extends Smarty_Internal_CompileBase { for ($i = 0; $i < $nesting; $i++) { $tmp .= '}'; } + return ""; } } - -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_include.php b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_include.php new file mode 100644 index 00000000..3bd2095c --- /dev/null +++ b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_include.php @@ -0,0 +1,255 @@ +getAttributes($compiler, $args); + // save posible attributes + $include_file = $_attr['file']; + + if (isset($_attr['assign'])) { + // output will be stored in a smarty variable instead of beind displayed + $_assign = $_attr['assign']; + } + + $_parent_scope = Smarty::SCOPE_LOCAL; + if (isset($_attr['scope'])) { + $_attr['scope'] = trim($_attr['scope'], "'\""); + if ($_attr['scope'] == 'parent') { + $_parent_scope = Smarty::SCOPE_PARENT; + } elseif ($_attr['scope'] == 'root') { + $_parent_scope = Smarty::SCOPE_ROOT; + } elseif ($_attr['scope'] == 'global') { + $_parent_scope = Smarty::SCOPE_GLOBAL; + } + } + + $_caching = Smarty::CACHING_OFF; + + // flag if included template code should be merged into caller + $merge_compiled_includes = ($compiler->smarty->merge_compiled_includes || $_attr['inline'] === true) && !$compiler->template->source->recompiled; + + // set default when in nocache mode +// if ($compiler->template->caching && ($compiler->nocache || $compiler->tag_nocache || $compiler->forceNocache == 2)) { + if ($compiler->template->caching && ((!$compiler->inheritance && !$compiler->nocache && !$compiler->tag_nocache) || ($compiler->inheritance && ($compiler->nocache ||$compiler->tag_nocache)))) { + $_caching = self::CACHING_NOCACHE_CODE; + } + /* + * if the {include} tag provides individual parameter for caching + * it will not be included into the common cache file and treated like + * a nocache section + */ + if (isset($_attr['cache_lifetime'])) { + $_cache_lifetime = $_attr['cache_lifetime']; + $compiler->tag_nocache = true; + $_caching = Smarty::CACHING_LIFETIME_CURRENT; + } else { + $_cache_lifetime = 'null'; + } + if (isset($_attr['cache_id'])) { + $_cache_id = $_attr['cache_id']; + $compiler->tag_nocache = true; + $_caching = Smarty::CACHING_LIFETIME_CURRENT; + } else { + $_cache_id = '$_smarty_tpl->cache_id'; + } + if (isset($_attr['compile_id'])) { + $_compile_id = $_attr['compile_id']; + } else { + $_compile_id = '$_smarty_tpl->compile_id'; + } + if ($_attr['caching'] === true) { + $_caching = Smarty::CACHING_LIFETIME_CURRENT; + } + if ($_attr['nocache'] === true) { + $compiler->tag_nocache = true; + if ($merge_compiled_includes || $compiler->inheritance) { + $_caching = self::CACHING_NOCACHE_CODE; + } else { + $_caching = Smarty::CACHING_OFF; + } + } + + $has_compiled_template = false; + if ($merge_compiled_includes || $compiler->inheritance) { + // variable template name ? + if ($compiler->has_variable_string || !((substr_count($include_file, '"') == 2 || substr_count($include_file, "'") == 2)) + || substr_count($include_file, '(') != 0 || substr_count($include_file, '$_smarty_tpl->') != 0 + ) { + $merge_compiled_includes = false; + if ($compiler->inheritance) { + $compiler->trigger_template_error(' variable template file names not allow within {block} tags'); + } + } + // variable compile_id? + if (isset($_attr['compile_id'])) { + if (!((substr_count($_attr['compile_id'], '"') == 2 || substr_count($_attr['compile_id'], "'") == 2)) + || substr_count($_attr['compile_id'], '(') != 0 || substr_count($_attr['compile_id'], '$_smarty_tpl->') != 0 + ) { + $merge_compiled_includes = false; + if ($compiler->inheritance) { + $compiler->trigger_template_error(' variable compile_id not allow within {block} tags'); + } + } + } + if ($compiler->template->caching && ($compiler->tag_nocache || $compiler->nocache) && $_caching != self::CACHING_NOCACHE_CODE) { + $merge_compiled_includes = false; + if ($compiler->inheritance) { + $compiler->trigger_template_error(' invalid caching mode of subtemplate within {block} tags'); + } + } + } + if ($merge_compiled_includes || $compiler->inheritance) { + // we must observe different compile_id + $uid = sha1($_compile_id); + $tpl_name = null; + $nocache = false; + eval("\$tpl_name = $include_file;"); + if (!isset($compiler->smarty->merged_templates_func[$tpl_name][$uid]) || $compiler->inheritance) { + $tpl = new $compiler->smarty->template_class ($tpl_name, $compiler->smarty, $compiler->template, $compiler->template->cache_id, $compiler->template->compile_id); + // save unique function name + $compiler->smarty->merged_templates_func[$tpl_name][$uid]['func'] = $tpl->properties['unifunc'] = 'content_' . str_replace('.', '_', uniqid('', true)); + // use current nocache hash for inlined code + $compiler->smarty->merged_templates_func[$tpl_name][$uid]['nocache_hash'] = $tpl->properties['nocache_hash'] = $compiler->template->properties['nocache_hash']; + if ($compiler->template->caching && $_caching == self::CACHING_NOCACHE_CODE) { + // all code must be nocache + $nocache = true; + } + if ($compiler->inheritance) { + $tpl->compiler->inheritance = true; + } + // make sure whole chain gets compiled + $tpl->mustCompile = true; + if (!($tpl->source->uncompiled) && $tpl->source->exists) { + + + // get compiled code + $compiled_code = $tpl->compiler->compileTemplate($tpl, $nocache); + // release compiler object to free memory + unset($tpl->compiler); + // merge compiled code for {function} tags + $compiler->template->properties['function'] = array_merge($compiler->template->properties['function'], $tpl->properties['function']); + // merge filedependency + $tpl->properties['file_dependency'][$tpl->source->uid] = array($tpl->source->filepath, $tpl->source->timestamp, $tpl->source->type); + $compiler->template->properties['file_dependency'] = array_merge($compiler->template->properties['file_dependency'], $tpl->properties['file_dependency']); + // remove header code + $compiled_code = preg_replace("/(<\?php \/\*%%SmartyHeaderCode:{$tpl->properties['nocache_hash']}%%\*\/(.+?)\/\*\/%%SmartyHeaderCode%%\*\/\?>\n)/s", '', $compiled_code); + if ($tpl->has_nocache_code) { + // replace nocache_hash + $compiled_code = str_replace("{$tpl->properties['nocache_hash']}", $compiler->template->properties['nocache_hash'], $compiled_code); + $compiler->template->has_nocache_code = true; + } + $compiler->merged_templates[$tpl->properties['unifunc']] = $compiled_code; + $has_compiled_template = true; + unset ($tpl); + } + } else { + $has_compiled_template = true; + } + } + // delete {include} standard attributes + unset($_attr['file'], $_attr['assign'], $_attr['cache_id'], $_attr['compile_id'], $_attr['cache_lifetime'], $_attr['nocache'], $_attr['caching'], $_attr['scope'], $_attr['inline']); + // remaining attributes must be assigned as smarty variable + if (!empty($_attr)) { + if ($_parent_scope == Smarty::SCOPE_LOCAL) { + // create variables + foreach ($_attr as $key => $value) { + $_pairs[] = "'$key'=>$value"; + } + $_vars = 'array(' . join(',', $_pairs) . ')'; + $_has_vars = true; + } else { + $compiler->trigger_template_error('variable passing not allowed in parent/global scope', $compiler->lex->taglineno); + } + } else { + $_vars = 'array()'; + $_has_vars = false; + } + if ($has_compiled_template) { + // never call inline templates in nocache mode + $compiler->suppressNocacheProcessing = true; + $_hash = $compiler->smarty->merged_templates_func[$tpl_name][$uid]['nocache_hash']; + $_output = "setupInlineSubTemplate($include_file, $_cache_id, $_compile_id, $_caching, $_cache_lifetime, $_vars, $_parent_scope, '$_hash');\n"; + if (isset($_assign)) { + $_output .= 'ob_start(); '; + } + $_output .= $compiler->smarty->merged_templates_func[$tpl_name][$uid]['func'] . "(\$_smarty_tpl);\n"; + $_output .= "\$_smarty_tpl = array_pop(\$_tpl_stack); "; + if (isset($_assign)) { + $_output .= " \$_smarty_tpl->tpl_vars[$_assign] = new Smarty_variable(ob_get_clean());"; + } + $_output .= "\n/* End of included template \"" . $tpl_name . "\" */?>"; + + return $_output; + } + + // was there an assign attribute + if (isset($_assign)) { + $_output = "tpl_vars[$_assign] = new Smarty_variable(\$_smarty_tpl->getSubTemplate ($include_file, $_cache_id, $_compile_id, $_caching, $_cache_lifetime, $_vars, $_parent_scope));?>\n";; + } else { + $_output = "getSubTemplate ($include_file, $_cache_id, $_compile_id, $_caching, $_cache_lifetime, $_vars, $_parent_scope);?>\n"; + } + + return $_output; + } +} diff --git a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_include_php.php b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_include_php.php similarity index 94% rename from lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_include_php.php rename to lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_include_php.php index d5271236..0ed47dc8 100644 --- a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_include_php.php +++ b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_include_php.php @@ -15,8 +15,8 @@ * @package Smarty * @subpackage Compiler */ -class Smarty_Internal_Compile_Include_Php extends Smarty_Internal_CompileBase { - +class Smarty_Internal_Compile_Include_Php extends Smarty_Internal_CompileBase +{ /** * Attribute definition: Overwrites base class. * @@ -42,8 +42,8 @@ class Smarty_Internal_Compile_Include_Php extends Smarty_Internal_CompileBase { /** * Compiles code for the {include_php} tag * - * @param array $args array with attributes from parser - * @param object $compiler compiler object + * @param array $args array with attributes from parser + * @param object $compiler compiler object * @return string compiled code */ public function compile($args, $compiler) @@ -68,7 +68,7 @@ class Smarty_Internal_Compile_Include_Php extends Smarty_Internal_CompileBase { $_dir = $compiler->smarty->trusted_dir; } if (!empty($_dir)) { - foreach((array)$_dir as $_script_dir) { + foreach ((array) $_dir as $_script_dir) { $_script_dir = rtrim($_script_dir, '/\\') . DS; if (file_exists($_script_dir . $_file)) { $_filepath = $_script_dir . $_file; @@ -104,5 +104,3 @@ class Smarty_Internal_Compile_Include_Php extends Smarty_Internal_CompileBase { } } - -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_insert.php b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_insert.php similarity index 96% rename from lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_insert.php rename to lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_insert.php index e4d3f935..4c351015 100644 --- a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_insert.php +++ b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_insert.php @@ -16,8 +16,8 @@ * @package Smarty * @subpackage Compiler */ -class Smarty_Internal_Compile_Insert extends Smarty_Internal_CompileBase { - +class Smarty_Internal_Compile_Insert extends Smarty_Internal_CompileBase +{ /** * Attribute definition: Overwrites base class. * @@ -43,8 +43,8 @@ class Smarty_Internal_Compile_Insert extends Smarty_Internal_CompileBase { /** * Compiles code for the {insert} tag * - * @param array $args array with attributes from parser - * @param object $compiler compiler object + * @param array $args array with attributes from parser + * @param object $compiler compiler object * @return string compiled code */ public function compile($args, $compiler) @@ -82,7 +82,7 @@ class Smarty_Internal_Compile_Insert extends Smarty_Internal_CompileBase { $_dir = $compiler->smarty->trusted_dir; } if (!empty($_dir)) { - foreach((array)$_dir as $_script_dir) { + foreach ((array) $_dir as $_script_dir) { $_script_dir = rtrim($_script_dir, '/\\') . DS; if (file_exists($_script_dir . $_script)) { $_filepath = $_script_dir . $_script; @@ -134,9 +134,8 @@ class Smarty_Internal_Compile_Insert extends Smarty_Internal_CompileBase { $_output .= "echo {$_function}({$_params},\$_smarty_tpl);?>"; } } + return $_output; } } - -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_ldelim.php b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_ldelim.php similarity index 87% rename from lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_ldelim.php rename to lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_ldelim.php index 99063259..5c2e4134 100644 --- a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_ldelim.php +++ b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_ldelim.php @@ -15,14 +15,14 @@ * @package Smarty * @subpackage Compiler */ -class Smarty_Internal_Compile_Ldelim extends Smarty_Internal_CompileBase { - +class Smarty_Internal_Compile_Ldelim extends Smarty_Internal_CompileBase +{ /** * Compiles code for the {ldelim} tag * * This tag does output the left delimiter - * @param array $args array with attributes from parser - * @param object $compiler compiler object + * @param array $args array with attributes from parser + * @param object $compiler compiler object * @return string compiled code */ public function compile($args, $compiler) @@ -33,9 +33,8 @@ class Smarty_Internal_Compile_Ldelim extends Smarty_Internal_CompileBase { } // this tag does not return compiled code $compiler->has_code = true; + return $compiler->smarty->left_delimiter; } } - -?> diff --git a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_nocache.php b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_nocache.php similarity index 74% rename from lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_nocache.php rename to lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_nocache.php index 5fb71b71..a0e15385 100644 --- a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_nocache.php +++ b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_nocache.php @@ -15,15 +15,15 @@ * @package Smarty * @subpackage Compiler */ -class Smarty_Internal_Compile_Nocache extends Smarty_Internal_CompileBase { - +class Smarty_Internal_Compile_Nocache extends Smarty_Internal_CompileBase +{ /** * Compiles code for the {nocache} tag * * This tag does not generate compiled output. It only sets a compiler flag. * - * @param array $args array with attributes from parser - * @param object $compiler compiler object + * @param array $args array with attributes from parser + * @param object $compiler compiler object * @return bool */ public function compile($args, $compiler) @@ -32,10 +32,14 @@ class Smarty_Internal_Compile_Nocache extends Smarty_Internal_CompileBase { if ($_attr['nocache'] === true) { $compiler->trigger_template_error('nocache option not allowed', $compiler->lex->taglineno); } + if ($compiler->template->caching) { // enter nocache mode + $this->openTag($compiler, 'nocache', $compiler->nocache); $compiler->nocache = true; + } // this tag does not return compiled code $compiler->has_code = false; + return true; } @@ -47,27 +51,28 @@ class Smarty_Internal_Compile_Nocache extends Smarty_Internal_CompileBase { * @package Smarty * @subpackage Compiler */ -class Smarty_Internal_Compile_Nocacheclose extends Smarty_Internal_CompileBase { - +class Smarty_Internal_Compile_Nocacheclose extends Smarty_Internal_CompileBase +{ /** * Compiles code for the {/nocache} tag * * This tag does not generate compiled output. It only sets a compiler flag. * - * @param array $args array with attributes from parser - * @param object $compiler compiler object + * @param array $args array with attributes from parser + * @param object $compiler compiler object * @return bool */ public function compile($args, $compiler) { $_attr = $this->getAttributes($compiler, $args); - // leave nocache mode - $compiler->nocache = false; + if ($compiler->template->caching) { + // restore old nocache mode + $compiler->nocache = $this->closeTag($compiler, 'nocache'); + } // this tag does not return compiled code $compiler->has_code = false; + return true; } } - -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_private_block_plugin.php b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_private_block_plugin.php similarity index 90% rename from lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_private_block_plugin.php rename to lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_private_block_plugin.php index 5288f456..a0d6a9a0 100644 --- a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_private_block_plugin.php +++ b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_private_block_plugin.php @@ -15,8 +15,8 @@ * @package Smarty * @subpackage Compiler */ -class Smarty_Internal_Compile_Private_Block_Plugin extends Smarty_Internal_CompileBase { - +class Smarty_Internal_Compile_Private_Block_Plugin extends Smarty_Internal_CompileBase +{ /** * Attribute definition: Overwrites base class. * @@ -28,11 +28,11 @@ class Smarty_Internal_Compile_Private_Block_Plugin extends Smarty_Internal_Compi /** * Compiles code for the execution of block plugin * - * @param array $args array with attributes from parser - * @param object $compiler compiler object - * @param array $parameter array with compilation parameter - * @param string $tag name of block plugin - * @param string $function PHP function name + * @param array $args array with attributes from parser + * @param object $compiler compiler object + * @param array $parameter array with compilation parameter + * @param string $tag name of block plugin + * @param string $function PHP function name * @return string compiled code */ public function compile($args, $compiler, $parameter, $tag, $function) @@ -79,9 +79,8 @@ class Smarty_Internal_Compile_Private_Block_Plugin extends Smarty_Internal_Compi } $output = "smarty->_tag_stack);?>"; } + return $output . "\n"; } } - -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_private_function_plugin.php b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_private_function_plugin.php similarity index 84% rename from lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_private_function_plugin.php rename to lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_private_function_plugin.php index 70e76431..b5e23756 100644 --- a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_private_function_plugin.php +++ b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_private_function_plugin.php @@ -15,8 +15,8 @@ * @package Smarty * @subpackage Compiler */ -class Smarty_Internal_Compile_Private_Function_Plugin extends Smarty_Internal_CompileBase { - +class Smarty_Internal_Compile_Private_Function_Plugin extends Smarty_Internal_CompileBase +{ /** * Attribute definition: Overwrites base class. * @@ -35,11 +35,11 @@ class Smarty_Internal_Compile_Private_Function_Plugin extends Smarty_Internal_Co /** * Compiles code for the execution of function plugin * - * @param array $args array with attributes from parser - * @param object $compiler compiler object - * @param array $parameter array with compilation parameter - * @param string $tag name of function plugin - * @param string $function PHP function name + * @param array $args array with attributes from parser + * @param object $compiler compiler object + * @param array $parameter array with compilation parameter + * @param string $tag name of function plugin + * @param string $function PHP function name * @return string compiled code */ public function compile($args, $compiler, $parameter, $tag, $function) @@ -65,9 +65,8 @@ class Smarty_Internal_Compile_Private_Function_Plugin extends Smarty_Internal_Co $_params = 'array(' . implode(",", $_paramsArray) . ')'; // compile code $output = "\n"; + return $output; } } - -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_private_modifier.php b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_private_modifier.php similarity index 96% rename from lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_private_modifier.php rename to lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_private_modifier.php index a33109cc..dc26d24b 100644 --- a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_private_modifier.php +++ b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_private_modifier.php @@ -16,17 +16,18 @@ * @package Smarty * @subpackage Compiler */ -class Smarty_Internal_Compile_Private_Modifier extends Smarty_Internal_CompileBase { - +class Smarty_Internal_Compile_Private_Modifier extends Smarty_Internal_CompileBase +{ /** * Compiles code for modifier execution * - * @param array $args array with attributes from parser - * @param object $compiler compiler object - * @param array $parameter array with compilation parameter + * @param array $args array with attributes from parser + * @param object $compiler compiler object + * @param array $parameter array with compilation parameter * @return string compiled code */ - public function compile($args, $compiler, $parameter) { + public function compile($args, $compiler, $parameter) + { // check and get attributes $_attr = $this->getAttributes($compiler, $args); $output = $parameter['value']; @@ -132,9 +133,8 @@ class Smarty_Internal_Compile_Private_Modifier extends Smarty_Internal_CompileBa $compiler->trigger_template_error("unknown modifier \"" . $modifier . "\"", $compiler->lex->taglineno); } } + return $output; } } - -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_private_object_block_function.php b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_private_object_block_function.php similarity index 91% rename from lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_private_object_block_function.php rename to lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_private_object_block_function.php index cca924d1..f8064f28 100644 --- a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_private_object_block_function.php +++ b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_private_object_block_function.php @@ -15,8 +15,8 @@ * @package Smarty * @subpackage Compiler */ -class Smarty_Internal_Compile_Private_Object_Block_Function extends Smarty_Internal_CompileBase { - +class Smarty_Internal_Compile_Private_Object_Block_Function extends Smarty_Internal_CompileBase +{ /** * Attribute definition: Overwrites base class. * @@ -28,11 +28,11 @@ class Smarty_Internal_Compile_Private_Object_Block_Function extends Smarty_Inter /** * Compiles code for the execution of block plugin * - * @param array $args array with attributes from parser - * @param object $compiler compiler object - * @param array $parameter array with compilation parameter - * @param string $tag name of block object - * @param string $method name of method to call + * @param array $args array with attributes from parser + * @param object $compiler compiler object + * @param array $parameter array with compilation parameter + * @param string $tag name of block object + * @param string $method name of method to call * @return string compiled code */ public function compile($args, $compiler, $parameter, $tag, $method) @@ -80,9 +80,8 @@ class Smarty_Internal_Compile_Private_Object_Block_Function extends Smarty_Inter } $output = "smarty->registered_objects['{$base_tag}'][0]->{$method}({$_params}, \$_block_content, \$_smarty_tpl, \$_block_repeat); " . $mod_post . " } array_pop(\$_smarty_tpl->smarty->_tag_stack);?>"; } + return $output . "\n"; } } - -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_private_object_function.php b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_private_object_function.php similarity index 55% rename from lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_private_object_function.php rename to lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_private_object_function.php index f649084c..d260eb57 100644 --- a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_private_object_function.php +++ b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_private_object_function.php @@ -15,8 +15,8 @@ * @package Smarty * @subpackage Compiler */ -class Smarty_Internal_Compile_Private_Object_Function extends Smarty_Internal_CompileBase { - +class Smarty_Internal_Compile_Private_Object_Function extends Smarty_Internal_CompileBase +{ /** * Attribute definition: Overwrites base class. * @@ -28,11 +28,11 @@ class Smarty_Internal_Compile_Private_Object_Function extends Smarty_Internal_Co /** * Compiles code for the execution of function plugin * - * @param array $args array with attributes from parser - * @param object $compiler compiler object - * @param array $parameter array with compilation parameter - * @param string $tag name of function - * @param string $method name of method to call + * @param array $args array with attributes from parser + * @param object $compiler compiler object + * @param array $parameter array with compilation parameter + * @param string $tag name of function + * @param string $method name of method to call * @return string compiled code */ public function compile($args, $compiler, $parameter, $tag, $method) @@ -48,22 +48,29 @@ class Smarty_Internal_Compile_Private_Object_Function extends Smarty_Internal_Co $_assign = $_attr['assign']; unset($_attr['assign']); } - // convert attributes into parameter array string - if ($compiler->smarty->registered_objects[$tag][2]) { - $_paramsArray = array(); - foreach ($_attr as $_key => $_value) { - if (is_int($_key)) { - $_paramsArray[] = "$_key=>$_value"; - } else { - $_paramsArray[] = "'$_key'=>$_value"; + // method or property ? + if (method_exists($compiler->smarty->registered_objects[$tag][0], $method)) { + // convert attributes into parameter array string + if ($compiler->smarty->registered_objects[$tag][2]) { + $_paramsArray = array(); + foreach ($_attr as $_key => $_value) { + if (is_int($_key)) { + $_paramsArray[] = "$_key=>$_value"; + } else { + $_paramsArray[] = "'$_key'=>$_value"; + } } + $_params = 'array(' . implode(",", $_paramsArray) . ')'; + $return = "\$_smarty_tpl->smarty->registered_objects['{$tag}'][0]->{$method}({$_params},\$_smarty_tpl)"; + } else { + $_params = implode(",", $_attr); + $return = "\$_smarty_tpl->smarty->registered_objects['{$tag}'][0]->{$method}({$_params})"; } - $_params = 'array(' . implode(",", $_paramsArray) . ')'; - $return = "\$_smarty_tpl->smarty->registered_objects['{$tag}'][0]->{$method}({$_params},\$_smarty_tpl)"; } else { - $_params = implode(",", $_attr); - $return = "\$_smarty_tpl->smarty->registered_objects['{$tag}'][0]->{$method}({$_params})"; + // object property + $return = "\$_smarty_tpl->smarty->registered_objects['{$tag}'][0]->{$method}"; } + if (empty($_assign)) { // This tag does create output $compiler->has_output = true; @@ -71,9 +78,8 @@ class Smarty_Internal_Compile_Private_Object_Function extends Smarty_Internal_Co } else { $output = "assign({$_assign},{$return});?>\n"; } + return $output; } } - -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_private_print_expression.php b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_private_print_expression.php similarity index 95% rename from lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_private_print_expression.php rename to lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_private_print_expression.php index a3711954..ea3ac329 100644 --- a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_private_print_expression.php +++ b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_private_print_expression.php @@ -15,8 +15,8 @@ * @package Smarty * @subpackage Compiler */ -class Smarty_Internal_Compile_Private_Print_Expression extends Smarty_Internal_CompileBase { - +class Smarty_Internal_Compile_Private_Print_Expression extends Smarty_Internal_CompileBase +{ /** * Attribute definition: Overwrites base class. * @@ -90,8 +90,8 @@ class Smarty_Internal_Compile_Private_Print_Expression extends Smarty_Internal_C foreach ($compiler->template->smarty->registered_filters[Smarty::FILTER_VARIABLE] as $key => $function) { if (!is_array($function)) { $output = "{$function}({$output},\$_smarty_tpl)"; - } else if (is_object($function[0])) { - $output = "\$_smarty_tpl->smarty->registered_filters[Smarty::FILTER_VARIABLE][{$key}][0]->{$function[1]}({$output},\$_smarty_tpl)"; + } elseif (is_object($function[0])) { + $output = "\$_smarty_tpl->smarty->registered_filters[Smarty::FILTER_VARIABLE]['{$key}'][0]->{$function[1]}({$output},\$_smarty_tpl)"; } else { $output = "{$function[0]}::{$function[1]}({$output},\$_smarty_tpl)"; } @@ -99,7 +99,7 @@ class Smarty_Internal_Compile_Private_Print_Expression extends Smarty_Internal_C } // auto loaded filters if (isset($compiler->smarty->autoload_filters[Smarty::FILTER_VARIABLE])) { - foreach ((array)$compiler->template->smarty->autoload_filters[Smarty::FILTER_VARIABLE] as $name) { + foreach ((array) $compiler->template->smarty->autoload_filters[Smarty::FILTER_VARIABLE] as $name) { $result = $this->compile_output_filter($compiler, $name, $output); if ($result !== false) { $output = $result; @@ -123,6 +123,7 @@ class Smarty_Internal_Compile_Private_Print_Expression extends Smarty_Internal_C $compiler->has_output = true; $output = ""; } + return $output; } @@ -148,9 +149,8 @@ class Smarty_Internal_Compile_Private_Print_Expression extends Smarty_Internal_C // not found return false; } + return "{$plugin_name}({$output},\$_smarty_tpl)"; } } - -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_private_registered_block.php b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_private_registered_block.php similarity index 93% rename from lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_private_registered_block.php rename to lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_private_registered_block.php index f104853a..b02b1c83 100644 --- a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_private_registered_block.php +++ b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_private_registered_block.php @@ -15,8 +15,8 @@ * @package Smarty * @subpackage Compiler */ -class Smarty_Internal_Compile_Private_Registered_Block extends Smarty_Internal_CompileBase { - +class Smarty_Internal_Compile_Private_Registered_Block extends Smarty_Internal_CompileBase +{ /** * Attribute definition: Overwrites base class. * @@ -28,10 +28,10 @@ class Smarty_Internal_Compile_Private_Registered_Block extends Smarty_Internal_C /** * Compiles code for the execution of a block function * - * @param array $args array with attributes from parser - * @param object $compiler compiler object - * @param array $parameter array with compilation parameter - * @param string $tag name of block function + * @param array $args array with attributes from parser + * @param object $compiler compiler object + * @param array $parameter array with compilation parameter + * @param string $tag name of block function * @return string compiled code */ public function compile($args, $compiler, $parameter, $tag) @@ -70,7 +70,7 @@ class Smarty_Internal_Compile_Private_Registered_Block extends Smarty_Internal_C // compile code if (!is_array($function)) { $output = "smarty->_tag_stack[] = array('{$tag}', {$_params}); \$_block_repeat=true; echo {$function}({$_params}, null, \$_smarty_tpl, \$_block_repeat);while (\$_block_repeat) { ob_start();?>"; - } else if (is_object($function[0])) { + } elseif (is_object($function[0])) { $output = "smarty->_tag_stack[] = array('{$tag}', {$_params}); \$_block_repeat=true; echo \$_smarty_tpl->smarty->registered_plugins['block']['{$tag}'][0][0]->{$function[1]}({$_params}, null, \$_smarty_tpl, \$_block_repeat);while (\$_block_repeat) { ob_start();?>"; } else { $output = "smarty->_tag_stack[] = array('{$tag}', {$_params}); \$_block_repeat=true; echo {$function[0]}::{$function[1]}({$_params}, null, \$_smarty_tpl, \$_block_repeat);while (\$_block_repeat) { ob_start();?>"; @@ -99,15 +99,14 @@ class Smarty_Internal_Compile_Private_Registered_Block extends Smarty_Internal_C } if (!is_array($function)) { $output = "smarty->_tag_stack);?>"; - } else if (is_object($function[0])) { + } elseif (is_object($function[0])) { $output = "smarty->registered_plugins['block']['{$base_tag}'][0][0]->{$function[1]}({$_params}, \$_block_content, \$_smarty_tpl, \$_block_repeat); ".$mod_post."} array_pop(\$_smarty_tpl->smarty->_tag_stack);?>"; } else { $output = "smarty->_tag_stack);?>"; } } + return $output . "\n"; } } - -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_private_registered_function.php b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_private_registered_function.php similarity index 89% rename from lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_private_registered_function.php rename to lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_private_registered_function.php index e68a0244..0d15cc57 100644 --- a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_private_registered_function.php +++ b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_private_registered_function.php @@ -15,8 +15,8 @@ * @package Smarty * @subpackage Compiler */ -class Smarty_Internal_Compile_Private_Registered_Function extends Smarty_Internal_CompileBase { - +class Smarty_Internal_Compile_Private_Registered_Function extends Smarty_Internal_CompileBase +{ /** * Attribute definition: Overwrites base class. * @@ -28,10 +28,10 @@ class Smarty_Internal_Compile_Private_Registered_Function extends Smarty_Interna /** * Compiles code for the execution of a registered function * - * @param array $args array with attributes from parser - * @param object $compiler compiler object - * @param array $parameter array with compilation parameter - * @param string $tag name of function + * @param array $args array with attributes from parser + * @param object $compiler compiler object + * @param array $parameter array with compilation parameter + * @param string $tag name of function * @return string compiled code */ public function compile($args, $compiler, $parameter, $tag) @@ -68,14 +68,13 @@ class Smarty_Internal_Compile_Private_Registered_Function extends Smarty_Interna // compile code if (!is_array($function)) { $output = "\n"; - } else if (is_object($function[0])) { + } elseif (is_object($function[0])) { $output = "smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['{$tag}'][0][0]->{$function[1]}({$_params},\$_smarty_tpl);?>\n"; } else { $output = "\n"; } + return $output; } } - -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_private_special_variable.php b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_private_special_variable.php similarity index 96% rename from lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_private_special_variable.php rename to lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_private_special_variable.php index af8fcd37..a0e2420c 100644 --- a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_private_special_variable.php +++ b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_private_special_variable.php @@ -15,13 +15,13 @@ * @package Smarty * @subpackage Compiler */ -class Smarty_Internal_Compile_Private_Special_Variable extends Smarty_Internal_CompileBase { - +class Smarty_Internal_Compile_Private_Special_Variable extends Smarty_Internal_CompileBase +{ /** * Compiles code for the speical $smarty variables * - * @param array $args array with attributes from parser - * @param object $compiler compiler object + * @param array $args array with attributes from parser + * @param object $compiler compiler object * @return string compiled code */ public function compile($args, $compiler, $parameter) @@ -70,6 +70,7 @@ class Smarty_Internal_Compile_Private_Special_Variable extends Smarty_Internal_C case 'version': $_version = Smarty::SMARTY_VERSION; + return "'$_version'"; case 'const': @@ -77,6 +78,7 @@ class Smarty_Internal_Compile_Private_Special_Variable extends Smarty_Internal_C $compiler->trigger_template_error("(secure mode) constants not permitted"); break; } + return "@constant({$_index[1]})"; case 'config': @@ -87,10 +89,12 @@ class Smarty_Internal_Compile_Private_Special_Variable extends Smarty_Internal_C } case 'ldelim': $_ldelim = $compiler->smarty->left_delimiter; + return "'$_ldelim'"; case 'rdelim': $_rdelim = $compiler->smarty->right_delimiter; + return "'$_rdelim'"; default: @@ -103,9 +107,8 @@ class Smarty_Internal_Compile_Private_Special_Variable extends Smarty_Internal_C $compiled_ref = $compiled_ref . "[$_ind]"; } } + return $compiled_ref; } } - -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_rdelim.php b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_rdelim.php similarity index 87% rename from lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_rdelim.php rename to lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_rdelim.php index 807c7e2b..7bdd11e2 100644 --- a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_rdelim.php +++ b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_rdelim.php @@ -14,15 +14,15 @@ * @package Smarty * @subpackage Compiler */ -class Smarty_Internal_Compile_Rdelim extends Smarty_Internal_CompileBase { - +class Smarty_Internal_Compile_Rdelim extends Smarty_Internal_CompileBase +{ /** * Compiles code for the {rdelim} tag * * This tag does output the right delimiter. * - * @param array $args array with attributes from parser - * @param object $compiler compiler object + * @param array $args array with attributes from parser + * @param object $compiler compiler object * @return string compiled code */ public function compile($args, $compiler) @@ -33,9 +33,8 @@ class Smarty_Internal_Compile_Rdelim extends Smarty_Internal_CompileBase { } // this tag does not return compiled code $compiler->has_code = true; + return $compiler->smarty->right_delimiter; } } - -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_section.php b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_section.php similarity index 91% rename from lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_section.php rename to lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_section.php index ccb7673d..994e4d7c 100644 --- a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_section.php +++ b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_section.php @@ -11,12 +11,12 @@ /** * Smarty Internal Plugin Compile Section Class - * + * * @package Smarty * @subpackage Compiler */ -class Smarty_Internal_Compile_Section extends Smarty_Internal_CompileBase { - +class Smarty_Internal_Compile_Section extends Smarty_Internal_CompileBase +{ /** * Attribute definition: Overwrites base class. * @@ -42,8 +42,8 @@ class Smarty_Internal_Compile_Section extends Smarty_Internal_CompileBase { /** * Compiles code for the {section} tag * - * @param array $args array with attributes from parser - * @param object $compiler compiler object + * @param array $args array with attributes from parser + * @param object $compiler compiler object * @return string compiled code */ public function compile($args, $compiler) @@ -65,14 +65,14 @@ class Smarty_Internal_Compile_Section extends Smarty_Internal_CompileBase { foreach ($_attr as $attr_name => $attr_value) { switch ($attr_name) { case 'loop': - $output .= "{$section_props}['loop'] = is_array(\$_loop=$attr_value) ? count(\$_loop) : max(0, (int)\$_loop); unset(\$_loop);\n"; + $output .= "{$section_props}['loop'] = is_array(\$_loop=$attr_value) ? count(\$_loop) : max(0, (int) \$_loop); unset(\$_loop);\n"; break; case 'show': if (is_bool($attr_value)) $show_attr_value = $attr_value ? 'true' : 'false'; else - $show_attr_value = "(bool)$attr_value"; + $show_attr_value = "(bool) $attr_value"; $output .= "{$section_props}['show'] = $show_attr_value;\n"; break; @@ -82,11 +82,11 @@ class Smarty_Internal_Compile_Section extends Smarty_Internal_CompileBase { case 'max': case 'start': - $output .= "{$section_props}['$attr_name'] = (int)$attr_value;\n"; + $output .= "{$section_props}['$attr_name'] = (int) $attr_value;\n"; break; case 'step': - $output .= "{$section_props}['$attr_name'] = ((int)$attr_value) == 0 ? 1 : (int)$attr_value;\n"; + $output .= "{$section_props}['$attr_name'] = ((int) $attr_value) == 0 ? 1 : (int) $attr_value;\n"; break; } } @@ -131,6 +131,7 @@ class Smarty_Internal_Compile_Section extends Smarty_Internal_CompileBase { $output .= "{$section_props}['last'] = ({$section_props}['iteration'] == {$section_props}['total']);\n"; $output .= "?>"; + return $output; } @@ -138,17 +139,17 @@ class Smarty_Internal_Compile_Section extends Smarty_Internal_CompileBase { /** * Smarty Internal Plugin Compile Sectionelse Class - * + * * @package Smarty * @subpackage Compiler */ -class Smarty_Internal_Compile_Sectionelse extends Smarty_Internal_CompileBase { - +class Smarty_Internal_Compile_Sectionelse extends Smarty_Internal_CompileBase +{ /** * Compiles code for the {sectionelse} tag * - * @param array $args array with attributes from parser - * @param object $compiler compiler object + * @param array $args array with attributes from parser + * @param object $compiler compiler object * @return string compiled code */ public function compile($args, $compiler) @@ -166,17 +167,17 @@ class Smarty_Internal_Compile_Sectionelse extends Smarty_Internal_CompileBase { /** * Smarty Internal Plugin Compile Sectionclose Class - * + * * @package Smarty * @subpackage Compiler */ -class Smarty_Internal_Compile_Sectionclose extends Smarty_Internal_CompileBase { - +class Smarty_Internal_Compile_Sectionclose extends Smarty_Internal_CompileBase +{ /** * Compiles code for the {/section} tag * - * @param array $args array with attributes from parser - * @param object $compiler compiler object + * @param array $args array with attributes from parser + * @param object $compiler compiler object * @return string compiled code */ public function compile($args, $compiler) @@ -199,5 +200,3 @@ class Smarty_Internal_Compile_Sectionclose extends Smarty_Internal_CompileBase { } } - -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_setfilter.php b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_setfilter.php similarity index 83% rename from lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_setfilter.php rename to lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_setfilter.php index 50b4cab5..03d80485 100644 --- a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_setfilter.php +++ b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_setfilter.php @@ -15,14 +15,14 @@ * @package Smarty * @subpackage Compiler */ -class Smarty_Internal_Compile_Setfilter extends Smarty_Internal_CompileBase { - +class Smarty_Internal_Compile_Setfilter extends Smarty_Internal_CompileBase +{ /** * Compiles code for setfilter tag * - * @param array $args array with attributes from parser - * @param object $compiler compiler object - * @param array $parameter array with compilation parameter + * @param array $args array with attributes from parser + * @param object $compiler compiler object + * @param array $parameter array with compilation parameter * @return string compiled code */ public function compile($args, $compiler, $parameter) @@ -31,6 +31,7 @@ class Smarty_Internal_Compile_Setfilter extends Smarty_Internal_CompileBase { $compiler->template->variable_filters = $parameter['modifier_list']; // this tag does not return compiled code $compiler->has_code = false; + return true; } @@ -42,15 +43,15 @@ class Smarty_Internal_Compile_Setfilter extends Smarty_Internal_CompileBase { * @package Smarty * @subpackage Compiler */ -class Smarty_Internal_Compile_Setfilterclose extends Smarty_Internal_CompileBase { - +class Smarty_Internal_Compile_Setfilterclose extends Smarty_Internal_CompileBase +{ /** * Compiles code for the {/setfilter} tag * * This tag does not generate compiled output. It resets variable filter. * - * @param array $args array with attributes from parser - * @param object $compiler compiler object + * @param array $args array with attributes from parser + * @param object $compiler compiler object * @return string compiled code */ public function compile($args, $compiler) @@ -64,9 +65,8 @@ class Smarty_Internal_Compile_Setfilterclose extends Smarty_Internal_CompileBase } // this tag does not return compiled code $compiler->has_code = false; + return true; } } - -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_while.php b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_while.php similarity index 87% rename from lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_while.php rename to lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_while.php index d7d986c3..e26815df 100644 --- a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_while.php +++ b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compile_while.php @@ -15,14 +15,14 @@ * @package Smarty * @subpackage Compiler */ -class Smarty_Internal_Compile_While extends Smarty_Internal_CompileBase { - +class Smarty_Internal_Compile_While extends Smarty_Internal_CompileBase +{ /** * Compiles code for the {while} tag * - * @param array $args array with attributes from parser - * @param object $compiler compiler object - * @param array $parameter array with compilation parameter + * @param array $args array with attributes from parser + * @param object $compiler compiler object + * @param array $parameter array with compilation parameter * @return string compiled code */ public function compile($args, $compiler, $parameter) @@ -51,14 +51,15 @@ class Smarty_Internal_Compile_While extends Smarty_Internal_CompileBase { } if (is_array($parameter['if condition']['var'])) { $_output = "tpl_vars[" . $parameter['if condition']['var']['var'] . "]) || !is_array(\$_smarty_tpl->tpl_vars[" . $parameter['if condition']['var']['var'] . "]->value)) \$_smarty_tpl->createLocalArrayVariable(" . $parameter['if condition']['var']['var'] . "$_nocache);\n"; - $_output .= "while (\$_smarty_tpl->tpl_vars[" . $parameter['if condition']['var']['var'] . "]->value" . $parameter['if condition']['var']['smarty_internal_index'] . " = " . $parameter['if condition']['value'] . "){?>"; + $_output .= "while (\$_smarty_tpl->tpl_vars[" . $parameter['if condition']['var']['var'] . "]->value" . $parameter['if condition']['var']['smarty_internal_index'] . " = " . $parameter['if condition']['value'] . ") {?>"; } else { $_output = "tpl_vars[" . $parameter['if condition']['var'] . "])) \$_smarty_tpl->tpl_vars[" . $parameter['if condition']['var'] . "] = new Smarty_Variable(null{$_nocache});"; - $_output .= "while (\$_smarty_tpl->tpl_vars[" . $parameter['if condition']['var'] . "]->value = " . $parameter['if condition']['value'] . "){?>"; + $_output .= "while (\$_smarty_tpl->tpl_vars[" . $parameter['if condition']['var'] . "]->value = " . $parameter['if condition']['value'] . ") {?>"; } + return $_output; } else { - return ""; + return ""; } } @@ -70,13 +71,13 @@ class Smarty_Internal_Compile_While extends Smarty_Internal_CompileBase { * @package Smarty * @subpackage Compiler */ -class Smarty_Internal_Compile_Whileclose extends Smarty_Internal_CompileBase { - +class Smarty_Internal_Compile_Whileclose extends Smarty_Internal_CompileBase +{ /** * Compiles code for the {/while} tag * - * @param array $args array with attributes from parser - * @param object $compiler compiler object + * @param array $args array with attributes from parser + * @param object $compiler compiler object * @return string compiled code */ public function compile($args, $compiler) @@ -86,9 +87,8 @@ class Smarty_Internal_Compile_Whileclose extends Smarty_Internal_CompileBase { $compiler->tag_nocache = true; } $compiler->nocache = $this->closeTag($compiler, array('while')); + return ""; } } - -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compilebase.php b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compilebase.php similarity index 84% rename from lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compilebase.php rename to lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compilebase.php index 5fb56f37..8f142e25 100644 --- a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_compilebase.php +++ b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_compilebase.php @@ -13,8 +13,8 @@ * @package Smarty * @subpackage Compiler */ -abstract class Smarty_Internal_CompileBase { - +abstract class Smarty_Internal_CompileBase +{ /** * Array of names of required attribute required by tag * @@ -49,9 +49,9 @@ abstract class Smarty_Internal_CompileBase { * the corresponding list. The keyword '_any' specifies that any attribute will be accepted * as valid * - * @param object $compiler compiler object - * @param array $attributes attributes applied to the tag - * @return array of mapped attributes for further processing + * @param object $compiler compiler object + * @param array $attributes attributes applied to the tag + * @return array of mapped attributes for further processing */ public function getAttributes($compiler, $attributes) { @@ -64,7 +64,7 @@ abstract class Smarty_Internal_CompileBase { if (in_array(trim($mixed, '\'"'), $this->option_flags)) { $_indexed_attr[trim($mixed, '\'"')] = true; // shorthand attribute ? - } else if (isset($this->shorttag_order[$key])) { + } elseif (isset($this->shorttag_order[$key])) { $_indexed_attr[$this->shorttag_order[$key]] = $mixed; } else { // too many shorthands @@ -77,13 +77,13 @@ abstract class Smarty_Internal_CompileBase { if (in_array($kv['key'], $this->option_flags)) { if (is_bool($kv['value'])) { $_indexed_attr[$kv['key']] = $kv['value']; - } else if (is_string($kv['value']) && in_array(trim($kv['value'], '\'"'), array('true', 'false'))) { + } elseif (is_string($kv['value']) && in_array(trim($kv['value'], '\'"'), array('true', 'false'))) { if (trim($kv['value']) == 'true') { $_indexed_attr[$kv['key']] = true; } else { $_indexed_attr[$kv['key']] = false; } - } else if (is_numeric($kv['value']) && in_array($kv['value'], array(0, 1))) { + } elseif (is_numeric($kv['value']) && in_array($kv['value'], array(0, 1))) { if ($kv['value'] == 1) { $_indexed_attr[$kv['key']] = true; } else { @@ -129,9 +129,9 @@ abstract class Smarty_Internal_CompileBase { * * Optionally additional data can be saved on stack * - * @param object $compiler compiler object - * @param string $openTag the opening tag's name - * @param mixed $data optional data saved + * @param object $compiler compiler object + * @param string $openTag the opening tag's name + * @param mixed $data optional data saved */ public function openTag($compiler, $openTag, $data = null) { @@ -143,9 +143,9 @@ abstract class Smarty_Internal_CompileBase { * * Raise an error if this stack-top doesn't match with expected opening tags * - * @param object $compiler compiler object - * @param array|string $expectedTag the expected opening tag names - * @return mixed any type the opening tag's name or saved data + * @param object $compiler compiler object + * @param array|string $expectedTag the expected opening tag names + * @return mixed any type the opening tag's name or saved data */ public function closeTag($compiler, $expectedTag) { @@ -163,14 +163,14 @@ abstract class Smarty_Internal_CompileBase { } } // wrong nesting of tags - $compiler->trigger_template_error("unclosed {" . $_openTag . "} tag"); + $compiler->trigger_template_error("unclosed {$compiler->smarty->left_delimiter}" . $_openTag . "{$compiler->smarty->right_delimiter} tag"); + return; } // wrong nesting of tags $compiler->trigger_template_error("unexpected closing tag", $compiler->lex->taglineno); + return; } } - -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_config.php b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_config.php similarity index 94% rename from lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_config.php rename to lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_config.php index bcb3ce05..b310c3a6 100644 --- a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_config.php +++ b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_config.php @@ -19,8 +19,8 @@ * @property Smarty_Config_Compiled $compiled * @ignore */ -class Smarty_Internal_Config { - +class Smarty_Internal_Config +{ /** * Samrty instance * @@ -72,8 +72,8 @@ class Smarty_Internal_Config { * Constructor of config file object * * @param string $config_resource config file resource name - * @param Smarty $smarty Smarty instance - * @param object $data object for config vars storage + * @param Smarty $smarty Smarty instance + * @param object $data object for config vars storage */ public function __construct($config_resource, $smarty, $data = null) { @@ -104,7 +104,7 @@ class Smarty_Internal_Config { $_compile_id = isset($this->smarty->compile_id) ? preg_replace('![^\w\|]+!', '_', $this->smarty->compile_id) : null; $_flag = (int) $this->smarty->config_read_hidden + (int) $this->smarty->config_booleanize * 2 + (int) $this->smarty->config_overwrite * 4; - $_filepath = sha1($this->source->name . $_flag); + $_filepath = sha1($this->source->filepath . $_flag); // if use_sub_dirs, break file into directories if ($this->smarty->use_sub_dirs) { $_filepath = substr($_filepath, 0, 2) . DS @@ -117,6 +117,7 @@ class Smarty_Internal_Config { $_filepath = $_compile_id . $_compile_dir_sep . $_filepath; } $_compile_dir = $this->smarty->getCompileDir(); + return $_compile_dir . $_filepath . '.' . basename($this->source->name) . '.config' . '.php'; } @@ -163,6 +164,7 @@ class Smarty_Internal_Config { $this->compiled_config = file_get_contents($this->getCompiledFilepath()); } } + return $this->compiled_config; } @@ -202,8 +204,8 @@ class Smarty_Internal_Config { /** * load config variables * - * @param mixed $sections array of section names, single section or null - * @param object $scope global,parent or local + * @param mixed $sections array of section names, single section or null + * @param object $scope global,parent or local */ public function loadConfigVars($sections = null, $scope = 'local') { @@ -257,8 +259,8 @@ class Smarty_Internal_Config { /** * set Smarty property in template context * - * @param string $property_name property name - * @param mixed $value value + * @param string $property_name property name + * @param mixed $value value * @throws SmartyException if $property_name is not valid */ public function __set($property_name, $value) @@ -267,6 +269,7 @@ class Smarty_Internal_Config { case 'source': case 'compiled': $this->$property_name = $value; + return; } @@ -276,7 +279,7 @@ class Smarty_Internal_Config { /** * get Smarty property in template context * - * @param string $property_name property name + * @param string $property_name property name * @throws SmartyException if $property_name is not valid */ public function __get($property_name) @@ -287,10 +290,12 @@ class Smarty_Internal_Config { throw new SmartyException("Unable to parse resource name \"{$this->config_resource}\""); } $this->source = Smarty_Resource::config($this); + return $this->source; case 'compiled': $this->compiled = $this->source->getCompiled($this); + return $this->compiled; } @@ -298,5 +303,3 @@ class Smarty_Internal_Config { } } - -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_config_file_compiler.php b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_config_file_compiler.php similarity index 97% rename from lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_config_file_compiler.php rename to lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_config_file_compiler.php index b16a6940..4ac2a2e7 100644 --- a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_config_file_compiler.php +++ b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_config_file_compiler.php @@ -16,8 +16,8 @@ * @package Smarty * @subpackage Config */ -class Smarty_Internal_Config_File_Compiler { - +class Smarty_Internal_Config_File_Compiler +{ /** * Lexer object * @@ -69,7 +69,7 @@ class Smarty_Internal_Config_File_Compiler { * Method to compile a Smarty template. * * @param Smarty_Internal_Config $config config object - * @return bool true if compiling succeeded, false if it failed + * @return bool true if compiling succeeded, false if it failed */ public function compileSource(Smarty_Internal_Config $config) { @@ -140,5 +140,3 @@ class Smarty_Internal_Config_File_Compiler { } } - -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_configfilelexer.php b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_configfilelexer.php similarity index 93% rename from lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_configfilelexer.php rename to lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_configfilelexer.php index bade2fe7..4bc2b9e8 100644 --- a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_configfilelexer.php +++ b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_configfilelexer.php @@ -21,10 +21,9 @@ class Smarty_Internal_Configfilelexer public $line; private $state = 1; public $smarty_token_names = array ( // Text for parser error messages - ); + ); - - function __construct($data, $smarty) + public function __construct($data, $smarty) { // set instance object self::instance($this); @@ -39,39 +38,35 @@ class Smarty_Internal_Configfilelexer static $instance = null; if (isset($new_instance) && is_object($new_instance)) $instance = $new_instance; + return $instance; } - - private $_yy_state = 1; private $_yy_stack = array(); - function yylex() + public function yylex() { return $this->{'yylex' . $this->_yy_state}(); } - function yypushstate($state) + public function yypushstate($state) { array_push($this->_yy_stack, $this->_yy_state); $this->_yy_state = $state; } - function yypopstate() + public function yypopstate() { $this->_yy_state = array_pop($this->_yy_stack); } - function yybegin($state) + public function yybegin($state) { $this->_yy_state = $state; } - - - - function yylex1() + public function yylex1() { $tokenMap = array ( 1 => 0, @@ -134,55 +129,51 @@ class Smarty_Internal_Configfilelexer } // end function - const START = 1; - function yy_r1_1($yy_subpatterns) + public function yy_r1_1($yy_subpatterns) { $this->token = Smarty_Internal_Configfileparser::TPC_COMMENTSTART; $this->yypushstate(self::COMMENT); } - function yy_r1_2($yy_subpatterns) + public function yy_r1_2($yy_subpatterns) { $this->token = Smarty_Internal_Configfileparser::TPC_OPENB; $this->yypushstate(self::SECTION); } - function yy_r1_3($yy_subpatterns) + public function yy_r1_3($yy_subpatterns) { $this->token = Smarty_Internal_Configfileparser::TPC_CLOSEB; } - function yy_r1_4($yy_subpatterns) + public function yy_r1_4($yy_subpatterns) { $this->token = Smarty_Internal_Configfileparser::TPC_EQUAL; $this->yypushstate(self::VALUE); } - function yy_r1_5($yy_subpatterns) + public function yy_r1_5($yy_subpatterns) { - return false; } - function yy_r1_6($yy_subpatterns) + public function yy_r1_6($yy_subpatterns) { $this->token = Smarty_Internal_Configfileparser::TPC_NEWLINE; } - function yy_r1_7($yy_subpatterns) + public function yy_r1_7($yy_subpatterns) { $this->token = Smarty_Internal_Configfileparser::TPC_ID; } - function yy_r1_8($yy_subpatterns) + public function yy_r1_8($yy_subpatterns) { $this->token = Smarty_Internal_Configfileparser::TPC_OTHER; } - - - function yylex2() + public function yylex2() { $tokenMap = array ( 1 => 0, @@ -246,62 +237,61 @@ class Smarty_Internal_Configfilelexer } // end function - const VALUE = 2; - function yy_r2_1($yy_subpatterns) + public function yy_r2_1($yy_subpatterns) { - return false; } - function yy_r2_2($yy_subpatterns) + public function yy_r2_2($yy_subpatterns) { $this->token = Smarty_Internal_Configfileparser::TPC_FLOAT; $this->yypopstate(); } - function yy_r2_3($yy_subpatterns) + public function yy_r2_3($yy_subpatterns) { $this->token = Smarty_Internal_Configfileparser::TPC_INT; $this->yypopstate(); } - function yy_r2_4($yy_subpatterns) + public function yy_r2_4($yy_subpatterns) { $this->token = Smarty_Internal_Configfileparser::TPC_TRIPPLE_QUOTES; $this->yypushstate(self::TRIPPLE); } - function yy_r2_5($yy_subpatterns) + public function yy_r2_5($yy_subpatterns) { $this->token = Smarty_Internal_Configfileparser::TPC_SINGLE_QUOTED_STRING; $this->yypopstate(); } - function yy_r2_6($yy_subpatterns) + public function yy_r2_6($yy_subpatterns) { $this->token = Smarty_Internal_Configfileparser::TPC_DOUBLE_QUOTED_STRING; $this->yypopstate(); } - function yy_r2_7($yy_subpatterns) + public function yy_r2_7($yy_subpatterns) { if (!$this->smarty->config_booleanize || !in_array(strtolower($this->value), Array("true", "false", "on", "off", "yes", "no")) ) { $this->yypopstate(); $this->yypushstate(self::NAKED_STRING_VALUE); + return true; //reprocess in new state } else { $this->token = Smarty_Internal_Configfileparser::TPC_BOOL; $this->yypopstate(); } } - function yy_r2_8($yy_subpatterns) + public function yy_r2_8($yy_subpatterns) { $this->token = Smarty_Internal_Configfileparser::TPC_NAKED_STRING; $this->yypopstate(); } - function yy_r2_9($yy_subpatterns) + public function yy_r2_9($yy_subpatterns) { $this->token = Smarty_Internal_Configfileparser::TPC_NAKED_STRING; @@ -309,9 +299,7 @@ class Smarty_Internal_Configfilelexer $this->yypopstate(); } - - - function yylex3() + public function yylex3() { $tokenMap = array ( 1 => 0, @@ -367,18 +355,15 @@ class Smarty_Internal_Configfilelexer } // end function - const NAKED_STRING_VALUE = 3; - function yy_r3_1($yy_subpatterns) + public function yy_r3_1($yy_subpatterns) { $this->token = Smarty_Internal_Configfileparser::TPC_NAKED_STRING; $this->yypopstate(); } - - - function yylex4() + public function yylex4() { $tokenMap = array ( 1 => 0, @@ -436,28 +421,24 @@ class Smarty_Internal_Configfilelexer } // end function - const COMMENT = 4; - function yy_r4_1($yy_subpatterns) + public function yy_r4_1($yy_subpatterns) { - return false; } - function yy_r4_2($yy_subpatterns) + public function yy_r4_2($yy_subpatterns) { $this->token = Smarty_Internal_Configfileparser::TPC_NAKED_STRING; } - function yy_r4_3($yy_subpatterns) + public function yy_r4_3($yy_subpatterns) { $this->token = Smarty_Internal_Configfileparser::TPC_NEWLINE; $this->yypopstate(); } - - - function yylex5() + public function yylex5() { $tokenMap = array ( 1 => 0, @@ -514,22 +495,20 @@ class Smarty_Internal_Configfilelexer } // end function - const SECTION = 5; - function yy_r5_1($yy_subpatterns) + public function yy_r5_1($yy_subpatterns) { $this->token = Smarty_Internal_Configfileparser::TPC_DOT; } - function yy_r5_2($yy_subpatterns) + public function yy_r5_2($yy_subpatterns) { $this->token = Smarty_Internal_Configfileparser::TPC_SECTION; $this->yypopstate(); } - - function yylex6() + public function yylex6() { $tokenMap = array ( 1 => 0, @@ -586,16 +565,15 @@ class Smarty_Internal_Configfilelexer } // end function - const TRIPPLE = 6; - function yy_r6_1($yy_subpatterns) + public function yy_r6_1($yy_subpatterns) { $this->token = Smarty_Internal_Configfileparser::TPC_TRIPPLE_QUOTES_END; $this->yypopstate(); $this->yypushstate(self::START); } - function yy_r6_2($yy_subpatterns) + public function yy_r6_2($yy_subpatterns) { if ($this->mbstring_overload) { @@ -617,6 +595,4 @@ class Smarty_Internal_Configfilelexer $this->token = Smarty_Internal_Configfileparser::TPC_TRIPPLE_TEXT; } - } -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_configfileparser.php b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_configfileparser.php similarity index 91% rename from lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_configfileparser.php rename to lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_configfileparser.php index 784bc684..99cd2e18 100644 --- a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_configfileparser.php +++ b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_configfileparser.php @@ -14,7 +14,7 @@ class TPC_yyToken implements ArrayAccess public $string = ''; public $metadata = array(); - function __construct($s, $m = array()) + public function __construct($s, $m = array()) { if ($s instanceof TPC_yyToken) { $this->string = $s->string; @@ -29,28 +29,29 @@ class TPC_yyToken implements ArrayAccess } } - function __toString() + public function __toString() { return $this->_string; } - function offsetExists($offset) + public function offsetExists($offset) { return isset($this->metadata[$offset]); } - function offsetGet($offset) + public function offsetGet($offset) { return $this->metadata[$offset]; } - function offsetSet($offset, $value) + public function offsetSet($offset, $value) { if ($offset === null) { if (isset($value[0])) { $x = ($value instanceof TPC_yyToken) ? $value->metadata : $value; $this->metadata = array_merge($this->metadata, $x); + return; } $offset = count($this->metadata); @@ -67,7 +68,7 @@ class TPC_yyToken implements ArrayAccess } } - function offsetUnset($offset) + public function offsetUnset($offset) { unset($this->metadata[$offset]); } @@ -82,7 +83,6 @@ class TPC_yyStackEntry ** is the value of the token */ }; - #line 12 "smarty_internal_configfileparser.y" class Smarty_Internal_Configfileparser#line 79 "smarty_internal_configfileparser.php" { @@ -94,7 +94,8 @@ class Smarty_Internal_Configfileparser#line 79 "smarty_internal_configfileparser private $lex; private $internalError = false; - function __construct($lex, $compiler) { + public function __construct($lex, $compiler) + { // set instance object self::instance($this); $this->lex = $lex; @@ -106,21 +107,25 @@ class Smarty_Internal_Configfileparser#line 79 "smarty_internal_configfileparser static $instance = null; if (isset($new_instance) && is_object($new_instance)) $instance = $new_instance; + return $instance; } - private function parse_bool($str) { + private function parse_bool($str) + { if (in_array(strtolower($str) ,array('on','yes','true'))) { $res = true; } else { $res = false; } + return $res; } private static $escapes_single = Array('\\' => '\\', '\'' => '\''); - private static function parse_single_quoted_string($qstr) { + private static function parse_single_quoted_string($qstr) + { $escaped_string = substr($qstr, 1, strlen($qstr)-2); //remove outer quotes $ss = preg_split('/(\\\\.)/', $escaped_string, -1, PREG_SPLIT_DELIM_CAPTURE); @@ -139,16 +144,20 @@ class Smarty_Internal_Configfileparser#line 79 "smarty_internal_configfileparser return $str; } - private static function parse_double_quoted_string($qstr) { + private static function parse_double_quoted_string($qstr) + { $inner_str = substr($qstr, 1, strlen($qstr)-2); + return stripcslashes($inner_str); } - private static function parse_tripple_double_quoted_string($qstr) { + private static function parse_tripple_double_quoted_string($qstr) + { return stripcslashes($qstr); } - private function set_var(Array $var, Array &$target_array) { + private function set_var(Array $var, Array &$target_array) + { $key = $var["key"]; $value = $var["value"]; @@ -160,7 +169,8 @@ class Smarty_Internal_Configfileparser#line 79 "smarty_internal_configfileparser } } - private function add_global_vars(Array $vars) { + private function add_global_vars(Array $vars) + { if (!isset($this->compiler->config_data['vars'])) { $this->compiler->config_data['vars'] = Array(); } @@ -169,7 +179,8 @@ class Smarty_Internal_Configfileparser#line 79 "smarty_internal_configfileparser } } - private function add_section_vars($section_name, Array $vars) { + private function add_section_vars($section_name, Array $vars) + { if (!isset($this->compiler->config_data['sections'][$section_name]['vars'])) { $this->compiler->config_data['sections'][$section_name]['vars'] = Array(); } @@ -208,7 +219,7 @@ static public $yy_action = array( /* 20 */ 15, 17, 23, 18, 27, 26, 4, 5, 6, 32, /* 30 */ 2, 11, 28, 22, 16, 9, 7, 10, ); - static public $yy_lookahead = array( + public static $yy_lookahead = array( /* 0 */ 7, 8, 9, 10, 11, 12, 5, 27, 15, 16, /* 10 */ 20, 21, 23, 23, 17, 18, 13, 14, 17, 18, /* 20 */ 15, 2, 17, 4, 25, 26, 6, 3, 3, 14, @@ -216,17 +227,17 @@ static public $yy_action = array( ); const YY_SHIFT_USE_DFLT = -8; const YY_SHIFT_MAX = 19; - static public $yy_shift_ofst = array( + public static $yy_shift_ofst = array( /* 0 */ -8, 1, 1, 1, -7, -3, -3, 30, -8, -8, /* 10 */ -8, 19, 5, 3, 15, 16, 24, 25, 32, 20, ); const YY_REDUCE_USE_DFLT = -21; const YY_REDUCE_MAX = 10; - static public $yy_reduce_ofst = array( + public static $yy_reduce_ofst = array( /* 0 */ -10, -1, -1, -1, -20, 10, 12, 8, 14, 7, /* 10 */ -11, ); - static public $yyExpectedTokens = array( + public static $yyExpectedTokens = array( /* 0 */ array(), /* 1 */ array(5, 17, 18, ), /* 2 */ array(5, 17, 18, ), @@ -264,7 +275,7 @@ static public $yy_action = array( /* 34 */ array(), /* 35 */ array(), ); - static public $yy_default = array( + public static $yy_default = array( /* 0 */ 44, 37, 41, 40, 58, 58, 58, 36, 39, 44, /* 10 */ 44, 58, 58, 58, 58, 58, 58, 58, 58, 58, /* 20 */ 55, 54, 57, 56, 50, 45, 43, 42, 38, 46, @@ -277,9 +288,9 @@ static public $yy_action = array( const YYERRORSYMBOL = 19; const YYERRSYMDT = 'yy0'; const YYFALLBACK = 0; - static public $yyFallback = array( + public static $yyFallback = array( ); - static function Trace($TraceFILE, $zTracePrompt) + public static function Trace($TraceFILE, $zTracePrompt) { if (!$TraceFILE) { $zTracePrompt = 0; @@ -290,14 +301,14 @@ static public $yy_action = array( self::$yyTracePrompt = $zTracePrompt; } - static function PrintTrace() + public static function PrintTrace() { self::$yyTraceFILE = fopen('php://output', 'w'); self::$yyTracePrompt = ''; } - static public $yyTraceFILE; - static public $yyTracePrompt; + public static $yyTraceFILE; + public static $yyTracePrompt; public $yyidx; /* Index of top element in stack */ public $yyerrcnt; /* Shifts left before out of the error */ public $yystack = array(); /* The parser's stack */ @@ -312,7 +323,7 @@ static public $yy_action = array( 'section', 'newline', 'var', 'value', ); - static public $yyRuleName = array( + public static $yyRuleName = array( /* 0 */ "start ::= global_vars sections", /* 1 */ "global_vars ::= var_list", /* 2 */ "sections ::= sections section", @@ -337,7 +348,7 @@ static public $yy_action = array( /* 21 */ "newline ::= COMMENTSTART NAKED_STRING NEWLINE", ); - function tokenName($tokenType) + public function tokenName($tokenType) { if ($tokenType === 0) { return 'End of Input'; @@ -349,14 +360,14 @@ static public $yy_action = array( } } - static function yy_destructor($yymajor, $yypminor) + public static function yy_destructor($yymajor, $yypminor) { switch ($yymajor) { default: break; /* If no destructor action specified: do nothing */ } } - function yy_pop_parser_stack() + public function yy_pop_parser_stack() { if (!count($this->yystack)) { return; @@ -370,10 +381,11 @@ static public $yy_action = array( $yymajor = $yytos->major; self::yy_destructor($yymajor, $yytos->minor); $this->yyidx--; + return $yymajor; } - function __destruct() + public function __destruct() { while ($this->yystack !== Array()) { $this->yy_pop_parser_stack(); @@ -383,7 +395,7 @@ static public $yy_action = array( } } - function yy_get_expected_tokens($token) + public function yy_get_expected_tokens($token) { $state = $this->yystack[$this->yyidx]->stateno; $expected = self::$yyExpectedTokens[$state]; @@ -411,11 +423,12 @@ static public $yy_action = array( $this->yystack[$this->yyidx]->stateno, self::$yyRuleInfo[$yyruleno]['lhs']); if (isset(self::$yyExpectedTokens[$nextstate])) { - $expected = array_merge($expected, self::$yyExpectedTokens[$nextstate]); + $expected = array_merge($expected, self::$yyExpectedTokens[$nextstate]); if (in_array($token, self::$yyExpectedTokens[$nextstate], true)) { $this->yyidx = $yyidx; $this->yystack = $stack; + return array_unique($expected); } } @@ -446,12 +459,13 @@ static public $yy_action = array( } break; } while (true); - $this->yyidx = $yyidx; - $this->yystack = $stack; + $this->yyidx = $yyidx; + $this->yystack = $stack; + return array_unique($expected); } - function yy_is_expected_token($token) + public function yy_is_expected_token($token) { if ($token === 0) { return true; // 0 is not part of this @@ -484,6 +498,7 @@ static public $yy_action = array( in_array($token, self::$yyExpectedTokens[$nextstate], true)) { $this->yyidx = $yyidx; $this->yystack = $stack; + return true; } if ($nextstate < self::YYNSTATE) { @@ -519,10 +534,11 @@ static public $yy_action = array( } while (true); $this->yyidx = $yyidx; $this->yystack = $stack; + return true; } - function yy_find_shift_action($iLookAhead) + public function yy_find_shift_action($iLookAhead) { $stateno = $this->yystack[$this->yyidx]->stateno; @@ -548,15 +564,17 @@ static public $yy_action = array( $this->yyTokenName[$iLookAhead] . " => " . $this->yyTokenName[$iFallback] . "\n"); } + return $this->yy_find_shift_action($iFallback); } + return self::$yy_default[$stateno]; } else { return self::$yy_action[$i]; } } - function yy_find_reduce_action($stateno, $iLookAhead) + public function yy_find_reduce_action($stateno, $iLookAhead) { /* $stateno = $this->yystack[$this->yyidx]->stateno; */ @@ -579,7 +597,7 @@ static public $yy_action = array( } } - function yy_shift($yyNewState, $yyMajor, $yypMinor) + public function yy_shift($yyNewState, $yyMajor, $yypMinor) { $this->yyidx++; if ($this->yyidx >= self::YYSTACKDEPTH) { @@ -595,6 +613,7 @@ static public $yy_action = array( $this->internalError = true; $this->compiler->trigger_config_file_error("Stack overflow in configfile parser"); #line 593 "smarty_internal_configfileparser.php" + return; } $yytos = new TPC_yyStackEntry; @@ -606,7 +625,7 @@ static public $yy_action = array( fprintf(self::$yyTraceFILE, "%sShift %d\n", self::$yyTracePrompt, $yyNewState); fprintf(self::$yyTraceFILE, "%sStack:", self::$yyTracePrompt); - for($i = 1; $i <= $this->yyidx; $i++) { + for ($i = 1; $i <= $this->yyidx; $i++) { fprintf(self::$yyTraceFILE, " %s", $this->yyTokenName[$this->yystack[$i]->major]); } @@ -614,7 +633,7 @@ static public $yy_action = array( } } - static public $yyRuleInfo = array( + public static $yyRuleInfo = array( array( 'lhs' => 20, 'rhs' => 2 ), array( 'lhs' => 21, 'rhs' => 1 ), array( 'lhs' => 22, 'rhs' => 2 ), @@ -639,7 +658,7 @@ static public $yy_action = array( array( 'lhs' => 25, 'rhs' => 3 ), ); - static public $yyReduceMap = array( + public static $yyReduceMap = array( 0 => 0, 2 => 0, 3 => 0, @@ -664,23 +683,27 @@ static public $yy_action = array( 18 => 17, ); #line 131 "smarty_internal_configfileparser.y" - function yy_r0(){ + public function yy_r0() + { $this->_retvalue = null; } #line 666 "smarty_internal_configfileparser.php" #line 136 "smarty_internal_configfileparser.y" - function yy_r1(){ + public function yy_r1() + { $this->add_global_vars($this->yystack[$this->yyidx + 0]->minor); $this->_retvalue = null; } #line 671 "smarty_internal_configfileparser.php" #line 149 "smarty_internal_configfileparser.y" - function yy_r4(){ + public function yy_r4() + { $this->add_section_vars($this->yystack[$this->yyidx + -3]->minor, $this->yystack[$this->yyidx + 0]->minor); $this->_retvalue = null; } #line 677 "smarty_internal_configfileparser.php" #line 154 "smarty_internal_configfileparser.y" - function yy_r5(){ + public function yy_r5() + { if ($this->smarty->config_read_hidden) { $this->add_section_vars($this->yystack[$this->yyidx + -3]->minor, $this->yystack[$this->yyidx + 0]->minor); } @@ -688,69 +711,81 @@ static public $yy_action = array( } #line 685 "smarty_internal_configfileparser.php" #line 162 "smarty_internal_configfileparser.y" - function yy_r6(){ + public function yy_r6() + { $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor; } #line 690 "smarty_internal_configfileparser.php" #line 166 "smarty_internal_configfileparser.y" - function yy_r7(){ + public function yy_r7() + { $this->_retvalue = array_merge($this->yystack[$this->yyidx + -1]->minor, Array($this->yystack[$this->yyidx + 0]->minor)); } #line 695 "smarty_internal_configfileparser.php" #line 170 "smarty_internal_configfileparser.y" - function yy_r8(){ + public function yy_r8() + { $this->_retvalue = Array(); } #line 700 "smarty_internal_configfileparser.php" #line 176 "smarty_internal_configfileparser.y" - function yy_r9(){ + public function yy_r9() + { $this->_retvalue = Array("key" => $this->yystack[$this->yyidx + -2]->minor, "value" => $this->yystack[$this->yyidx + 0]->minor); } #line 705 "smarty_internal_configfileparser.php" #line 181 "smarty_internal_configfileparser.y" - function yy_r10(){ + public function yy_r10() + { $this->_retvalue = (float) $this->yystack[$this->yyidx + 0]->minor; } #line 710 "smarty_internal_configfileparser.php" #line 185 "smarty_internal_configfileparser.y" - function yy_r11(){ + public function yy_r11() + { $this->_retvalue = (int) $this->yystack[$this->yyidx + 0]->minor; } #line 715 "smarty_internal_configfileparser.php" #line 189 "smarty_internal_configfileparser.y" - function yy_r12(){ + public function yy_r12() + { $this->_retvalue = $this->parse_bool($this->yystack[$this->yyidx + 0]->minor); } #line 720 "smarty_internal_configfileparser.php" #line 193 "smarty_internal_configfileparser.y" - function yy_r13(){ + public function yy_r13() + { $this->_retvalue = self::parse_single_quoted_string($this->yystack[$this->yyidx + 0]->minor); } #line 725 "smarty_internal_configfileparser.php" #line 197 "smarty_internal_configfileparser.y" - function yy_r14(){ + public function yy_r14() + { $this->_retvalue = self::parse_double_quoted_string($this->yystack[$this->yyidx + 0]->minor); } #line 730 "smarty_internal_configfileparser.php" #line 201 "smarty_internal_configfileparser.y" - function yy_r15(){ + public function yy_r15() + { $this->_retvalue = self::parse_tripple_double_quoted_string($this->yystack[$this->yyidx + -1]->minor); } #line 735 "smarty_internal_configfileparser.php" #line 205 "smarty_internal_configfileparser.y" - function yy_r16(){ + public function yy_r16() + { $this->_retvalue = ''; } #line 740 "smarty_internal_configfileparser.php" #line 209 "smarty_internal_configfileparser.y" - function yy_r17(){ + public function yy_r17() + { $this->_retvalue = $this->yystack[$this->yyidx + 0]->minor; } #line 745 "smarty_internal_configfileparser.php" private $_retvalue; - function yy_reduce($yyruleno) + public function yy_reduce($yyruleno) { $yymsp = $this->yystack[$this->yyidx]; if (self::$yyTraceFILE && $yyruleno >= 0 @@ -770,7 +805,7 @@ static public $yy_action = array( $yygoto = self::$yyRuleInfo[$yyruleno]['lhs']; $yysize = self::$yyRuleInfo[$yyruleno]['rhs']; $this->yyidx -= $yysize; - for($i = $yysize; $i; $i--) { + for ($i = $yysize; $i; $i--) { // pop all of the right-hand side parameters array_pop($this->yystack); } @@ -791,17 +826,16 @@ static public $yy_action = array( } } - function yy_parse_failed() + public function yy_parse_failed() { if (self::$yyTraceFILE) { fprintf(self::$yyTraceFILE, "%sFail!\n", self::$yyTracePrompt); - } - while ($this->yyidx >= 0) { + } while ($this->yyidx >= 0) { $this->yy_pop_parser_stack(); } } - function yy_syntax_error($yymajor, $TOKEN) + public function yy_syntax_error($yymajor, $TOKEN) { #line 118 "smarty_internal_configfileparser.y" @@ -811,12 +845,11 @@ static public $yy_action = array( #line 808 "smarty_internal_configfileparser.php" } - function yy_accept() + public function yy_accept() { if (self::$yyTraceFILE) { fprintf(self::$yyTraceFILE, "%sAccept!\n", self::$yyTracePrompt); - } - while ($this->yyidx >= 0) { + } while ($this->yyidx >= 0) { $stack = $this->yy_pop_parser_stack(); } #line 110 "smarty_internal_configfileparser.y" @@ -828,7 +861,7 @@ static public $yy_action = array( #line 826 "smarty_internal_configfileparser.php" } - function doParse($yymajor, $yytokenvalue) + public function doParse($yymajor, $yytokenvalue) { $yyerrorhit = 0; /* True if yymajor has invoked an error */ @@ -875,7 +908,7 @@ static public $yy_action = array( $this->yy_syntax_error($yymajor, $yytokenvalue); } $yymx = $this->yystack[$this->yyidx]->major; - if ($yymx == self::YYERRORSYMBOL || $yyerrorhit ){ + if ($yymx == self::YYERRORSYMBOL || $yyerrorhit) { if (self::$yyTraceFILE) { fprintf(self::$yyTraceFILE, "%sDiscard input token %s\n", self::$yyTracePrompt, $this->yyTokenName[$yymajor]); @@ -918,4 +951,3 @@ static public $yy_action = array( } while ($yymajor != self::YYNOCODE && $this->yyidx >= 0); } } -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_data.php b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_data.php similarity index 84% rename from lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_data.php rename to lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_data.php index 1d7b1d33..fc9ab845 100644 --- a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_data.php +++ b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_data.php @@ -15,8 +15,8 @@ * @package Smarty * @subpackage Template */ -class Smarty_Internal_Data { - +class Smarty_Internal_Data +{ /** * name of class used for templates * @@ -45,10 +45,10 @@ class Smarty_Internal_Data { /** * assigns a Smarty variable * - * @param array|string $tpl_var the template variable name(s) - * @param mixed $value the value to assign - * @param boolean $nocache if true any output of this variable will be not cached - * @param boolean $scope the scope the variable will have (local,parent or root) + * @param array|string $tpl_var the template variable name(s) + * @param mixed $value the value to assign + * @param boolean $nocache if true any output of this variable will be not cached + * @param boolean $scope the scope the variable will have (local,parent or root) * @return Smarty_Internal_Data current Smarty_Internal_Data (or Smarty or Smarty_Internal_Template) instance for chaining */ public function assign($tpl_var, $value = null, $nocache = false) @@ -71,9 +71,9 @@ class Smarty_Internal_Data { /** * assigns a global Smarty variable * - * @param string $varname the global variable name - * @param mixed $value the value to assign - * @param boolean $nocache if true any output of this variable will be not cached + * @param string $varname the global variable name + * @param mixed $value the value to assign + * @param boolean $nocache if true any output of this variable will be not cached * @return Smarty_Internal_Data current Smarty_Internal_Data (or Smarty or Smarty_Internal_Template) instance for chaining */ public function assignGlobal($varname, $value = null, $nocache = false) @@ -94,7 +94,7 @@ class Smarty_Internal_Data { * * @param string $tpl_var the template variable name * @param mixed $ &$value the referenced value to assign - * @param boolean $nocache if true any output of this variable will be not cached + * @param boolean $nocache if true any output of this variable will be not cached * @return Smarty_Internal_Data current Smarty_Internal_Data (or Smarty or Smarty_Internal_Template) instance for chaining */ public function assignByRef($tpl_var, &$value, $nocache = false) @@ -110,10 +110,10 @@ class Smarty_Internal_Data { /** * appends values to template variables * - * @param array|string $tpl_var the template variable name(s) - * @param mixed $value the value to append - * @param boolean $merge flag if array elements shall be merged - * @param boolean $nocache if true any output of this variable will be not cached + * @param array|string $tpl_var the template variable name(s) + * @param mixed $value the value to append + * @param boolean $merge flag if array elements shall be merged + * @param boolean $nocache if true any output of this variable will be not cached * @return Smarty_Internal_Data current Smarty_Internal_Data (or Smarty or Smarty_Internal_Template) instance for chaining */ public function append($tpl_var, $value = null, $merge = false, $nocache = false) @@ -134,7 +134,7 @@ class Smarty_Internal_Data { settype($this->tpl_vars[$_key]->value, 'array'); } if ($merge && is_array($_val)) { - foreach($_val as $_mkey => $_mval) { + foreach ($_val as $_mkey => $_mval) { $this->tpl_vars[$_key]->value[$_mkey] = $_mval; } } else { @@ -156,7 +156,7 @@ class Smarty_Internal_Data { settype($this->tpl_vars[$tpl_var]->value, 'array'); } if ($merge && is_array($value)) { - foreach($value as $_mkey => $_mval) { + foreach ($value as $_mkey => $_mval) { $this->tpl_vars[$tpl_var]->value[$_mkey] = $_mval; } } else { @@ -171,9 +171,9 @@ class Smarty_Internal_Data { /** * appends values to template variables by reference * - * @param string $tpl_var the template variable name - * @param mixed &$value the referenced value to append - * @param boolean $merge flag if array elements shall be merged + * @param string $tpl_var the template variable name + * @param mixed &$value the referenced value to append + * @param boolean $merge flag if array elements shall be merged * @return Smarty_Internal_Data current Smarty_Internal_Data (or Smarty or Smarty_Internal_Template) instance for chaining */ public function appendByRef($tpl_var, &$value, $merge = false) @@ -186,7 +186,7 @@ class Smarty_Internal_Data { settype($this->tpl_vars[$tpl_var]->value, 'array'); } if ($merge && is_array($value)) { - foreach($value as $_key => $_val) { + foreach ($value as $_key => $_val) { $this->tpl_vars[$tpl_var]->value[$_key] = &$value[$_key]; } } else { @@ -200,10 +200,10 @@ class Smarty_Internal_Data { /** * Returns a single or all template variables * - * @param string $varname variable name or null - * @param string $_ptr optional pointer to data object - * @param boolean $search_parents include parent templates? - * @return string variable value or or array of variables + * @param string $varname variable name or null + * @param string $_ptr optional pointer to data object + * @param boolean $search_parents include parent templates? + * @return string variable value or or array of variables */ public function getTemplateVars($varname = null, $_ptr = null, $search_parents = true) { @@ -238,6 +238,7 @@ class Smarty_Internal_Data { } } } + return $_result; } } @@ -245,7 +246,7 @@ class Smarty_Internal_Data { /** * clear the given assigned template variable. * - * @param string|array $tpl_var the template variable(s) to clear + * @param string|array $tpl_var the template variable(s) to clear * @return Smarty_Internal_Data current Smarty_Internal_Data (or Smarty or Smarty_Internal_Template) instance for chaining */ public function clearAssign($tpl_var) @@ -268,14 +269,15 @@ class Smarty_Internal_Data { public function clearAllAssign() { $this->tpl_vars = array(); + return $this; } /** * load a config file, optionally load just selected sections * - * @param string $config_file filename - * @param mixed $sections array of section names, single section or null + * @param string $config_file filename + * @param mixed $sections array of section names, single section or null * @return Smarty_Internal_Data current Smarty_Internal_Data (or Smarty or Smarty_Internal_Template) instance for chaining */ public function configLoad($config_file, $sections = null) @@ -283,16 +285,17 @@ class Smarty_Internal_Data { // load Config class $config = new Smarty_Internal_Config($config_file, $this->smarty, $this); $config->loadConfigVars($sections); + return $this; } /** * gets the object of a Smarty variable * - * @param string $variable the name of the Smarty variable - * @param object $_ptr optional pointer to data object - * @param boolean $search_parents search also in parent data - * @return object the object of the variable + * @param string $variable the name of the Smarty variable + * @param object $_ptr optional pointer to data object + * @param boolean $search_parents search also in parent data + * @return object the object of the variable */ public function getVariable($variable, $_ptr = null, $search_parents = true, $error_enable = true) { @@ -318,14 +321,15 @@ class Smarty_Internal_Data { // force a notice $x = $$variable; } + return new Undefined_Smarty_Variable; } /** * gets a config variable * - * @param string $variable the name of the config variable - * @return mixed the value of the config variable + * @param string $variable the name of the config variable + * @return mixed the value of the config variable */ public function getConfigVariable($variable, $error_enable = true) { @@ -342,14 +346,15 @@ class Smarty_Internal_Data { // force a notice $x = $$variable; } + return null; } /** * gets a stream variable * - * @param string $variable the stream of the variable - * @return mixed the value of the stream variable + * @param string $variable the stream of the variable + * @return mixed the value of the stream variable */ public function getStreamVariable($variable) { @@ -360,6 +365,7 @@ class Smarty_Internal_Data { $_result .= $current_line; } fclose($fp); + return $_result; } @@ -373,7 +379,7 @@ class Smarty_Internal_Data { /** * Returns a single or all config variables * - * @param string $varname variable name or null + * @param string $varname variable name or null * @return string variable value or or array of variables */ public function getConfigVars($varname = null, $search_parents = true) @@ -405,7 +411,7 @@ class Smarty_Internal_Data { /** * Deassigns a single or all config variables * - * @param string $varname variable name or null + * @param string $varname variable name or null * @return Smarty_Internal_Data current Smarty_Internal_Data (or Smarty or Smarty_Internal_Template) instance for chaining */ public function clearConfig($varname = null) @@ -415,6 +421,7 @@ class Smarty_Internal_Data { } else { $this->config_vars = array(); } + return $this; } @@ -428,8 +435,8 @@ class Smarty_Internal_Data { * @package Smarty * @subpackage Template */ -class Smarty_Data extends Smarty_Internal_Data { - +class Smarty_Data extends Smarty_Internal_Data +{ /** * Smarty object * @@ -440,8 +447,8 @@ class Smarty_Data extends Smarty_Internal_Data { /** * create Smarty data object * - * @param Smarty|array $_parent parent template - * @param Smarty $smarty global smarty instance + * @param Smarty|array $_parent parent template + * @param Smarty $smarty global smarty instance */ public function __construct ($_parent = null, $smarty = null) { @@ -469,8 +476,8 @@ class Smarty_Data extends Smarty_Internal_Data { * @package Smarty * @subpackage Template */ -class Smarty_Variable { - +class Smarty_Variable +{ /** * template variable * @@ -524,12 +531,12 @@ class Smarty_Variable { * @package Smarty * @subpackage Template */ -class Undefined_Smarty_Variable { - +class Undefined_Smarty_Variable +{ /** * Returns FALSE for 'nocache' and NULL otherwise. * - * @param string $name + * @param string $name * @return bool */ public function __get($name) @@ -552,5 +559,3 @@ class Undefined_Smarty_Variable { } } - -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_debug.php b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_debug.php similarity index 74% rename from lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_debug.php rename to lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_debug.php index 2aea13f3..6239eb6a 100644 --- a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_debug.php +++ b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_debug.php @@ -15,8 +15,8 @@ * @package Smarty * @subpackage Debug */ -class Smarty_Internal_Debug extends Smarty_Internal_Data { - +class Smarty_Internal_Debug extends Smarty_Internal_Data +{ /** * template data * @@ -24,6 +24,27 @@ class Smarty_Internal_Debug extends Smarty_Internal_Data { */ public static $template_data = array(); + /** + * List of uid's which shall be ignored + * + * @var array + */ + public static $ignore_uid = array(); + + /** + * Ignore template + * + * @param object $template + */ + public static function ignore($template) + { + // calculate Uid if not already done + if ($template->source->uid == '') { + $template->source->filepath; + } + self::$ignore_uid[$template->source->uid] = true; + } + /** * Start logging of compile time * @@ -31,7 +52,25 @@ class Smarty_Internal_Debug extends Smarty_Internal_Data { */ public static function start_compile($template) { - $key = self::get_key($template); + static $_is_stringy = array('string' => true, 'eval' => true); + if (!empty($template->compiler->trace_uid)) { + $key = $template->compiler->trace_uid; + if (!isset(self::$template_data[$key])) { + if (isset($_is_stringy[$template->source->type])) { + self::$template_data[$key]['name'] = '\'' . substr($template->source->name, 0, 25) . '...\''; + } else { + self::$template_data[$key]['name'] = $template->source->filepath; + } + self::$template_data[$key]['compile_time'] = 0; + self::$template_data[$key]['render_time'] = 0; + self::$template_data[$key]['cache_time'] = 0; + } + } else { + if (isset(self::$ignore_uid[$template->source->uid])) { + return; + } + $key = self::get_key($template); + } self::$template_data[$key]['start_time'] = microtime(true); } @@ -42,7 +81,15 @@ class Smarty_Internal_Debug extends Smarty_Internal_Data { */ public static function end_compile($template) { - $key = self::get_key($template); + if (!empty($template->compiler->trace_uid)) { + $key = $template->compiler->trace_uid; + } else { + if (isset(self::$ignore_uid[$template->source->uid])) { + return; + } + + $key = self::get_key($template); + } self::$template_data[$key]['compile_time'] += microtime(true) - self::$template_data[$key]['start_time']; } @@ -115,6 +162,7 @@ class Smarty_Internal_Debug extends Smarty_Internal_Data { $smarty->left_delimiter = '{'; $smarty->right_delimiter = '}'; $smarty->debugging = false; + $smarty->debugging_ctrl = 'NONE'; $smarty->force_compile = false; $_template = new Smarty_Internal_Template($smarty->debug_tpl, $smarty); $_template->caching = false; @@ -138,7 +186,7 @@ class Smarty_Internal_Debug extends Smarty_Internal_Data { /** * Recursively gets variables from all template/data scopes * - * @param Smarty_Internal_Template|Smarty_Data $obj object to debug + * @param Smarty_Internal_Template|Smarty_Data $obj object to debug * @return StdClass */ public static function get_debug_vars($obj) @@ -169,14 +217,15 @@ class Smarty_Internal_Debug extends Smarty_Internal_Data { } } } - return (object) array('tpl_vars' => $tpl_vars, 'config_vars' => $config_vars); + + return (object)array('tpl_vars' => $tpl_vars, 'config_vars' => $config_vars); } /** * Return key into $template_data for template * - * @param object $template template object - * @return string key into $template_data + * @param object $template template object + * @return string key into $template_data */ private static function get_key($template) { @@ -190,17 +239,16 @@ class Smarty_Internal_Debug extends Smarty_Internal_Data { return $key; } else { if (isset($_is_stringy[$template->source->type])) { - self::$template_data[$key]['name'] = '\''.substr($template->source->name,0,25).'...\''; + self::$template_data[$key]['name'] = '\'' . substr($template->source->name, 0, 25) . '...\''; } else { self::$template_data[$key]['name'] = $template->source->filepath; } self::$template_data[$key]['compile_time'] = 0; self::$template_data[$key]['render_time'] = 0; self::$template_data[$key]['cache_time'] = 0; + return $key; } } } - -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_filter_handler.php b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_filter_handler.php similarity index 82% rename from lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_filter_handler.php rename to lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_filter_handler.php index c9370e1a..3f25883c 100644 --- a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_filter_handler.php +++ b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_filter_handler.php @@ -15,8 +15,8 @@ * @package Smarty * @subpackage PluginsInternal */ -class Smarty_Internal_Filter_Handler { - +class Smarty_Internal_Filter_Handler +{ /** * Run filters over content * @@ -25,17 +25,17 @@ class Smarty_Internal_Filter_Handler { * plugin filename format: filtertype.filtername.php * Smarty2 filter plugins could be used * - * @param string $type the type of filter ('pre','post','output') which shall run - * @param string $content the content which shall be processed by the filters - * @param Smarty_Internal_Template $template template object - * @return string the filtered content + * @param string $type the type of filter ('pre','post','output') which shall run + * @param string $content the content which shall be processed by the filters + * @param Smarty_Internal_Template $template template object + * @return string the filtered content */ public static function runFilter($type, $content, Smarty_Internal_Template $template) { $output = $content; // loop over autoload filters of specified type if (!empty($template->smarty->autoload_filters[$type])) { - foreach ((array)$template->smarty->autoload_filters[$type] as $name) { + foreach ((array) $template->smarty->autoload_filters[$type] as $name) { $plugin_name = "Smarty_{$type}filter_{$name}"; if ($template->smarty->loadPlugin($plugin_name)) { if (function_exists($plugin_name)) { @@ -66,5 +66,3 @@ class Smarty_Internal_Filter_Handler { } } - -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_function_call_handler.php b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_function_call_handler.php similarity index 82% rename from lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_function_call_handler.php rename to lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_function_call_handler.php index fa4b43b2..9c0ba5ae 100644 --- a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_function_call_handler.php +++ b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_function_call_handler.php @@ -13,17 +13,17 @@ * @package Smarty * @subpackage PluginsInternal */ -class Smarty_Internal_Function_Call_Handler { - +class Smarty_Internal_Function_Call_Handler +{ /** * This function handles calls to template functions defined by {function} * It does create a PHP function at the first call * - * @param string $_name template function name - * @param Smarty_Internal_Template $_template template object - * @param array $_params Smarty variables passed as call parameter - * @param string $_hash nocache hash value - * @param bool $_nocache nocache flag + * @param string $_name template function name + * @param Smarty_Internal_Template $_template template object + * @param array $_params Smarty variables passed as call parameter + * @param string $_hash nocache hash value + * @param bool $_nocache nocache flag */ public static function call($_name, Smarty_Internal_Template $_template, $_params, $_hash, $_nocache) { @@ -51,5 +51,3 @@ class Smarty_Internal_Function_Call_Handler { } } - -?> diff --git a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_get_include_path.php b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_get_include_path.php similarity index 91% rename from lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_get_include_path.php rename to lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_get_include_path.php index bafb7213..4638a174 100644 --- a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_get_include_path.php +++ b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_get_include_path.php @@ -13,18 +13,18 @@ * @package Smarty * @subpackage PluginsInternal */ -class Smarty_Internal_Get_Include_Path { - +class Smarty_Internal_Get_Include_Path +{ /** * Return full file path from PHP include_path * - * @param string $filepath filepath + * @param string $filepath filepath * @return string|boolean full filepath or false */ public static function getIncludePath($filepath) { static $_include_path = null; - + if (function_exists('stream_resolve_include_path')) { // available since PHP 5.3.2 return stream_resolve_include_path($filepath); @@ -44,5 +44,3 @@ class Smarty_Internal_Get_Include_Path { } } - -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_nocache_insert.php b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_nocache_insert.php similarity index 73% rename from lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_nocache_insert.php rename to lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_nocache_insert.php index 64a2b1e1..5b378409 100644 --- a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_nocache_insert.php +++ b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_nocache_insert.php @@ -15,17 +15,17 @@ * @package Smarty * @subpackage Compiler */ -class Smarty_Internal_Nocache_Insert { - +class Smarty_Internal_Nocache_Insert +{ /** * Compiles code for the {insert} tag into cache file * - * @param string $_function insert function name - * @param array $_attr array with parameter - * @param Smarty_Internal_Template $_template template object - * @param string $_script script name to load or 'null' - * @param string $_assign optional variable name - * @return string compiled code + * @param string $_function insert function name + * @param array $_attr array with parameter + * @param Smarty_Internal_Template $_template template object + * @param string $_script script name to load or 'null' + * @param string $_assign optional variable name + * @return string compiled code */ public static function compile($_function, $_attr, $_template, $_script, $_assign = null) { @@ -45,9 +45,8 @@ class Smarty_Internal_Nocache_Insert { while ($_tpl->parent instanceof Smarty_Internal_Template) { $_tpl = $_tpl->parent; } + return "/*%%SmartyNocache:{$_tpl->properties['nocache_hash']}%%*/" . $_output . "/*/%%SmartyNocache:{$_tpl->properties['nocache_hash']}%%*/"; } } - -?> diff --git a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_parsetree.php b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_parsetree.php similarity index 86% rename from lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_parsetree.php rename to lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_parsetree.php index 99f4c656..10920b90 100644 --- a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_parsetree.php +++ b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_parsetree.php @@ -15,8 +15,8 @@ * @subpackage Compiler * @ignore */ -abstract class _smarty_parsetree { - +abstract class _smarty_parsetree +{ /** * Parser object * @var object @@ -31,7 +31,7 @@ abstract class _smarty_parsetree { /** * Return buffer * - * @return string buffer content + * @return string buffer content */ abstract public function to_smarty_php(); @@ -44,8 +44,8 @@ abstract class _smarty_parsetree { * @subpackage Compiler * @ignore */ -class _smarty_tag extends _smarty_parsetree { - +class _smarty_tag extends _smarty_parsetree +{ /** * Saved block nesting level * @var int @@ -55,8 +55,8 @@ class _smarty_tag extends _smarty_parsetree { /** * Create parse tree buffer for Smarty tag * - * @param object $parser parser object - * @param string $data content + * @param object $parser parser object + * @param string $data content */ public function __construct($parser, $data) { @@ -68,7 +68,7 @@ class _smarty_tag extends _smarty_parsetree { /** * Return buffer content * - * @return string content + * @return string content */ public function to_smarty_php() { @@ -82,8 +82,9 @@ class _smarty_tag extends _smarty_parsetree { */ public function assign_to_var() { - $var = sprintf('$_tmp%d', ++$this->parser->prefix_number); + $var = sprintf('$_tmp%d', ++Smarty_Internal_Templateparser::$prefix_number); $this->parser->compiler->prefix_code[] = sprintf('%s', $this->data, $var); + return $var; } @@ -96,14 +97,13 @@ class _smarty_tag extends _smarty_parsetree { * @subpackage Compiler * @ignore */ -class _smarty_code extends _smarty_parsetree { - - +class _smarty_code extends _smarty_parsetree +{ /** * Create parse tree buffer for code fragment * - * @param object $parser parser object - * @param string $data content + * @param object $parser parser object + * @param string $data content */ public function __construct($parser, $data) { @@ -114,7 +114,7 @@ class _smarty_code extends _smarty_parsetree { /** * Return buffer content in parentheses * - * @return string content + * @return string content */ public function to_smarty_php() { @@ -130,13 +130,13 @@ class _smarty_code extends _smarty_parsetree { * @subpackage Compiler * @ignore */ -class _smarty_doublequoted extends _smarty_parsetree { - +class _smarty_doublequoted extends _smarty_parsetree +{ /** * Create parse tree buffer for double quoted string subtrees * - * @param object $parser parser object - * @param _smarty_parsetree $subtree parsetree buffer + * @param object $parser parser object + * @param _smarty_parsetree $subtree parsetree buffer */ public function __construct($parser, _smarty_parsetree $subtree) { @@ -150,7 +150,7 @@ class _smarty_doublequoted extends _smarty_parsetree { /** * Append buffer to subtree * - * @param _smarty_parsetree $subtree parsetree buffer + * @param _smarty_parsetree $subtree parsetree buffer */ public function append_subtree(_smarty_parsetree $subtree) { @@ -174,7 +174,7 @@ class _smarty_doublequoted extends _smarty_parsetree { /** * Merge subtree buffer content together * - * @return string compiled template code + * @return string compiled template code */ public function to_smarty_php() { @@ -195,6 +195,7 @@ class _smarty_doublequoted extends _smarty_parsetree { $this->parser->compiler->has_variable_string = true; } } + return $code; } @@ -207,14 +208,13 @@ class _smarty_doublequoted extends _smarty_parsetree { * @subpackage Compiler * @ignore */ -class _smarty_dq_content extends _smarty_parsetree { - - +class _smarty_dq_content extends _smarty_parsetree +{ /** * Create parse tree buffer with string content * - * @param object $parser parser object - * @param string $data string section + * @param object $parser parser object + * @param string $data string section */ public function __construct($parser, $data) { @@ -241,8 +241,8 @@ class _smarty_dq_content extends _smarty_parsetree { * @subpackage Compiler * @ignore */ -class _smarty_template_buffer extends _smarty_parsetree { - +class _smarty_template_buffer extends _smarty_parsetree +{ /** * Array of template elements * @@ -253,7 +253,7 @@ class _smarty_template_buffer extends _smarty_parsetree { /** * Create root of parse tree for template elements * - * @param object $parser parse object + * @param object $parser parse object */ public function __construct($parser) { @@ -320,6 +320,7 @@ class _smarty_template_buffer extends _smarty_parsetree { } $code .= $this->subtrees[$key]->to_smarty_php(); } + return $code; } @@ -332,14 +333,13 @@ class _smarty_template_buffer extends _smarty_parsetree { * @subpackage Compiler * @ignore */ -class _smarty_text extends _smarty_parsetree { - - +class _smarty_text extends _smarty_parsetree +{ /** * Create template text buffer * - * @param object $parser parser object - * @param string $data text + * @param object $parser parser object + * @param string $data text */ public function __construct($parser, $data) { @@ -366,13 +366,13 @@ class _smarty_text extends _smarty_parsetree { * @subpackage Compiler * @ignore */ -class _smarty_linebreak extends _smarty_parsetree { - +class _smarty_linebreak extends _smarty_parsetree +{ /** * Create buffer with linebreak content * - * @param object $parser parser object - * @param string $data linebreak string + * @param object $parser parser object + * @param string $data linebreak string */ public function __construct($parser, $data) { @@ -391,5 +391,3 @@ class _smarty_linebreak extends _smarty_parsetree { } } - -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_resource_eval.php b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_resource_eval.php similarity index 76% rename from lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_resource_eval.php rename to lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_resource_eval.php index c025dc26..7b19a913 100644 --- a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_resource_eval.php +++ b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_resource_eval.php @@ -18,13 +18,13 @@ * @package Smarty * @subpackage TemplateResources */ -class Smarty_Internal_Resource_Eval extends Smarty_Resource_Recompiled { - +class Smarty_Internal_Resource_Eval extends Smarty_Resource_Recompiled +{ /** * populate Source Object with meta data from Resource * - * @param Smarty_Template_Source $source source object - * @param Smarty_Internal_Template $_template template object + * @param Smarty_Template_Source $source source object + * @param Smarty_Internal_Template $_template template object * @return void */ public function populate(Smarty_Template_Source $source, Smarty_Internal_Template $_template=null) @@ -38,18 +38,18 @@ class Smarty_Internal_Resource_Eval extends Smarty_Resource_Recompiled { * Load template's source from $resource_name into current template object * * @uses decode() to decode base64 and urlencoded template_resources - * @param Smarty_Template_Source $source source object - * @return string template source + * @param Smarty_Template_Source $source source object + * @return string template source */ public function getContent(Smarty_Template_Source $source) { return $this->decode($source->name); } - + /** * decode base64 and urlencode * - * @param string $string template_resource to decode + * @param string $string template_resource to decode * @return string decoded template_resource */ protected function decode($string) @@ -62,18 +62,19 @@ class Smarty_Internal_Resource_Eval extends Smarty_Resource_Recompiled { return urldecode(substr($string, 10)); } } - + return $string; } - + /** * modify resource_name according to resource handlers specifications * - * @param Smarty $smarty Smarty instance - * @param string $resource_name resource_name to make unique + * @param Smarty $smarty Smarty instance + * @param string $resource_name resource_name to make unique + * @param boolean $is_config flag for config resource * @return string unique resource name */ - protected function buildUniqueResourceName(Smarty $smarty, $resource_name) + protected function buildUniqueResourceName(Smarty $smarty, $resource_name, $is_config = false) { return get_class($this) . '#' .$this->decode($resource_name); } @@ -81,8 +82,8 @@ class Smarty_Internal_Resource_Eval extends Smarty_Resource_Recompiled { /** * Determine basename for compiled filename * - * @param Smarty_Template_Source $source source object - * @return string resource's basename + * @param Smarty_Template_Source $source source object + * @return string resource's basename */ protected function getBasename(Smarty_Template_Source $source) { @@ -90,5 +91,3 @@ class Smarty_Internal_Resource_Eval extends Smarty_Resource_Recompiled { } } - -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_resource_extends.php b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_resource_extends.php new file mode 100644 index 00000000..dbbbd7d7 --- /dev/null +++ b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_resource_extends.php @@ -0,0 +1,110 @@ +name); + $exists = true; + foreach ($components as $component) { + $s = Smarty_Resource::source(null, $source->smarty, $component); + if ($s->type == 'php') { + throw new SmartyException("Resource type {$s->type} cannot be used with the extends resource type"); + } + $sources[$s->uid] = $s; + $uid .= $s->filepath; + if ($_template && $_template->smarty->compile_check) { + $exists = $exists && $s->exists; + } + } + $source->components = $sources; + $source->filepath = $s->filepath; + $source->uid = sha1($uid); + if ($_template && $_template->smarty->compile_check) { + $source->timestamp = $s->timestamp; + $source->exists = $exists; + } + // need the template at getContent() + $source->template = $_template; + } + + /** + * populate Source Object with timestamp and exists from Resource + * + * @param Smarty_Template_Source $source source object + */ + public function populateTimestamp(Smarty_Template_Source $source) + { + $source->exists = true; + foreach ($source->components as $s) { + $source->exists = $source->exists && $s->exists; + } + $source->timestamp = $s->timestamp; + } + + /** + * Load template's source from files into current template object + * + * @param Smarty_Template_Source $source source object + * @return string template source + * @throws SmartyException if source cannot be loaded + */ + public function getContent(Smarty_Template_Source $source) + { + if (!$source->exists) { + throw new SmartyException("Unable to read template {$source->type} '{$source->name}'"); + } + + $_components = array_reverse($source->components); + + $_content = ''; + foreach ($_components as $_component) { + // read content + $_content .= $_component->content; + } + return $_content; + } + + /** + * Determine basename for compiled filename + * + * @param Smarty_Template_Source $source source object + * @return string resource's basename + */ + public function getBasename(Smarty_Template_Source $source) + { + return str_replace(':', '.', basename($source->filepath)); + } + +} diff --git a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_resource_file.php b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_resource_file.php similarity index 87% rename from lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_resource_file.php rename to lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_resource_file.php index 48b391d2..43e8d188 100644 --- a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_resource_file.php +++ b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_resource_file.php @@ -16,8 +16,8 @@ * @package Smarty * @subpackage TemplateResources */ -class Smarty_Internal_Resource_File extends Smarty_Resource { - +class Smarty_Internal_Resource_File extends Smarty_Resource +{ /** * populate Source Object with meta data from Resource * @@ -55,9 +55,9 @@ class Smarty_Internal_Resource_File extends Smarty_Resource { /** * Load template's source from file into current template object * - * @param Smarty_Template_Source $source source object - * @return string template source - * @throws SmartyException if source cannot be loaded + * @param Smarty_Template_Source $source source object + * @return string template source + * @throws SmartyException if source cannot be loaded */ public function getContent(Smarty_Template_Source $source) { @@ -73,8 +73,8 @@ class Smarty_Internal_Resource_File extends Smarty_Resource { /** * Determine basename for compiled filename * - * @param Smarty_Template_Source $source source object - * @return string resource's basename + * @param Smarty_Template_Source $source source object + * @return string resource's basename */ public function getBasename(Smarty_Template_Source $source) { @@ -82,9 +82,8 @@ class Smarty_Internal_Resource_File extends Smarty_Resource { if (($_pos = strpos($_file, ']')) !== false) { $_file = substr($_file, $_pos + 1); } + return basename($_file); } } - -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_resource_php.php b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_resource_php.php similarity index 83% rename from lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_resource_php.php rename to lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_resource_php.php index 7cd8baee..a55604f1 100644 --- a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_resource_php.php +++ b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_resource_php.php @@ -10,7 +10,8 @@ * @author Uwe Tews * @author Rodney Rehm */ -class Smarty_Internal_Resource_PHP extends Smarty_Resource_Uncompiled { +class Smarty_Internal_Resource_PHP extends Smarty_Resource_Uncompiled +{ /** * container for short_open_tag directive's value before executing PHP templates * @var string @@ -29,8 +30,8 @@ class Smarty_Internal_Resource_PHP extends Smarty_Resource_Uncompiled { /** * populate Source Object with meta data from Resource * - * @param Smarty_Template_Source $source source object - * @param Smarty_Internal_Template $_template template object + * @param Smarty_Template_Source $source source object + * @param Smarty_Internal_Template $_template template object * @return void */ public function populate(Smarty_Template_Source $source, Smarty_Internal_Template $_template=null) @@ -53,7 +54,7 @@ class Smarty_Internal_Resource_PHP extends Smarty_Resource_Uncompiled { /** * populate Source Object with timestamp and exists from Resource * - * @param Smarty_Template_Source $source source object + * @param Smarty_Template_Source $source source object * @return void */ public function populateTimestamp(Smarty_Template_Source $source) @@ -65,9 +66,9 @@ class Smarty_Internal_Resource_PHP extends Smarty_Resource_Uncompiled { /** * Load template's source from file into current template object * - * @param Smarty_Template_Source $source source object - * @return string template source - * @throws SmartyException if source cannot be loaded + * @param Smarty_Template_Source $source source object + * @return string template source + * @throws SmartyException if source cannot be loaded */ public function getContent(Smarty_Template_Source $source) { @@ -80,10 +81,10 @@ class Smarty_Internal_Resource_PHP extends Smarty_Resource_Uncompiled { /** * Render and output the template (without using the compiler) * - * @param Smarty_Template_Source $source source object - * @param Smarty_Internal_Template $_template template object + * @param Smarty_Template_Source $source source object + * @param Smarty_Internal_Template $_template template object * @return void - * @throws SmartyException if template cannot be loaded or allow_php_templates is disabled + * @throws SmartyException if template cannot be loaded or allow_php_templates is disabled */ public function renderUncompiled(Smarty_Template_Source $source, Smarty_Internal_Template $_template) { @@ -110,5 +111,3 @@ class Smarty_Internal_Resource_PHP extends Smarty_Resource_Uncompiled { ini_set( 'short_open_tag', $this->short_open_tag ); } } - -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_resource_registered.php b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_resource_registered.php similarity index 78% rename from lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_resource_registered.php rename to lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_resource_registered.php index 44497b92..961ba834 100644 --- a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_resource_registered.php +++ b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_resource_registered.php @@ -17,13 +17,13 @@ * @subpackage TemplateResources * @deprecated */ -class Smarty_Internal_Resource_Registered extends Smarty_Resource { - +class Smarty_Internal_Resource_Registered extends Smarty_Resource +{ /** * populate Source Object with meta data from Resource * - * @param Smarty_Template_Source $source source object - * @param Smarty_Internal_Template $_template template object + * @param Smarty_Template_Source $source source object + * @param Smarty_Internal_Template $_template template object * @return void */ public function populate(Smarty_Template_Source $source, Smarty_Internal_Template $_template=null) @@ -39,7 +39,7 @@ class Smarty_Internal_Resource_Registered extends Smarty_Resource { /** * populate Source Object with timestamp and exists from Resource * - * @param Smarty_Template_Source $source source object + * @param Smarty_Template_Source $source source object * @return void */ public function populateTimestamp(Smarty_Template_Source $source) @@ -51,23 +51,24 @@ class Smarty_Internal_Resource_Registered extends Smarty_Resource { /** * Get timestamp (epoch) the template source was modified * - * @param Smarty_Template_Source $source source object - * @return integer|boolean timestamp (epoch) the template was modified, false if resources has no timestamp + * @param Smarty_Template_Source $source source object + * @return integer|boolean timestamp (epoch) the template was modified, false if resources has no timestamp */ public function getTemplateTimestamp(Smarty_Template_Source $source) { // return timestamp $time_stamp = false; call_user_func_array($source->smarty->registered_resources[$source->type][0][1], array($source->name, &$time_stamp, $source->smarty)); + return is_numeric($time_stamp) ? (int) $time_stamp : $time_stamp; } /** * Load template's source by invoking the registered callback into current template object * - * @param Smarty_Template_Source $source source object - * @return string template source - * @throws SmartyException if source cannot be loaded + * @param Smarty_Template_Source $source source object + * @return string template source + * @throws SmartyException if source cannot be loaded */ public function getContent(Smarty_Template_Source $source) { @@ -76,14 +77,15 @@ class Smarty_Internal_Resource_Registered extends Smarty_Resource { if (is_bool($t) && !$t) { throw new SmartyException("Unable to read template {$source->type} '{$source->name}'"); } + return $source->content; } /** * Determine basename for compiled filename * - * @param Smarty_Template_Source $source source object - * @return string resource's basename + * @param Smarty_Template_Source $source source object + * @return string resource's basename */ protected function getBasename(Smarty_Template_Source $source) { @@ -91,5 +93,3 @@ class Smarty_Internal_Resource_Registered extends Smarty_Resource { } } - -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_resource_stream.php b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_resource_stream.php similarity index 93% rename from lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_resource_stream.php rename to lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_resource_stream.php index 58086c17..f49a9254 100644 --- a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_resource_stream.php +++ b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_resource_stream.php @@ -19,8 +19,8 @@ * @package Smarty * @subpackage TemplateResources */ -class Smarty_Internal_Resource_Stream extends Smarty_Resource_Recompiled { - +class Smarty_Internal_Resource_Stream extends Smarty_Resource_Recompiled +{ /** * populate Source Object with meta data from Resource * @@ -30,7 +30,7 @@ class Smarty_Internal_Resource_Stream extends Smarty_Resource_Recompiled { */ public function populate(Smarty_Template_Source $source, Smarty_Internal_Template $_template=null) { - if(strpos($source->resource, '://') !== false) { + if (strpos($source->resource, '://') !== false) { $source->filepath = $source->resource; } else { $source->filepath = str_replace(':', '://', $source->resource); @@ -58,6 +58,7 @@ class Smarty_Internal_Resource_Stream extends Smarty_Resource_Recompiled { $t .= $current_line; } fclose($fp); + return $t; } else { return false; @@ -69,9 +70,10 @@ class Smarty_Internal_Resource_Stream extends Smarty_Resource_Recompiled { * * @param Smarty $smarty Smarty instance * @param string $resource_name resource_name to make unique + * @param boolean $is_config flag for config resource * @return string unique resource name */ - protected function buildUniqueResourceName(Smarty $smarty, $resource_name) + protected function buildUniqueResourceName(Smarty $smarty, $resource_name, $is_config = false) { return get_class($this) . '#' . $resource_name; } diff --git a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_resource_string.php b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_resource_string.php similarity index 74% rename from lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_resource_string.php rename to lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_resource_string.php index 9571337b..c58cd5ef 100644 --- a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_resource_string.php +++ b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_resource_string.php @@ -18,13 +18,13 @@ * @package Smarty * @subpackage TemplateResources */ -class Smarty_Internal_Resource_String extends Smarty_Resource { - +class Smarty_Internal_Resource_String extends Smarty_Resource +{ /** * populate Source Object with meta data from Resource * - * @param Smarty_Template_Source $source source object - * @param Smarty_Internal_Template $_template template object + * @param Smarty_Template_Source $source source object + * @param Smarty_Internal_Template $_template template object * @return void */ public function populate(Smarty_Template_Source $source, Smarty_Internal_Template $_template=null) @@ -38,18 +38,18 @@ class Smarty_Internal_Resource_String extends Smarty_Resource { * Load template's source from $resource_name into current template object * * @uses decode() to decode base64 and urlencoded template_resources - * @param Smarty_Template_Source $source source object - * @return string template source + * @param Smarty_Template_Source $source source object + * @return string template source */ public function getContent(Smarty_Template_Source $source) { return $this->decode($source->name); } - + /** * decode base64 and urlencode * - * @param string $string template_resource to decode + * @param string $string template_resource to decode * @return string decoded template_resource */ protected function decode($string) @@ -62,18 +62,19 @@ class Smarty_Internal_Resource_String extends Smarty_Resource { return urldecode(substr($string, 10)); } } - + return $string; } - + /** * modify resource_name according to resource handlers specifications * - * @param Smarty $smarty Smarty instance - * @param string $resource_name resource_name to make unique + * @param Smarty $smarty Smarty instance + * @param string $resource_name resource_name to make unique + * @param boolean $is_config flag for config resource * @return string unique resource name */ - protected function buildUniqueResourceName(Smarty $smarty, $resource_name) + protected function buildUniqueResourceName(Smarty $smarty, $resource_name, $is_config = false) { return get_class($this) . '#' .$this->decode($resource_name); } @@ -83,8 +84,8 @@ class Smarty_Internal_Resource_String extends Smarty_Resource { * * Always returns an empty string. * - * @param Smarty_Template_Source $source source object - * @return string resource's basename + * @param Smarty_Template_Source $source source object + * @return string resource's basename */ protected function getBasename(Smarty_Template_Source $source) { @@ -92,5 +93,3 @@ class Smarty_Internal_Resource_String extends Smarty_Resource { } } - -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_smartytemplatecompiler.php b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_smartytemplatecompiler.php similarity index 87% rename from lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_smartytemplatecompiler.php rename to lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_smartytemplatecompiler.php index 1ec1aa43..8e0d22f1 100644 --- a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_smartytemplatecompiler.php +++ b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_smartytemplatecompiler.php @@ -12,7 +12,7 @@ /** * @ignore */ -include ("smarty_internal_parsetree.php"); +include 'smarty_internal_parsetree.php'; /** * Class SmartyTemplateCompiler @@ -20,8 +20,8 @@ include ("smarty_internal_parsetree.php"); * @package Smarty * @subpackage Compiler */ -class Smarty_Internal_SmartyTemplateCompiler extends Smarty_Internal_TemplateCompilerBase { - +class Smarty_Internal_SmartyTemplateCompiler extends Smarty_Internal_TemplateCompilerBase +{ /** * Lexer class name * @@ -84,7 +84,7 @@ class Smarty_Internal_SmartyTemplateCompiler extends Smarty_Internal_TemplateCom * Methode to compile a Smarty template * * @param mixed $_content template source - * @return bool true if compiling succeeded, false if it failed + * @return bool true if compiling succeeded, false if it failed */ protected function doCompile($_content) { @@ -94,6 +94,10 @@ class Smarty_Internal_SmartyTemplateCompiler extends Smarty_Internal_TemplateCom // init the lexer/parser to compile the template $this->lex = new $this->lexer_class($_content, $this); $this->parser = new $this->parser_class($this->lex, $this); + if ($this->inheritance_child) { + // start state on child templates + $this->lex->yypushstate(Smarty_Internal_Templatelexer::CHILDBODY); + } if ($this->smarty->_parserdebug) $this->parser->PrintTrace(); // get tokens from lexer and parse them @@ -115,7 +119,7 @@ class Smarty_Internal_SmartyTemplateCompiler extends Smarty_Internal_TemplateCom if (count($this->_tag_stack) > 0) { // get stacked info list($openTag, $_data) = array_pop($this->_tag_stack); - $this->trigger_template_error("unclosed {" . $openTag . "} tag"); + $this->trigger_template_error("unclosed {$this->smarty->left_delimiter}" . $openTag . "{$this->smarty->right_delimiter} tag"); } // return compiled code // return str_replace(array("? >\nparser->retvalue); @@ -123,5 +127,3 @@ class Smarty_Internal_SmartyTemplateCompiler extends Smarty_Internal_TemplateCom } } - -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_template.php b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_template.php similarity index 93% rename from lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_template.php rename to lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_template.php index b6dd87fc..d60fc6bf 100644 --- a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_template.php +++ b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_template.php @@ -19,8 +19,8 @@ * @property Smarty_Template_Compiled $compiled * @property Smarty_Template_Cached $cached */ -class Smarty_Internal_Template extends Smarty_Internal_TemplateBase { - +class Smarty_Internal_Template extends Smarty_Internal_TemplateBase +{ /** * cache_id * @var string @@ -108,7 +108,7 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase { * @param string $template_resource template resource string * @param Smarty $smarty Smarty instance * @param Smarty_Internal_Template $_parent back pointer to parent object with variables or null - * @param mixed $_cache_id cache id or null + * @param mixed $_cache_id cache id or null * @param mixed $_compile_id compile id or null * @param bool $_caching use caching? * @param int $_cache_lifetime cache life-time in seconds @@ -153,6 +153,7 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase { $this->mustCompile = (!$this->source->uncompiled && ($this->smarty->force_compile || $this->source->recompiled || $this->compiled->timestamp === false || ($this->smarty->compile_check && $this->compiled->timestamp < $this->source->timestamp))); } + return $this->mustCompile; } @@ -166,16 +167,14 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase { if (!$this->source->recompiled) { $this->properties['file_dependency'] = array(); if ($this->source->components) { + // for the extends resource the compiler will fill it // uses real resource for file dependency - $source = end($this->source->components); - $this->properties['file_dependency'][$this->source->uid] = array($this->source->filepath, $this->source->timestamp, $source->type); + // $source = end($this->source->components); + // $this->properties['file_dependency'][$this->source->uid] = array($this->source->filepath, $this->source->timestamp, $source->type); } else { $this->properties['file_dependency'][$this->source->uid] = array($this->source->filepath, $this->source->timestamp, $this->source->type); } } - if ($this->smarty->debugging) { - Smarty_Internal_Debug::start_compile($this); - } // compile locking if ($this->smarty->compile_locking && !$this->source->recompiled) { if ($saved_timestamp = $this->compiled->timestamp) { @@ -202,9 +201,6 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase { $this->compiled->exists = true; $this->compiled->isCompiled = true; } - if ($this->smarty->debugging) { - Smarty_Internal_Debug::end_compile($this); - } // release compiler object to free memory unset($this->compiler); } @@ -227,6 +223,7 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase { eval("?>" . $content); $this->cached->valid = true; $this->cached->processed = true; + return $this->cached->write($this, $content); } @@ -238,7 +235,7 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase { * @param mixed $compile_id compile id to be used with this template * @param integer $caching cache mode * @param integer $cache_lifetime life time of cache data - * @param array $vars optional variables to assign + * @param array $vars optional variables to assign * @param int $parent_scope scope in which {include} should execute * @returns string template content */ @@ -283,6 +280,7 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase { $tpl->tpl_vars[$_key] = new Smarty_variable($_val); } } + return $tpl->fetch(null, null, null, null, false, false, true); } @@ -294,7 +292,7 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase { * @param mixed $compile_id compile id to be used with this template * @param integer $caching cache mode * @param integer $cache_lifetime life time of cache data - * @param array $vars optional variables to assign + * @param array $vars optional variables to assign * @param int $parent_scope scope in which {include} should execute * @param string $hash nocache hash code * @returns string template content @@ -304,7 +302,7 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase { $tpl = new $this->smarty->template_class($template, $this->smarty, $this, $cache_id, $compile_id, $caching, $cache_lifetime); $tpl->properties['nocache_hash'] = $hash; // get variables from calling scope - if ($parent_scope == Smarty::SCOPE_LOCAL ) { + if ($parent_scope == Smarty::SCOPE_LOCAL) { $tpl->tpl_vars = $this->tpl_vars; $tpl->tpl_vars['smarty'] = clone $this->tpl_vars['smarty']; } elseif ($parent_scope == Smarty::SCOPE_PARENT) { @@ -323,6 +321,7 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase { $tpl->tpl_vars[$_key] = new Smarty_variable($_val); } } + return $tpl; } @@ -330,8 +329,8 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase { /** * Create code frame for compiled and cached templates * - * @param string $content optional template content - * @param bool $cache flag for cache file + * @param string $content optional template content + * @param bool $cache flag for cache file * @return string */ public function createTemplateCodeFrame($content = '', $cache = false) @@ -344,7 +343,7 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase { foreach ($this->required_plugins['compiled'] as $tmp) { foreach ($tmp as $data) { $file = addslashes($data['file']); - if (is_Array($data['function'])){ + if (is_Array($data['function'])) { $plugins_string .= "if (!is_callable(array('{$data['function'][0]}','{$data['function'][1]}'))) include '{$file}';\n"; } else { $plugins_string .= "if (!is_callable('{$data['function']}')) include '{$file}';\n"; @@ -359,7 +358,7 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase { foreach ($this->required_plugins['nocache'] as $tmp) { foreach ($tmp as $data) { $file = addslashes($data['file']); - if (is_Array($data['function'])){ + if (is_Array($data['function'])) { $plugins_string .= addslashes("if (!is_callable(array('{$data['function'][0]}','{$data['function'][1]}'))) include '{$file}';\n"); } else { $plugins_string .= addslashes("if (!is_callable('{$data['function']}')) include '{$file}';\n"); @@ -409,8 +408,9 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase { $output .= $plugins_string; $output .= $content; if (!$this->source->recompiled) { - $output .= ''; + $output .= "\n"; } + return $output; } @@ -420,9 +420,9 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase { * - Decode saved properties from compiled template and cache files * - Check if compiled or cache file is valid * - * @param array $properties special template properties - * @param bool $cache flag if called from cache file - * @return bool flag if compiled or cache file is valid + * @param array $properties special template properties + * @param bool $cache flag if called from cache file + * @return bool flag if compiled or cache file is valid */ public function decodeProperties($properties, $cache = false) { @@ -444,7 +444,7 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase { $is_valid = true; if ($this->properties['version'] != Smarty::SMARTY_VERSION) { $is_valid = false; - } else if (((!$cache && $this->smarty->compile_check && empty($this->compiled->_properties) && !$this->compiled->isCompiled) || $cache && ($this->smarty->compile_check === true || $this->smarty->compile_check === Smarty::COMPILECHECK_ON)) && !empty($this->properties['file_dependency'])) { + } elseif (((!$cache && $this->smarty->compile_check && empty($this->compiled->_properties) && !$this->compiled->isCompiled) || $cache && ($this->smarty->compile_check === true || $this->smarty->compile_check === Smarty::COMPILECHECK_ON)) && !empty($this->properties['file_dependency'])) { foreach ($this->properties['file_dependency'] as $_file_to_check) { if ($_file_to_check[2] == 'file' || $_file_to_check[2] == 'php') { if ($this->source->filepath == $_file_to_check[0] && isset($this->source->timestamp)) { @@ -480,15 +480,16 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase { if (!$cache) { $this->compiled->_properties = $properties; } + return $is_valid; } /** * Template code runtime function to create a local Smarty variable for array assignments * - * @param string $tpl_var tempate variable name - * @param bool $nocache cache mode of variable - * @param int $scope scope of variable + * @param string $tpl_var tempate variable name + * @param bool $nocache cache mode of variable + * @param int $scope scope of variable */ public function createLocalArrayVariable($tpl_var, $nocache = false, $scope = Smarty::SCOPE_LOCAL) { @@ -508,8 +509,8 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase { /** * Template code runtime function to get pointer to template variable array of requested scope * - * @param int $scope requested variable scope - * @return array array of template variables + * @param int $scope requested variable scope + * @return array array of template variables */ public function &getScope($scope) { @@ -520,18 +521,20 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase { while (!empty($ptr->parent)) { $ptr = $ptr->parent; } + return $ptr->tpl_vars; } elseif ($scope == Smarty::SCOPE_GLOBAL) { return Smarty::$global_tpl_vars; } $null = null; + return $null; } /** * Get parent or root of template parent chain * - * @param int $scope pqrent or root scope + * @param int $scope pqrent or root scope * @return mixed object */ public function getScopePointer($scope) @@ -543,16 +546,18 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase { while (!empty($ptr->parent)) { $ptr = $ptr->parent; } + return $ptr; } + return null; } /** * [util function] counts an array, arrayaccess/traversable or PDOStatement object * - * @param mixed $value - * @return int the count for arrays and objects that implement countable, 1 for other objects that don't, and 0 for empty elements + * @param mixed $value + * @return int the count for arrays and objects that implement countable, 1 for other objects that don't, and 0 for empty elements */ public function _count($value) { @@ -575,6 +580,7 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase { } elseif (is_object($value)) { return count($value); } + return 0; } @@ -596,6 +602,7 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase { public function clearCache($exp_time=null) { Smarty_CacheResource::invalidLoadedCache($this->smarty); + return $this->cached->handler->clear($this->smarty, $this->template_name, $this->cache_id, $this->compile_id, $exp_time); } @@ -613,12 +620,14 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase { case 'cached': case 'compiler': $this->$property_name = $value; + return; // FIXME: routing of template -> smarty attributes default: if (property_exists($this->smarty, $property_name)) { $this->smarty->$property_name = $value; + return; } } @@ -653,10 +662,12 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase { } $this->smarty->template_objects[$_templateId] = $this; } + return $this->source; case 'compiled': $this->compiled = $this->source->getCompiled($this); + return $this->compiled; case 'cached': @@ -664,11 +675,13 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase { include SMARTY_SYSPLUGINS_DIR . 'smarty_cacheresource.php'; } $this->cached = new Smarty_Template_Cached($this); + return $this->cached; case 'compiler': $this->smarty->loadPlugin($this->source->compiler_class); $this->compiler = new $this->source->compiler_class($this->source->template_lexer_class, $this->source->template_parser_class, $this->smarty); + return $this->compiler; // FIXME: routing of template -> smarty attributes @@ -693,5 +706,3 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase { } } - -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_templatebase.php b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_templatebase.php similarity index 86% rename from lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_templatebase.php rename to lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_templatebase.php index 1cb9bb94..5ebb6a49 100644 --- a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_templatebase.php +++ b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_templatebase.php @@ -15,18 +15,18 @@ * @package Smarty * @subpackage Template */ -abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data { - +abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data +{ /** * fetches a rendered Smarty template * - * @param string $template the resource handle of the template file or template object - * @param mixed $cache_id cache id to be used with this template - * @param mixed $compile_id compile id to be used with this template - * @param object $parent next higher level of Smarty variables - * @param bool $display true: display, false: fetch - * @param bool $merge_tpl_vars if true parent template variables merged in to local scope - * @param bool $no_output_filter if true do not run output filter + * @param string $template the resource handle of the template file or template object + * @param mixed $cache_id cache id to be used with this template + * @param mixed $compile_id compile id to be used with this template + * @param object $parent next higher level of Smarty variables + * @param bool $display true: display, false: fetch + * @param bool $merge_tpl_vars if true parent template variables merged in to local scope + * @param bool $no_output_filter if true do not run output filter * @return string rendered template output */ public function fetch($template = null, $cache_id = null, $compile_id = null, $parent = null, $display = false, $merge_tpl_vars = true, $no_output_filter = false) @@ -132,13 +132,7 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data { if (!$_template->source->uncompiled) { $_smarty_tpl = $_template; if ($_template->source->recompiled) { - if ($this->smarty->debugging) { - Smarty_Internal_Debug::start_compile($_template); - } $code = $_template->compiler->compileTemplate($_template); - if ($this->smarty->debugging) { - Smarty_Internal_Debug::end_compile($_template); - } if ($this->smarty->debugging) { Smarty_Internal_Debug::start_render($_template); } @@ -153,6 +147,11 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data { } else { if (!$_template->compiled->exists || ($_template->smarty->force_compile && !$_template->compiled->isCompiled)) { $_template->compileTemplateSource(); + $code = file_get_contents($_template->compiled->filepath); + eval("?>" . $code); + unset($code); + $_template->compiled->loaded = true; + $_template->compiled->isCompiled = true; } if ($this->smarty->debugging) { Smarty_Internal_Debug::start_render($_template); @@ -162,7 +161,10 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data { if ($_template->mustCompile) { // recompile and load again $_template->compileTemplateSource(); - include($_template->compiled->filepath); + $code = file_get_contents($_template->compiled->filepath); + eval("?>" . $code); + unset($code); + $_template->compiled->isCompiled = true; } $_template->compiled->loaded = true; } else { @@ -235,7 +237,7 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data { // loop over items, stitch back together foreach ($cache_split as $curr_idx => $curr_split) { // escape PHP tags in template content - $output .= preg_replace('/(<%|%>|<\?php|<\?|\?>)/', '', $curr_split); + $output .= preg_replace('/(<%|%>|<\?php|<\?|\?>)/', "\n", $curr_split); if (isset($cache_parts[0][$curr_idx])) { $_template->properties['has_nocache_code'] = true; // remove nocache tags from cache output @@ -348,6 +350,7 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data { $_template->tpl_vars = $save_tpl_vars; $_template->config_vars = $save_config_vars; } + return; } else { if ($merge_tpl_vars) { @@ -377,11 +380,11 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data { /** * test if cache is valid * - * @param string|object $template the resource handle of the template file or template object - * @param mixed $cache_id cache id to be used with this template - * @param mixed $compile_id compile id to be used with this template - * @param object $parent next higher level of Smarty variables - * @return boolean cache status + * @param string|object $template the resource handle of the template file or template object + * @param mixed $cache_id cache id to be used with this template + * @param mixed $compile_id compile id to be used with this template + * @param object $parent next higher level of Smarty variables + * @return boolean cache status */ public function isCached($template = null, $cache_id = null, $compile_id = null, $parent = null) { @@ -412,13 +415,13 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data { /** * Registers plugin to be used in templates * - * @param string $type plugin type - * @param string $tag name of template tag - * @param callback $callback PHP callback to register - * @param boolean $cacheable if true (default) this fuction is cachable - * @param array $cache_attr caching attributes if any + * @param string $type plugin type + * @param string $tag name of template tag + * @param callback $callback PHP callback to register + * @param boolean $cacheable if true (default) this fuction is cachable + * @param array $cache_attr caching attributes if any * @return Smarty_Internal_Templatebase current Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining - * @throws SmartyException when the plugin tag is invalid + * @throws SmartyException when the plugin tag is invalid */ public function registerPlugin($type, $tag, $callback, $cacheable = true, $cache_attr = null) { @@ -436,8 +439,8 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data { /** * Unregister Plugin * - * @param string $type of plugin - * @param string $tag name of plugin + * @param string $type of plugin + * @param string $tag name of plugin * @return Smarty_Internal_Templatebase current Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining */ public function unregisterPlugin($type, $tag) @@ -452,20 +455,21 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data { /** * Registers a resource to fetch a template * - * @param string $type name of resource type - * @param Smarty_Resource|array $callback or instance of Smarty_Resource, or array of callbacks to handle resource (deprecated) + * @param string $type name of resource type + * @param Smarty_Resource|array $callback or instance of Smarty_Resource, or array of callbacks to handle resource (deprecated) * @return Smarty_Internal_Templatebase current Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining */ public function registerResource($type, $callback) { $this->smarty->registered_resources[$type] = $callback instanceof Smarty_Resource ? $callback : array($callback, false); + return $this; } /** * Unregisters a resource * - * @param string $type name of resource type + * @param string $type name of resource type * @return Smarty_Internal_Templatebase current Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining */ public function unregisterResource($type) @@ -480,20 +484,21 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data { /** * Registers a cache resource to cache a template's output * - * @param string $type name of cache resource type - * @param Smarty_CacheResource $callback instance of Smarty_CacheResource to handle output caching + * @param string $type name of cache resource type + * @param Smarty_CacheResource $callback instance of Smarty_CacheResource to handle output caching * @return Smarty_Internal_Templatebase current Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining */ public function registerCacheResource($type, Smarty_CacheResource $callback) { $this->smarty->registered_cache_resources[$type] = $callback; + return $this; } /** * Unregisters a cache resource * - * @param string $type name of cache resource type + * @param string $type name of cache resource type * @return Smarty_Internal_Templatebase current Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining */ public function unregisterCacheResource($type) @@ -508,22 +513,22 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data { /** * Registers object to be used in templates * - * @param string $object name of template object - * @param object $object_impl the referenced PHP object to register - * @param array $allowed list of allowed methods (empty = all) - * @param boolean $smarty_args smarty argument format, else traditional - * @param array $block_methods list of block-methods - * @param array $block_functs list of methods that are block format + * @param string $object name of template object + * @param object $object_impl the referenced PHP object to register + * @param array $allowed list of allowed methods (empty = all) + * @param boolean $smarty_args smarty argument format, else traditional + * @param array $block_methods list of block-methods + * @param array $block_functs list of methods that are block format * @return Smarty_Internal_Templatebase current Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining - * @throws SmartyException if any of the methods in $allowed or $block_methods are invalid + * @throws SmartyException if any of the methods in $allowed or $block_methods are invalid */ public function registerObject($object_name, $object_impl, $allowed = array(), $smarty_args = true, $block_methods = array()) { // test if allowed methodes callable if (!empty($allowed)) { foreach ((array) $allowed as $method) { - if (!is_callable(array($object_impl, $method))) { - throw new SmartyException("Undefined method '$method' in registered object"); + if (!is_callable(array($object_impl, $method)) && !property_exists($object_impl, $method)) { + throw new SmartyException("Undefined method or property '$method' in registered object"); } } } @@ -538,13 +543,14 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data { // register the object $this->smarty->registered_objects[$object_name] = array($object_impl, (array) $allowed, (boolean) $smarty_args, (array) $block_methods); + return $this; } /** * return a reference to a registered object * - * @param string $name object name + * @param string $name object name * @return object * @throws SmartyException if no such object is found */ @@ -556,13 +562,14 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data { if (!is_object($this->smarty->registered_objects[$name][0])) { throw new SmartyException("registered '$name' is not an object"); } + return $this->smarty->registered_objects[$name][0]; } /** * unregister an object * - * @param string $name object name + * @param string $name object name * @return Smarty_Internal_Templatebase current Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining */ public function unregisterObject($name) @@ -577,10 +584,10 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data { /** * Registers static classes to be used in templates * - * @param string $class name of template class - * @param string $class_impl the referenced PHP class to register + * @param string $class name of template class + * @param string $class_impl the referenced PHP class to register * @return Smarty_Internal_Templatebase current Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining - * @throws SmartyException if $class_impl does not refer to an existing class + * @throws SmartyException if $class_impl does not refer to an existing class */ public function registerClass($class_name, $class_impl) { @@ -590,15 +597,16 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data { } // register the class $this->smarty->registered_classes[$class_name] = $class_impl; + return $this; } /** * Registers a default plugin handler * - * @param callable $callback class/method name + * @param callable $callback class/method name * @return Smarty_Internal_Templatebase current Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining - * @throws SmartyException if $callback is not callable + * @throws SmartyException if $callback is not callable */ public function registerDefaultPluginHandler($callback) { @@ -614,9 +622,9 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data { /** * Registers a default template handler * - * @param callable $callback class/method name + * @param callable $callback class/method name * @return Smarty_Internal_Templatebase current Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining - * @throws SmartyException if $callback is not callable + * @throws SmartyException if $callback is not callable */ public function registerDefaultTemplateHandler($callback) { @@ -632,9 +640,9 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data { /** * Registers a default template handler * - * @param callable $callback class/method name + * @param callable $callback class/method name * @return Smarty_Internal_Templatebase current Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining - * @throws SmartyException if $callback is not callable + * @throws SmartyException if $callback is not callable */ public function registerDefaultConfigHandler($callback) { @@ -650,21 +658,22 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data { /** * Registers a filter function * - * @param string $type filter type - * @param callback $callback + * @param string $type filter type + * @param callback $callback * @return Smarty_Internal_Templatebase current Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining */ public function registerFilter($type, $callback) { $this->smarty->registered_filters[$type][$this->_get_filter_name($callback)] = $callback; + return $this; } /** * Unregisters a filter function * - * @param string $type filter type - * @param callback $callback + * @param string $type filter type + * @param callback $callback * @return Smarty_Internal_Templatebase current Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining */ public function unregisterFilter($type, $callback) @@ -680,14 +689,15 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data { /** * Return internal filter name * - * @param callback $function_name - * @return string internal filter name + * @param callback $function_name + * @return string internal filter name */ public function _get_filter_name($function_name) { if (is_array($function_name)) { $_class_name = (is_object($function_name[0]) ? get_class($function_name[0]) : $function_name[0]); + return $_class_name . '_' . $function_name[1]; } else { return $function_name; @@ -697,8 +707,8 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data { /** * load a filter of specified type and name * - * @param string $type filter type - * @param string $name filter name + * @param string $type filter type + * @param string $name filter name * @throws SmartyException if filter could not be loaded */ public function loadFilter($type, $name) @@ -711,6 +721,7 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data { } if (is_callable($_plugin)) { $this->smarty->registered_filters[$type][$_filter_name] = $_plugin; + return true; } } @@ -720,8 +731,8 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data { /** * unload a filter of specified type and name * - * @param string $type filter type - * @param string $name filter name + * @param string $type filter type + * @param string $name filter name * @return Smarty_Internal_Templatebase current Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining */ public function unloadFilter($type, $name) @@ -737,10 +748,11 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data { /** * preg_replace callback to convert camelcase getter/setter to underscore property names * - * @param string $match match string + * @param string $match match string * @return string replacemant */ - private function replaceCamelcase($match) { + private function replaceCamelcase($match) + { return "_" . strtolower($match[1]); } @@ -779,7 +791,7 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data { $_is_this = null; if (property_exists($this, $property_name)) { $_is_this = true; - } else if (property_exists($this->smarty, $property_name)) { + } elseif (property_exists($this->smarty, $property_name)) { $_is_this = false; } $_resolved_property_source[$property_name] = $_is_this; @@ -789,13 +801,14 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data { return $this->$property_name; else return $this->$property_name = $args[0]; - } else if ($_is_this === false) { + } elseif ($_is_this === false) { if ($first3 == 'get') return $this->smarty->$property_name; else return $this->smarty->$property_name = $args[0]; } else { throw new SmartyException("property '$property_name' does not exist."); + return false; } } @@ -807,5 +820,3 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data { } } - -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_templatecompilerbase.php b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_templatecompilerbase.php similarity index 77% rename from lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_templatecompilerbase.php rename to lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_templatecompilerbase.php index e4a78d09..7236be8b 100644 --- a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_templatecompilerbase.php +++ b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_templatecompilerbase.php @@ -16,8 +16,8 @@ * @package Smarty * @subpackage Compiler */ -abstract class Smarty_Internal_TemplateCompilerBase { - +abstract class Smarty_Internal_TemplateCompilerBase +{ /** * hash for nocache sections * @@ -68,12 +68,60 @@ abstract class Smarty_Internal_TemplateCompilerBase { public $merged_templates = array(); /** - * flag when compiling {block} + * sources which must be compiled + * + * @var array + */ + public $sources = array(); + + /** + * flag that we are inside {block} * * @var bool */ public $inheritance = false; + /** + * flag when compiling inheritance child template + * + * @var bool + */ + public $inheritance_child = false; + + /** + * uid of templates called by {extends} for recursion check + * + * @var array + */ + public $extends_uid = array(); + + /** + * source line offset for error messages + * + * @var int + */ + public $trace_line_offset = 0; + + /** + * trace uid + * + * @var string + */ + public $trace_uid = ''; + + /** + * trace file path + * + * @var string + */ + public $trace_filepath = ''; + /** + * stack for tracing file and line of nested {block} tags + * + * @var array + */ + public $trace_stack = array(); + /** * plugins loaded by default plugin handler * @@ -146,14 +194,15 @@ abstract class Smarty_Internal_TemplateCompilerBase { * Methode to compile a Smarty template * * @param mixed $_content template source - * @return bool true if compiling succeeded, false if it failed + * @return bool true if compiling succeeded, false if it failed */ abstract protected function doCompile($_content); /** * Initialize compiler */ - public function __construct() { + public function __construct() + { $this->nocache_hash = str_replace('.', '-', uniqid(rand(), true)); } @@ -161,22 +210,24 @@ abstract class Smarty_Internal_TemplateCompilerBase { * Method to compile a Smarty template * * @param Smarty_Internal_Template $template template object to compile - * @return bool true if compiling succeeded, false if it failed + * @param bool $nocache true is shall be compiled in nocache mode + * @return bool true if compiling succeeded, false if it failed */ - public function compileTemplate(Smarty_Internal_Template $template) { + public function compileTemplate(Smarty_Internal_Template $template, $nocache = false) + { if (empty($template->properties['nocache_hash'])) { $template->properties['nocache_hash'] = $this->nocache_hash; } else { $this->nocache_hash = $template->properties['nocache_hash']; } // flag for nochache sections - $this->nocache = false; + $this->nocache = $nocache; $this->tag_nocache = false; // save template object in compiler class $this->template = $template; - // reset has noche code flag + // reset has nocache code flag $this->template->has_nocache_code = false; - $this->smarty->_current_file = $saved_filepath = $this->template->source->filepath; + $save_source = $this->template->source; // template header code $template_header = ''; if (!$this->suppressHeader) { @@ -184,28 +235,52 @@ abstract class Smarty_Internal_TemplateCompilerBase { $template_header .= " compiled from \"" . $this->template->source->filepath . "\" */ ?>\n"; } - do { - // flag for aborting current and start recompile - $this->abort_and_recompile = false; - // get template source - $_content = $template->source->content; - // run prefilter if required - if ((isset($this->smarty->autoload_filters['pre']) || isset($this->smarty->registered_filters['pre'])) && !$this->suppressFilter) { - $_content = Smarty_Internal_Filter_Handler::runFilter('pre', $_content, $template); + if (empty($this->template->source->components)) { + $this->sources = array($template->source); + } else { + // we have array of inheritance templates by extends: resource + $this->sources = array_reverse($template->source->components); + } + $loop = 0; + // the $this->sources array can get additional elements while compiling by the {extends} tag + while ($this->template->source = array_shift($this->sources)) { + $this->smarty->_current_file = $this->template->source->filepath; + if ($this->smarty->debugging) { + Smarty_Internal_Debug::start_compile($this->template); } - // on empty template just return header - if ($_content == '') { - if ($this->suppressTemplatePropertyHeader) { - $code = ''; - } else { - $code = $template_header . $template->createTemplateCodeFrame(); + $no_sources = count($this->sources); + if ($loop || $no_sources) { + $this->template->properties['file_dependency'][$this->template->source->uid] = array($this->template->source->filepath, $this->template->source->timestamp, $this->template->source->type); + } + $loop++; + if ($no_sources) { + $this->inheritance_child = true; + } else { + $this->inheritance_child = false; + } + do { + $_compiled_code = ''; + // flag for aborting current and start recompile + $this->abort_and_recompile = false; + // get template source + $_content = $this->template->source->content; + if ($_content != '') { + // run prefilter if required + if ((isset($this->smarty->autoload_filters['pre']) || isset($this->smarty->registered_filters['pre'])) && !$this->suppressFilter) { + $_content = Smarty_Internal_Filter_Handler::runFilter('pre', $_content, $template); + } + // call compiler + $_compiled_code = $this->doCompile($_content); } - return $code; + } while ($this->abort_and_recompile); + if ($this->smarty->debugging) { + Smarty_Internal_Debug::end_compile($this->template); } - // call compiler - $_compiled_code = $this->doCompile($_content); - } while ($this->abort_and_recompile); - $this->template->source->filepath = $saved_filepath; + } + // restore source + $this->template->source = $save_source; + unset($save_source); + $this->smarty->_current_file = $this->template->source->filepath; // free memory unset($this->parser->root_buffer, $this->parser->current_buffer, $this->parser, $this->lex, $this->template); self::$_tag_objects = array(); @@ -217,7 +292,7 @@ abstract class Smarty_Internal_TemplateCompilerBase { } } // run postfilter if required on compiled template code - if ((isset($this->smarty->autoload_filters['post']) || isset($this->smarty->registered_filters['post'])) && !$this->suppressFilter) { + if ((isset($this->smarty->autoload_filters['post']) || isset($this->smarty->registered_filters['post'])) && !$this->suppressFilter && $_compiled_code != '') { $_compiled_code = Smarty_Internal_Filter_Handler::runFilter('post', $_compiled_code, $template); } if ($this->suppressTemplatePropertyHeader) { @@ -227,6 +302,7 @@ abstract class Smarty_Internal_TemplateCompilerBase { } // unset content because template inheritance could have replace source with parent code unset ($template->source->content); + return $code; } @@ -236,12 +312,13 @@ abstract class Smarty_Internal_TemplateCompilerBase { * This is a call back from the lexer/parser * It executes the required compile plugin for the Smarty tag * - * @param string $tag tag name - * @param array $args array with tag attributes - * @param array $parameter array with compilation parameter + * @param string $tag tag name + * @param array $args array with tag attributes + * @param array $parameter array with compilation parameter * @return string compiled code */ - public function compileTag($tag, $args, $parameter = array()) { + public function compileTag($tag, $args, $parameter = array()) + { // $args contains the attributes parsed and compiled by the lexer/parser // assume that tag does compile into code, but creates no HTML output $this->has_code = true; @@ -252,7 +329,8 @@ abstract class Smarty_Internal_TemplateCompilerBase { } // check nocache option flag if (in_array("'nocache'", $args) || in_array(array('nocache' => 'true'), $args) - || in_array(array('nocache' => '"true"'), $args) || in_array(array('nocache' => "'true'"), $args)) { + || in_array(array('nocache' => '"true"'), $args) || in_array(array('nocache' => "'true'"), $args) + ) { $this->tag_nocache = true; } // compile the smarty tag (required compile classes to compile the tag are autoloaded) @@ -276,7 +354,7 @@ abstract class Smarty_Internal_TemplateCompilerBase { } } // tag did not produce compiled code - return ''; + return null; } else { // map_named attributes if (isset($args['_attr'])) { @@ -292,7 +370,8 @@ abstract class Smarty_Internal_TemplateCompilerBase { if (isset($this->smarty->registered_objects[$tag]) && isset($parameter['object_methode'])) { $methode = $parameter['object_methode']; if (!in_array($methode, $this->smarty->registered_objects[$tag][3]) && - (empty($this->smarty->registered_objects[$tag][1]) || in_array($methode, $this->smarty->registered_objects[$tag][1]))) { + (empty($this->smarty->registered_objects[$tag][1]) || in_array($methode, $this->smarty->registered_objects[$tag][1])) + ) { return $this->callTagCompiler('private_object_function', $args, $parameter, $tag, $methode); } elseif (in_array($methode, $this->smarty->registered_objects[$tag][3])) { return $this->callTagCompiler('private_object_block_function', $args, $parameter, $tag, $methode); @@ -319,7 +398,7 @@ abstract class Smarty_Internal_TemplateCompilerBase { $function = $this->smarty->registered_plugins[$plugin_type][$tag][0]; if (!is_array($function)) { return $function($new_args, $this); - } else if (is_object($function[0])) { + } elseif (is_object($function[0])) { return $this->smarty->registered_plugins[$plugin_type][$tag][0][0]->$function[1]($new_args, $this); } else { return call_user_func_array($function, array($new_args, $this)); @@ -345,6 +424,7 @@ abstract class Smarty_Internal_TemplateCompilerBase { $new_args[$key] = $mixed; } } + return $plugin($new_args, $this->smarty); } if (class_exists($plugin, false)) { @@ -390,7 +470,7 @@ abstract class Smarty_Internal_TemplateCompilerBase { $function = $this->default_handler_plugins[$plugin_type][$tag][0]; if (!is_array($function)) { return $function($new_args, $this); - } else if (is_object($function[0])) { + } elseif (is_object($function[0])) { return $this->default_handler_plugins[$plugin_type][$tag][0][0]->$function[1]($new_args, $this); } else { return call_user_func_array($function, array($new_args, $this)); @@ -430,7 +510,7 @@ abstract class Smarty_Internal_TemplateCompilerBase { $function = $this->smarty->registered_plugins[Smarty::PLUGIN_COMPILER][$tag][0]; if (!is_array($function)) { return $function($args, $this); - } else if (is_object($function[0])) { + } elseif (is_object($function[0])) { return $this->smarty->registered_plugins[Smarty::PLUGIN_COMPILER][$tag][0][0]->$function[1]($args, $this); } else { return call_user_func_array($function, array($args, $this)); @@ -461,14 +541,15 @@ abstract class Smarty_Internal_TemplateCompilerBase { * class name format: Smarty_Internal_Compile_TagName * plugin filename format: Smarty_Internal_Tagname.php * - * @param string $tag tag name - * @param array $args list of tag attributes - * @param mixed $param1 optional parameter - * @param mixed $param2 optional parameter - * @param mixed $param3 optional parameter + * @param string $tag tag name + * @param array $args list of tag attributes + * @param mixed $param1 optional parameter + * @param mixed $param2 optional parameter + * @param mixed $param3 optional parameter * @return string compiled code */ - public function callTagCompiler($tag, $args, $param1 = null, $param2 = null, $param3 = null) { + public function callTagCompiler($tag, $args, $param1 = null, $param2 = null, $param3 = null) + { // re-use object if already exists if (isset(self::$_tag_objects[$tag])) { // compile this tag @@ -492,23 +573,24 @@ abstract class Smarty_Internal_TemplateCompilerBase { /** * Check for plugins and return function name * - * @param string $pugin_name name of plugin or function - * @param string $plugin_type type of plugin + * @param string $pugin_name name of plugin or function + * @param string $plugin_type type of plugin * @return string call name of function */ - public function getPlugin($plugin_name, $plugin_type) { + public function getPlugin($plugin_name, $plugin_type) + { $function = null; if ($this->template->caching && ($this->nocache || $this->tag_nocache)) { if (isset($this->template->required_plugins['nocache'][$plugin_name][$plugin_type])) { $function = $this->template->required_plugins['nocache'][$plugin_name][$plugin_type]['function']; - } else if (isset($this->template->required_plugins['compiled'][$plugin_name][$plugin_type])) { + } elseif (isset($this->template->required_plugins['compiled'][$plugin_name][$plugin_type])) { $this->template->required_plugins['nocache'][$plugin_name][$plugin_type] = $this->template->required_plugins['compiled'][$plugin_name][$plugin_type]; $function = $this->template->required_plugins['nocache'][$plugin_name][$plugin_type]['function']; } } else { if (isset($this->template->required_plugins['compiled'][$plugin_name][$plugin_type])) { $function = $this->template->required_plugins['compiled'][$plugin_name][$plugin_type]['function']; - } else if (isset($this->template->required_plugins['nocache'][$plugin_name][$plugin_type])) { + } elseif (isset($this->template->required_plugins['nocache'][$plugin_name][$plugin_type])) { $this->template->required_plugins['compiled'][$plugin_name][$plugin_type] = $this->template->required_plugins['nocache'][$plugin_name][$plugin_type]; $function = $this->template->required_plugins['compiled'][$plugin_name][$plugin_type]['function']; } @@ -517,6 +599,7 @@ abstract class Smarty_Internal_TemplateCompilerBase { if ($plugin_type == 'modifier') { $this->modifier_plugins[$plugin_name] = true; } + return $function; } // loop through plugin dirs and find the plugin @@ -534,28 +617,31 @@ abstract class Smarty_Internal_TemplateCompilerBase { if ($plugin_type == 'modifier') { $this->modifier_plugins[$plugin_name] = true; } + return $function; } if (is_callable($function)) { // plugin function is defined in the script return $function; } + return false; } /** * Check for plugins by default plugin handler * - * @param string $tag name of tag - * @param string $plugin_type type of plugin + * @param string $tag name of tag + * @param string $plugin_type type of plugin * @return boolean true if found */ - public function getPluginFromDefaultHandler($tag, $plugin_type) { + public function getPluginFromDefaultHandler($tag, $plugin_type) + { $callback = null; $script = null; $cacheable = true; $result = call_user_func_array( - $this->smarty->default_plugin_handler_func, array($tag, $plugin_type, $this->template, &$callback, &$script, &$cacheable) + $this->smarty->default_plugin_handler_func, array($tag, $plugin_type, $this->template, &$callback, &$script, &$cacheable) ); if ($result) { $this->tag_nocache = $this->tag_nocache || !$cacheable; @@ -578,11 +664,13 @@ abstract class Smarty_Internal_TemplateCompilerBase { } if (is_callable($callback)) { $this->default_handler_plugins[$plugin_type][$tag] = array($callback, true, array()); + return true; } else { $this->trigger_template_error("Default plugin handler: Returned callback for \"{$tag}\" not callable"); } } + return false; } @@ -593,18 +681,20 @@ abstract class Smarty_Internal_TemplateCompilerBase { * If the content is compiled code and it should be not cached the code is injected * into the rendered output. * - * @param string $content content of template element - * @param boolean $is_code true if content is compiled code - * @return string content + * @param string $content content of template element + * @param boolean $is_code true if content is compiled code + * @return string content */ - public function processNocacheCode($content, $is_code) { + public function processNocacheCode($content, $is_code) + { // If the template is not evaluated and we have a nocache section and or a nocache tag if ($is_code && !empty($content)) { // generate replacement code if ((!($this->template->source->recompiled) || $this->forceNocache) && $this->template->caching && !$this->suppressNocacheProcessing && - ($this->nocache || $this->tag_nocache || $this->forceNocache == 2)) { + ($this->nocache || $this->tag_nocache) + ) { $this->template->has_nocache_code = true; - $_output = addcslashes($content,'\'\\'); + $_output = addcslashes($content, '\'\\'); $_output = str_replace("^#^", "'", $_output); $_output = "nocache_hash}%%*/" . $_output . "/*/%%SmartyNocache:{$this->nocache_hash}%%*/';?>\n"; // make sure we include modifier plugins for nocache code @@ -622,9 +712,51 @@ abstract class Smarty_Internal_TemplateCompilerBase { $this->modifier_plugins = array(); $this->suppressNocacheProcessing = false; $this->tag_nocache = false; + return $_output; } + /** + * push current file and line offset on stack for tracing {block} source lines + * + * @param string $file new filename + * @param string $uid uid of file + * @param string $debug false debug end_compile shall not be called + * @param int $line line offset to source + */ + public function pushTrace($file, $uid, $line, $debug = true) + { + if ($this->smarty->debugging && $debug) { + Smarty_Internal_Debug::end_compile($this->template); + } + array_push($this->trace_stack, array($this->smarty->_current_file, $this->trace_filepath, $this->trace_uid, $this->trace_line_offset)); + $this->trace_filepath = $this->smarty->_current_file = $file; + $this->trace_uid = $uid; + $this->trace_line_offset = $line ; + if ($this->smarty->debugging) { + Smarty_Internal_Debug::start_compile($this->template); + } + } + + /** + * restore file and line offset + * + */ + public function popTrace() + { + if ($this->smarty->debugging) { + Smarty_Internal_Debug::end_compile($this->template); + } + $r = array_pop($this->trace_stack); + $this->smarty->_current_file = $r[0]; + $this->trace_filepath = $r[1]; + $this->trace_uid = $r[2]; + $this->trace_line_offset = $r[3]; + if ($this->smarty->debugging) { + Smarty_Internal_Debug::start_compile($this->template); + } + } + /** * display compiler error messages without dying * @@ -633,17 +765,19 @@ abstract class Smarty_Internal_TemplateCompilerBase { * * If parameter $args contains a string this is used as error message * - * @param string $args individual error message or null - * @param string $line line-number + * @param string $args individual error message or null + * @param string $line line-number * @throws SmartyCompilerException when an unexpected token is found */ - public function trigger_template_error($args = null, $line = null) { + public function trigger_template_error($args = null, $line = null) + { // get template source line which has error if (!isset($line)) { $line = $this->lex->line; } +// $line += $this->trace_line_offset; $match = preg_split("/\n/", $this->lex->data); - $error_text = 'Syntax Error in template "' . $this->template->source->filepath . '" on line ' . $line . ' "' . trim(preg_replace('![\t\r\n]+!', ' ', $match[$line - 1])) . '" '; + $error_text = 'Syntax error in template "' . (empty($this->trace_filepath) ? $this->template->source->filepath : $this->trace_filepath) . '" on line ' . ($line + $this->trace_line_offset) . ' "' . trim(preg_replace('![\t\r\n]+!', ' ', $match[$line - 1])) . '" '; if (isset($args)) { // individual error message $error_text .= $args; @@ -664,9 +798,12 @@ abstract class Smarty_Internal_TemplateCompilerBase { $error_text .= ', expected one of: ' . implode(' , ', $expect); } } - throw new SmartyCompilerException($error_text); + $e = new SmartyCompilerException($error_text); + $e->line = $line; + $e->source = trim(preg_replace('![\t\r\n]+!', ' ', $match[$line - 1])); + $e->desc = $args; + $e->template = $this->template->source->filepath; + throw $e; } } - -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_templatelexer.php b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_templatelexer.php similarity index 66% rename from lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_templatelexer.php rename to lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_templatelexer.php index a7d5fa9a..61555aba 100644 --- a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_templatelexer.php +++ b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_templatelexer.php @@ -2,10 +2,10 @@ /** * Smarty Internal Plugin Templatelexer * -* This is the lexer to break the template source into tokens +* This is the lexer to break the template source into tokens * @package Smarty * @subpackage Compiler -* @author Uwe Tews +* @author Uwe Tews */ /** * Smarty Internal Plugin Templatelexer @@ -72,8 +72,8 @@ class Smarty_Internal_Templatelexer 'AS' => 'as', 'TO' => 'to', ); - - + + function __construct($data,$compiler) { // $this->data = preg_replace("/(\r\n|\r|\n)/", "\n", $data); @@ -82,10 +82,10 @@ class Smarty_Internal_Templatelexer $this->line = 1; $this->smarty = $compiler->smarty; $this->compiler = $compiler; - $this->ldel = preg_quote($this->smarty->left_delimiter,'/'); - $this->ldel_length = strlen($this->smarty->left_delimiter); + $this->ldel = preg_quote($this->smarty->left_delimiter,'/'); + $this->ldel_length = strlen($this->smarty->left_delimiter); $this->rdel = preg_quote($this->smarty->right_delimiter,'/'); - $this->rdel_length = strlen($this->smarty->right_delimiter); + $this->rdel_length = strlen($this->smarty->right_delimiter); $this->smarty_token_names['LDEL'] = $this->smarty->left_delimiter; $this->smarty_token_names['RDEL'] = $this->smarty->right_delimiter; $this->mbstring_overload = ini_get('mbstring.func_overload') & 2; @@ -95,42 +95,42 @@ class Smarty_Internal_Templatelexer private $_yy_state = 1; private $_yy_stack = array(); - function yylex() + public function yylex() { return $this->{'yylex' . $this->_yy_state}(); } - function yypushstate($state) + public function yypushstate($state) { array_push($this->_yy_stack, $this->_yy_state); $this->_yy_state = $state; } - function yypopstate() + public function yypopstate() { $this->_yy_state = array_pop($this->_yy_stack); } - function yybegin($state) + public function yybegin($state) { $this->_yy_state = $state; } - function yylex1() + public function yylex1() { $tokenMap = array ( 1 => 0, - 2 => 0, - 3 => 1, + 2 => 1, + 4 => 0, 5 => 0, 6 => 0, - 7 => 0, - 8 => 0, + 7 => 1, 9 => 0, 10 => 0, - 11 => 1, + 11 => 0, + 12 => 0, 13 => 0, 14 => 0, 15 => 0, @@ -138,16 +138,11 @@ class Smarty_Internal_Templatelexer 17 => 0, 18 => 0, 19 => 0, - 20 => 0, - 21 => 0, - 22 => 0, - 23 => 0, - 24 => 0, ); if ($this->counter >= ($this->mbstring_overload ? mb_strlen($this->data,'latin1'): strlen($this->data))) { return false; // end of input } - $yy_global_pattern = "/\G(".$this->ldel."[$]smarty\\.block\\.child".$this->rdel.")|\G(\\{\\})|\G(".$this->ldel."\\*([\S\s]*?)\\*".$this->rdel.")|\G(".$this->ldel."strip".$this->rdel.")|\G(".$this->ldel."\\s{1,}strip\\s{1,}".$this->rdel.")|\G(".$this->ldel."\/strip".$this->rdel.")|\G(".$this->ldel."\\s{1,}\/strip\\s{1,}".$this->rdel.")|\G(".$this->ldel."\\s*literal\\s*".$this->rdel.")|\G(".$this->ldel."\\s{1,}\/)|\G(".$this->ldel."\\s*(if|elseif|else if|while)\\s+)|\G(".$this->ldel."\\s*for\\s+)|\G(".$this->ldel."\\s*foreach(?![^\s]))|\G(".$this->ldel."\\s*setfilter\\s+)|\G(".$this->ldel."\\s{1,})|\G(".$this->ldel."\/)|\G(".$this->ldel.")|\G(<\\?(?:php\\w+|=|[a-zA-Z]+)?)|\G(\\?>)|\G(".$this->rdel.")|\G(<%)|\G(%>)|\G([\S\s])/iS"; + $yy_global_pattern = "/\G(\\{\\})|\G(".$this->ldel."\\s*\\*([\S\s]*?)\\*\\s*".$this->rdel.")|\G(".$this->ldel."\\s*strip\\s*".$this->rdel.")|\G(".$this->ldel."\\s*\/strip\\s*".$this->rdel.")|\G(".$this->ldel."\\s*literal\\s*".$this->rdel.")|\G(".$this->ldel."\\s*(if|elseif|else if|while)\\s+)|\G(".$this->ldel."\\s*for\\s+)|\G(".$this->ldel."\\s*foreach(?![^\s]))|\G(".$this->ldel."\\s*setfilter\\s+)|\G(".$this->ldel."\\s*\/)|\G(".$this->ldel."\\s*)|\G(<\\?(?:php\\w+|=|[a-zA-Z]+)?)|\G(\\?>)|\G(\\s*".$this->rdel.")|\G(<%)|\G(%>)|\G([\S\s])/iS"; do { if ($this->mbstring_overload ? preg_match($yy_global_pattern, mb_substr($this->data, $this->counter,2000000000,'latin1'), $yymatches) : preg_match($yy_global_pattern,$this->data, $yymatches, null, $this->counter)) { @@ -200,67 +195,45 @@ class Smarty_Internal_Templatelexer function yy_r1_1($yy_subpatterns) { - $this->token = Smarty_Internal_Templateparser::TP_SMARTYBLOCKCHILD; + $this->token = Smarty_Internal_Templateparser::TP_TEXT; } function yy_r1_2($yy_subpatterns) { - $this->token = Smarty_Internal_Templateparser::TP_TEXT; - } - function yy_r1_3($yy_subpatterns) - { - $this->token = Smarty_Internal_Templateparser::TP_COMMENT; } - function yy_r1_5($yy_subpatterns) + function yy_r1_4($yy_subpatterns) { - $this->token = Smarty_Internal_Templateparser::TP_STRIPON; - } - function yy_r1_6($yy_subpatterns) - { - - if ($this->smarty->auto_literal) { + if ($this->smarty->auto_literal && (strpos(" \n\t\r",substr($this->value,$this->ldel_length,1)) !== false)) { $this->token = Smarty_Internal_Templateparser::TP_TEXT; } else { $this->token = Smarty_Internal_Templateparser::TP_STRIPON; } + } + function yy_r1_5($yy_subpatterns) + { + + if ($this->smarty->auto_literal && (strpos(" \n\t\r",substr($this->value,$this->ldel_length,1)) !== false)) { + $this->token = Smarty_Internal_Templateparser::TP_TEXT; + } else { + $this->token = Smarty_Internal_Templateparser::TP_STRIPOFF; + } + } + function yy_r1_6($yy_subpatterns) + { + + if ($this->smarty->auto_literal && (strpos(" \n\t\r",substr($this->value,$this->ldel_length,1)) !== false)) { + $this->token = Smarty_Internal_Templateparser::TP_TEXT; + } else { + $this->token = Smarty_Internal_Templateparser::TP_LITERALSTART; + $this->yypushstate(self::LITERAL); + } } function yy_r1_7($yy_subpatterns) { - $this->token = Smarty_Internal_Templateparser::TP_STRIPOFF; - } - function yy_r1_8($yy_subpatterns) - { - - if ($this->smarty->auto_literal) { - $this->token = Smarty_Internal_Templateparser::TP_TEXT; - } else { - $this->token = Smarty_Internal_Templateparser::TP_STRIPOFF; - } - } - function yy_r1_9($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_LITERALSTART; - $this->yypushstate(self::LITERAL); - } - function yy_r1_10($yy_subpatterns) - { - - if ($this->smarty->auto_literal) { - $this->token = Smarty_Internal_Templateparser::TP_TEXT; - } else { - $this->token = Smarty_Internal_Templateparser::TP_LDELSLASH; - $this->yypushstate(self::SMARTY); - $this->taglineno = $this->line; - } - } - function yy_r1_11($yy_subpatterns) - { - - if ($this->smarty->auto_literal && trim(substr($this->value,$this->ldel_length,1)) == '') { + if ($this->smarty->auto_literal && (strpos(" \n\t\r",substr($this->value,$this->ldel_length,1)) !== false)) { $this->token = Smarty_Internal_Templateparser::TP_TEXT; } else { $this->token = Smarty_Internal_Templateparser::TP_LDELIF; @@ -268,10 +241,10 @@ class Smarty_Internal_Templatelexer $this->taglineno = $this->line; } } - function yy_r1_13($yy_subpatterns) + function yy_r1_9($yy_subpatterns) { - if ($this->smarty->auto_literal && trim(substr($this->value,$this->ldel_length,1)) == '') { + if ($this->smarty->auto_literal && (strpos(" \n\t\r",substr($this->value,$this->ldel_length,1)) !== false)) { $this->token = Smarty_Internal_Templateparser::TP_TEXT; } else { $this->token = Smarty_Internal_Templateparser::TP_LDELFOR; @@ -279,10 +252,10 @@ class Smarty_Internal_Templatelexer $this->taglineno = $this->line; } } - function yy_r1_14($yy_subpatterns) + function yy_r1_10($yy_subpatterns) { - if ($this->smarty->auto_literal && trim(substr($this->value,$this->ldel_length,1)) == '') { + if ($this->smarty->auto_literal && (strpos(" \n\t\r",substr($this->value,$this->ldel_length,1)) !== false)) { $this->token = Smarty_Internal_Templateparser::TP_TEXT; } else { $this->token = Smarty_Internal_Templateparser::TP_LDELFOREACH; @@ -290,10 +263,10 @@ class Smarty_Internal_Templatelexer $this->taglineno = $this->line; } } - function yy_r1_15($yy_subpatterns) + function yy_r1_11($yy_subpatterns) { - if ($this->smarty->auto_literal && trim(substr($this->value,$this->ldel_length,1)) == '') { + if ($this->smarty->auto_literal && (strpos(" \n\t\r",substr($this->value,$this->ldel_length,1)) !== false)) { $this->token = Smarty_Internal_Templateparser::TP_TEXT; } else { $this->token = Smarty_Internal_Templateparser::TP_LDELSETFILTER; @@ -301,32 +274,29 @@ class Smarty_Internal_Templatelexer $this->taglineno = $this->line; } } - function yy_r1_16($yy_subpatterns) + function yy_r1_12($yy_subpatterns) { - if ($this->smarty->auto_literal) { - $this->token = Smarty_Internal_Templateparser::TP_TEXT; + if ($this->smarty->auto_literal && (strpos(" \n\t\r",substr($this->value,$this->ldel_length,1)) !== false)) { + $this->token = Smarty_Internal_Templateparser::TP_TEXT; + } else { + $this->token = Smarty_Internal_Templateparser::TP_LDELSLASH; + $this->yypushstate(self::SMARTY); + $this->taglineno = $this->line; + } + } + function yy_r1_13($yy_subpatterns) + { + + if ($this->smarty->auto_literal && (strpos(" \n\t\r",substr($this->value,$this->ldel_length,1)) !== false)) { + $this->token = Smarty_Internal_Templateparser::TP_TEXT; } else { $this->token = Smarty_Internal_Templateparser::TP_LDEL; $this->yypushstate(self::SMARTY); $this->taglineno = $this->line; } } - function yy_r1_17($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_LDELSLASH; - $this->yypushstate(self::SMARTY); - $this->taglineno = $this->line; - } - function yy_r1_18($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_LDEL; - $this->yypushstate(self::SMARTY); - $this->taglineno = $this->line; - } - function yy_r1_19($yy_subpatterns) + function yy_r1_14($yy_subpatterns) { if (in_array($this->value, Array('', '=', 'value = substr($this->value, 0, 2); } } - function yy_r1_20($yy_subpatterns) + function yy_r1_15($yy_subpatterns) { $this->token = Smarty_Internal_Templateparser::TP_PHPENDTAG; } - function yy_r1_21($yy_subpatterns) + function yy_r1_16($yy_subpatterns) { $this->token = Smarty_Internal_Templateparser::TP_TEXT; } - function yy_r1_22($yy_subpatterns) + function yy_r1_17($yy_subpatterns) { $this->token = Smarty_Internal_Templateparser::TP_ASPSTARTTAG; } - function yy_r1_23($yy_subpatterns) + function yy_r1_18($yy_subpatterns) { $this->token = Smarty_Internal_Templateparser::TP_ASPENDTAG; } - function yy_r1_24($yy_subpatterns) + function yy_r1_19($yy_subpatterns) { if ($this->mbstring_overload) { @@ -379,7 +349,7 @@ class Smarty_Internal_Templatelexer } - function yylex2() + public function yylex2() { $tokenMap = array ( 1 => 0, @@ -395,14 +365,14 @@ class Smarty_Internal_Templatelexer 12 => 0, 13 => 0, 14 => 0, - 15 => 0, - 16 => 0, - 17 => 0, - 18 => 0, - 19 => 0, - 20 => 1, - 22 => 1, - 24 => 1, + 15 => 1, + 17 => 1, + 19 => 1, + 21 => 0, + 22 => 0, + 23 => 0, + 24 => 0, + 25 => 0, 26 => 0, 27 => 0, 28 => 0, @@ -415,22 +385,22 @@ class Smarty_Internal_Templatelexer 35 => 0, 36 => 0, 37 => 0, - 38 => 0, - 39 => 0, - 40 => 0, - 41 => 0, + 38 => 3, 42 => 0, - 43 => 3, + 43 => 0, + 44 => 0, + 45 => 0, + 46 => 0, 47 => 0, 48 => 0, 49 => 0, - 50 => 0, - 51 => 0, - 52 => 0, - 53 => 0, + 50 => 1, + 52 => 1, 54 => 0, - 55 => 1, - 57 => 1, + 55 => 0, + 56 => 0, + 57 => 0, + 58 => 0, 59 => 0, 60 => 0, 61 => 0, @@ -442,19 +412,17 @@ class Smarty_Internal_Templatelexer 67 => 0, 68 => 0, 69 => 0, - 70 => 0, - 71 => 0, + 70 => 1, 72 => 0, 73 => 0, 74 => 0, 75 => 0, 76 => 0, - 77 => 0, ); if ($this->counter >= ($this->mbstring_overload ? mb_strlen($this->data,'latin1'): strlen($this->data))) { return false; // end of input } - $yy_global_pattern = "/\G('[^'\\\\]*(?:\\\\.[^'\\\\]*)*')|\G(".$this->ldel."\\s{1,}\/)|\G(".$this->ldel."\\s*(if|elseif|else if|while)\\s+)|\G(".$this->ldel."\\s*for\\s+)|\G(".$this->ldel."\\s*foreach(?![^\s]))|\G(".$this->ldel."\\s{1,})|\G(\\s{1,}".$this->rdel.")|\G(".$this->ldel."\/)|\G(".$this->ldel.")|\G(".$this->rdel.")|\G(\\s+is\\s+in\\s+)|\G(\\s+as\\s+)|\G(\\s+to\\s+)|\G(\\s+step\\s+)|\G(\\s+instanceof\\s+)|\G(\\s*===\\s*)|\G(\\s*!==\\s*)|\G(\\s*==\\s*|\\s+eq\\s+)|\G(\\s*!=\\s*|\\s*<>\\s*|\\s+(ne|neq)\\s+)|\G(\\s*>=\\s*|\\s+(ge|gte)\\s+)|\G(\\s*<=\\s*|\\s+(le|lte)\\s+)|\G(\\s*>\\s*|\\s+gt\\s+)|\G(\\s*<\\s*|\\s+lt\\s+)|\G(\\s+mod\\s+)|\G(!\\s*|not\\s+)|\G(\\s*&&\\s*|\\s*and\\s+)|\G(\\s*\\|\\|\\s*|\\s*or\\s+)|\G(\\s*xor\\s+)|\G(\\s+is\\s+odd\\s+by\\s+)|\G(\\s+is\\s+not\\s+odd\\s+by\\s+)|\G(\\s+is\\s+odd)|\G(\\s+is\\s+not\\s+odd)|\G(\\s+is\\s+even\\s+by\\s+)|\G(\\s+is\\s+not\\s+even\\s+by\\s+)|\G(\\s+is\\s+even)|\G(\\s+is\\s+not\\s+even)|\G(\\s+is\\s+div\\s+by\\s+)|\G(\\s+is\\s+not\\s+div\\s+by\\s+)|\G(\\((int(eger)?|bool(ean)?|float|double|real|string|binary|array|object)\\)\\s*)|\G(\\s*\\(\\s*)|\G(\\s*\\))|\G(\\[\\s*)|\G(\\s*\\])|\G(\\s*->\\s*)|\G(\\s*=>\\s*)|\G(\\s*=\\s*)|\G(\\+\\+|--)|\G(\\s*(\\+|-)\\s*)|\G(\\s*(\\*|\/|%)\\s*)|\G(\\$)|\G(\\s*;)|\G(::)|\G(\\s*:\\s*)|\G(@)|\G(#)|\G(\")|\G(`)|\G(\\|)|\G(\\.)|\G(\\s*,\\s*)|\G(\\s*&\\s*)|\G(\\s*\\?\\s*)|\G(0[xX][0-9a-fA-F]+)|\G(\\s+[0-9]*[a-zA-Z_][a-zA-Z0-9_\-:]*\\s*=\\s*)|\G([0-9]*[a-zA-Z_]\\w*)|\G(\\d+)|\G(\\s+)|\G([\S\s])/iS"; + $yy_global_pattern = "/\G(\")|\G('[^'\\\\]*(?:\\\\.[^'\\\\]*)*')|\G([$]smarty\\.block\\.(child|parent))|\G(\\$)|\G(\\s*".$this->rdel.")|\G(\\s+is\\s+in\\s+)|\G(\\s+as\\s+)|\G(\\s+to\\s+)|\G(\\s+step\\s+)|\G(\\s+instanceof\\s+)|\G(\\s*===\\s*)|\G(\\s*!==\\s*)|\G(\\s*==\\s*|\\s+eq\\s+)|\G(\\s*!=\\s*|\\s*<>\\s*|\\s+(ne|neq)\\s+)|\G(\\s*>=\\s*|\\s+(ge|gte)\\s+)|\G(\\s*<=\\s*|\\s+(le|lte)\\s+)|\G(\\s*>\\s*|\\s+gt\\s+)|\G(\\s*<\\s*|\\s+lt\\s+)|\G(\\s+mod\\s+)|\G(!\\s*|not\\s+)|\G(\\s*&&\\s*|\\s*and\\s+)|\G(\\s*\\|\\|\\s*|\\s*or\\s+)|\G(\\s*xor\\s+)|\G(\\s+is\\s+odd\\s+by\\s+)|\G(\\s+is\\s+not\\s+odd\\s+by\\s+)|\G(\\s+is\\s+odd)|\G(\\s+is\\s+not\\s+odd)|\G(\\s+is\\s+even\\s+by\\s+)|\G(\\s+is\\s+not\\s+even\\s+by\\s+)|\G(\\s+is\\s+even)|\G(\\s+is\\s+not\\s+even)|\G(\\s+is\\s+div\\s+by\\s+)|\G(\\s+is\\s+not\\s+div\\s+by\\s+)|\G(\\((int(eger)?|bool(ean)?|float|double|real|string|binary|array|object)\\)\\s*)|\G(\\s*\\(\\s*)|\G(\\s*\\))|\G(\\[\\s*)|\G(\\s*\\])|\G(\\s*->\\s*)|\G(\\s*=>\\s*)|\G(\\s*=\\s*)|\G(\\+\\+|--)|\G(\\s*(\\+|-)\\s*)|\G(\\s*(\\*|\/|%)\\s*)|\G(@)|\G(#)|\G(\\s+[0-9]*[a-zA-Z_][a-zA-Z0-9_\-:]*\\s*=\\s*)|\G([0-9]*[a-zA-Z_]\\w*)|\G(\\d+)|\G(`)|\G(\\|)|\G(\\.)|\G(\\s*,\\s*)|\G(\\s*;)|\G(::)|\G(\\s*:\\s*)|\G(\\s*&\\s*)|\G(\\s*\\?\\s*)|\G(0[xX][0-9a-fA-F]+)|\G(\\s+)|\G(".$this->ldel."\\s*(if|elseif|else if|while)\\s+)|\G(".$this->ldel."\\s*for\\s+)|\G(".$this->ldel."\\s*foreach(?![^\s]))|\G(".$this->ldel."\\s*\/)|\G(".$this->ldel."\\s*)|\G([\S\s])/iS"; do { if ($this->mbstring_overload ? preg_match($yy_global_pattern, mb_substr($this->data, $this->counter,2000000000,'latin1'), $yymatches) : preg_match($yy_global_pattern,$this->data, $yymatches, null, $this->counter)) { @@ -507,357 +475,237 @@ class Smarty_Internal_Templatelexer function yy_r2_1($yy_subpatterns) { - $this->token = Smarty_Internal_Templateparser::TP_SINGLEQUOTESTRING; + $this->token = Smarty_Internal_Templateparser::TP_QUOTE; + $this->yypushstate(self::DOUBLEQUOTEDSTRING); } function yy_r2_2($yy_subpatterns) { - if ($this->smarty->auto_literal) { - $this->token = Smarty_Internal_Templateparser::TP_TEXT; - } else { - $this->token = Smarty_Internal_Templateparser::TP_LDELSLASH; - $this->yypushstate(self::SMARTY); - $this->taglineno = $this->line; - } + $this->token = Smarty_Internal_Templateparser::TP_SINGLEQUOTESTRING; } function yy_r2_3($yy_subpatterns) { - if ($this->smarty->auto_literal && trim(substr($this->value,$this->ldel_length,1)) == '') { - $this->token = Smarty_Internal_Templateparser::TP_TEXT; - } else { - $this->token = Smarty_Internal_Templateparser::TP_LDELIF; - $this->yypushstate(self::SMARTY); + $this->token = Smarty_Internal_Templateparser::TP_SMARTYBLOCKCHILDPARENT; $this->taglineno = $this->line; - } } function yy_r2_5($yy_subpatterns) { - if ($this->smarty->auto_literal && trim(substr($this->value,$this->ldel_length,1)) == '') { - $this->token = Smarty_Internal_Templateparser::TP_TEXT; - } else { - $this->token = Smarty_Internal_Templateparser::TP_LDELFOR; - $this->yypushstate(self::SMARTY); - $this->taglineno = $this->line; - } + $this->token = Smarty_Internal_Templateparser::TP_DOLLAR; } function yy_r2_6($yy_subpatterns) { - if ($this->smarty->auto_literal && trim(substr($this->value,$this->ldel_length,1)) == '') { - $this->token = Smarty_Internal_Templateparser::TP_TEXT; - } else { - $this->token = Smarty_Internal_Templateparser::TP_LDELFOREACH; - $this->yypushstate(self::SMARTY); - $this->taglineno = $this->line; - } + $this->token = Smarty_Internal_Templateparser::TP_RDEL; + $this->yypopstate(); } function yy_r2_7($yy_subpatterns) { - if ($this->smarty->auto_literal) { - $this->token = Smarty_Internal_Templateparser::TP_TEXT; - } else { - $this->token = Smarty_Internal_Templateparser::TP_LDEL; - $this->yypushstate(self::SMARTY); - $this->taglineno = $this->line; - } + $this->token = Smarty_Internal_Templateparser::TP_ISIN; } function yy_r2_8($yy_subpatterns) { - $this->token = Smarty_Internal_Templateparser::TP_RDEL; - $this->yypopstate(); + $this->token = Smarty_Internal_Templateparser::TP_AS; } function yy_r2_9($yy_subpatterns) { - $this->token = Smarty_Internal_Templateparser::TP_LDELSLASH; - $this->yypushstate(self::SMARTY); - $this->taglineno = $this->line; + $this->token = Smarty_Internal_Templateparser::TP_TO; } function yy_r2_10($yy_subpatterns) { - $this->token = Smarty_Internal_Templateparser::TP_LDEL; - $this->yypushstate(self::SMARTY); - $this->taglineno = $this->line; + $this->token = Smarty_Internal_Templateparser::TP_STEP; } function yy_r2_11($yy_subpatterns) { - $this->token = Smarty_Internal_Templateparser::TP_RDEL; - $this->yypopstate(); + $this->token = Smarty_Internal_Templateparser::TP_INSTANCEOF; } function yy_r2_12($yy_subpatterns) { - $this->token = Smarty_Internal_Templateparser::TP_ISIN; + $this->token = Smarty_Internal_Templateparser::TP_IDENTITY; } function yy_r2_13($yy_subpatterns) { - $this->token = Smarty_Internal_Templateparser::TP_AS; + $this->token = Smarty_Internal_Templateparser::TP_NONEIDENTITY; } function yy_r2_14($yy_subpatterns) { - $this->token = Smarty_Internal_Templateparser::TP_TO; + $this->token = Smarty_Internal_Templateparser::TP_EQUALS; } function yy_r2_15($yy_subpatterns) { - $this->token = Smarty_Internal_Templateparser::TP_STEP; - } - function yy_r2_16($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_INSTANCEOF; + $this->token = Smarty_Internal_Templateparser::TP_NOTEQUALS; } function yy_r2_17($yy_subpatterns) { - $this->token = Smarty_Internal_Templateparser::TP_IDENTITY; - } - function yy_r2_18($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_NONEIDENTITY; + $this->token = Smarty_Internal_Templateparser::TP_GREATEREQUAL; } function yy_r2_19($yy_subpatterns) { - $this->token = Smarty_Internal_Templateparser::TP_EQUALS; - } - function yy_r2_20($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_NOTEQUALS; - } - function yy_r2_22($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_GREATEREQUAL; - } - function yy_r2_24($yy_subpatterns) - { - $this->token = Smarty_Internal_Templateparser::TP_LESSEQUAL; } - function yy_r2_26($yy_subpatterns) + function yy_r2_21($yy_subpatterns) { $this->token = Smarty_Internal_Templateparser::TP_GREATERTHAN; } - function yy_r2_27($yy_subpatterns) + function yy_r2_22($yy_subpatterns) { $this->token = Smarty_Internal_Templateparser::TP_LESSTHAN; } - function yy_r2_28($yy_subpatterns) + function yy_r2_23($yy_subpatterns) { $this->token = Smarty_Internal_Templateparser::TP_MOD; } - function yy_r2_29($yy_subpatterns) + function yy_r2_24($yy_subpatterns) { $this->token = Smarty_Internal_Templateparser::TP_NOT; } - function yy_r2_30($yy_subpatterns) + function yy_r2_25($yy_subpatterns) { $this->token = Smarty_Internal_Templateparser::TP_LAND; } - function yy_r2_31($yy_subpatterns) + function yy_r2_26($yy_subpatterns) { $this->token = Smarty_Internal_Templateparser::TP_LOR; } - function yy_r2_32($yy_subpatterns) + function yy_r2_27($yy_subpatterns) { $this->token = Smarty_Internal_Templateparser::TP_LXOR; } - function yy_r2_33($yy_subpatterns) + function yy_r2_28($yy_subpatterns) { $this->token = Smarty_Internal_Templateparser::TP_ISODDBY; } - function yy_r2_34($yy_subpatterns) + function yy_r2_29($yy_subpatterns) { $this->token = Smarty_Internal_Templateparser::TP_ISNOTODDBY; } - function yy_r2_35($yy_subpatterns) + function yy_r2_30($yy_subpatterns) { $this->token = Smarty_Internal_Templateparser::TP_ISODD; } - function yy_r2_36($yy_subpatterns) + function yy_r2_31($yy_subpatterns) { $this->token = Smarty_Internal_Templateparser::TP_ISNOTODD; } - function yy_r2_37($yy_subpatterns) + function yy_r2_32($yy_subpatterns) { $this->token = Smarty_Internal_Templateparser::TP_ISEVENBY; } - function yy_r2_38($yy_subpatterns) + function yy_r2_33($yy_subpatterns) { $this->token = Smarty_Internal_Templateparser::TP_ISNOTEVENBY; } - function yy_r2_39($yy_subpatterns) + function yy_r2_34($yy_subpatterns) { $this->token = Smarty_Internal_Templateparser::TP_ISEVEN; } - function yy_r2_40($yy_subpatterns) + function yy_r2_35($yy_subpatterns) { $this->token = Smarty_Internal_Templateparser::TP_ISNOTEVEN; } - function yy_r2_41($yy_subpatterns) + function yy_r2_36($yy_subpatterns) { $this->token = Smarty_Internal_Templateparser::TP_ISDIVBY; } - function yy_r2_42($yy_subpatterns) + function yy_r2_37($yy_subpatterns) { $this->token = Smarty_Internal_Templateparser::TP_ISNOTDIVBY; } - function yy_r2_43($yy_subpatterns) + function yy_r2_38($yy_subpatterns) { $this->token = Smarty_Internal_Templateparser::TP_TYPECAST; } - function yy_r2_47($yy_subpatterns) + function yy_r2_42($yy_subpatterns) { $this->token = Smarty_Internal_Templateparser::TP_OPENP; } - function yy_r2_48($yy_subpatterns) + function yy_r2_43($yy_subpatterns) { $this->token = Smarty_Internal_Templateparser::TP_CLOSEP; } - function yy_r2_49($yy_subpatterns) + function yy_r2_44($yy_subpatterns) { $this->token = Smarty_Internal_Templateparser::TP_OPENB; } - function yy_r2_50($yy_subpatterns) + function yy_r2_45($yy_subpatterns) { $this->token = Smarty_Internal_Templateparser::TP_CLOSEB; } - function yy_r2_51($yy_subpatterns) + function yy_r2_46($yy_subpatterns) { - $this->token = Smarty_Internal_Templateparser::TP_PTR; + $this->token = Smarty_Internal_Templateparser::TP_PTR; } - function yy_r2_52($yy_subpatterns) + function yy_r2_47($yy_subpatterns) { $this->token = Smarty_Internal_Templateparser::TP_APTR; } - function yy_r2_53($yy_subpatterns) + function yy_r2_48($yy_subpatterns) { $this->token = Smarty_Internal_Templateparser::TP_EQUAL; } - function yy_r2_54($yy_subpatterns) + function yy_r2_49($yy_subpatterns) { $this->token = Smarty_Internal_Templateparser::TP_INCDEC; } - function yy_r2_55($yy_subpatterns) + function yy_r2_50($yy_subpatterns) { $this->token = Smarty_Internal_Templateparser::TP_UNIMATH; } - function yy_r2_57($yy_subpatterns) + function yy_r2_52($yy_subpatterns) { $this->token = Smarty_Internal_Templateparser::TP_MATH; } - function yy_r2_59($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_DOLLAR; - } - function yy_r2_60($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_SEMICOLON; - } - function yy_r2_61($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_DOUBLECOLON; - } - function yy_r2_62($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_COLON; - } - function yy_r2_63($yy_subpatterns) + function yy_r2_54($yy_subpatterns) { $this->token = Smarty_Internal_Templateparser::TP_AT; } - function yy_r2_64($yy_subpatterns) + function yy_r2_55($yy_subpatterns) { $this->token = Smarty_Internal_Templateparser::TP_HATCH; } - function yy_r2_65($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_QUOTE; - $this->yypushstate(self::DOUBLEQUOTEDSTRING); - } - function yy_r2_66($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_BACKTICK; - $this->yypopstate(); - } - function yy_r2_67($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_VERT; - } - function yy_r2_68($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_DOT; - } - function yy_r2_69($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_COMMA; - } - function yy_r2_70($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_ANDSYM; - } - function yy_r2_71($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_QMARK; - } - function yy_r2_72($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_HEX; - } - function yy_r2_73($yy_subpatterns) + function yy_r2_56($yy_subpatterns) { // resolve conflicts with shorttag and right_delimiter starting with '=' @@ -869,22 +717,128 @@ class Smarty_Internal_Templatelexer $this->token = Smarty_Internal_Templateparser::TP_ATTR; } } - function yy_r2_74($yy_subpatterns) + function yy_r2_57($yy_subpatterns) { $this->token = Smarty_Internal_Templateparser::TP_ID; } - function yy_r2_75($yy_subpatterns) + function yy_r2_58($yy_subpatterns) { $this->token = Smarty_Internal_Templateparser::TP_INTEGER; } - function yy_r2_76($yy_subpatterns) + function yy_r2_59($yy_subpatterns) + { + + $this->token = Smarty_Internal_Templateparser::TP_BACKTICK; + $this->yypopstate(); + } + function yy_r2_60($yy_subpatterns) + { + + $this->token = Smarty_Internal_Templateparser::TP_VERT; + } + function yy_r2_61($yy_subpatterns) + { + + $this->token = Smarty_Internal_Templateparser::TP_DOT; + } + function yy_r2_62($yy_subpatterns) + { + + $this->token = Smarty_Internal_Templateparser::TP_COMMA; + } + function yy_r2_63($yy_subpatterns) + { + + $this->token = Smarty_Internal_Templateparser::TP_SEMICOLON; + } + function yy_r2_64($yy_subpatterns) + { + + $this->token = Smarty_Internal_Templateparser::TP_DOUBLECOLON; + } + function yy_r2_65($yy_subpatterns) + { + + $this->token = Smarty_Internal_Templateparser::TP_COLON; + } + function yy_r2_66($yy_subpatterns) + { + + $this->token = Smarty_Internal_Templateparser::TP_ANDSYM; + } + function yy_r2_67($yy_subpatterns) + { + + $this->token = Smarty_Internal_Templateparser::TP_QMARK; + } + function yy_r2_68($yy_subpatterns) + { + + $this->token = Smarty_Internal_Templateparser::TP_HEX; + } + function yy_r2_69($yy_subpatterns) { $this->token = Smarty_Internal_Templateparser::TP_SPACE; } - function yy_r2_77($yy_subpatterns) + function yy_r2_70($yy_subpatterns) + { + + if ($this->smarty->auto_literal && (strpos(" \n\t\r",substr($this->value,$this->ldel_length,1)) !== false)) { + $this->token = Smarty_Internal_Templateparser::TP_TEXT; + } else { + $this->token = Smarty_Internal_Templateparser::TP_LDELIF; + $this->yypushstate(self::SMARTY); + $this->taglineno = $this->line; + } + } + function yy_r2_72($yy_subpatterns) + { + + if ($this->smarty->auto_literal && (strpos(" \n\t\r",substr($this->value,$this->ldel_length,1)) !== false)) { + $this->token = Smarty_Internal_Templateparser::TP_TEXT; + } else { + $this->token = Smarty_Internal_Templateparser::TP_LDELFOR; + $this->yypushstate(self::SMARTY); + $this->taglineno = $this->line; + } + } + function yy_r2_73($yy_subpatterns) + { + + if ($this->smarty->auto_literal && (strpos(" \n\t\r",substr($this->value,$this->ldel_length,1)) !== false)) { + $this->token = Smarty_Internal_Templateparser::TP_TEXT; + } else { + $this->token = Smarty_Internal_Templateparser::TP_LDELFOREACH; + $this->yypushstate(self::SMARTY); + $this->taglineno = $this->line; + } + } + function yy_r2_74($yy_subpatterns) + { + + if ($this->smarty->auto_literal && (strpos(" \n\t\r",substr($this->value,$this->ldel_length,1)) !== false)) { + $this->token = Smarty_Internal_Templateparser::TP_TEXT; + } else { + $this->token = Smarty_Internal_Templateparser::TP_LDELSLASH; + $this->yypushstate(self::SMARTY); + $this->taglineno = $this->line; + } + } + function yy_r2_75($yy_subpatterns) + { + + if ($this->smarty->auto_literal && (strpos(" \n\t\r",substr($this->value,$this->ldel_length,1)) !== false)) { + $this->token = Smarty_Internal_Templateparser::TP_TEXT; + } else { + $this->token = Smarty_Internal_Templateparser::TP_LDEL; + $this->yypushstate(self::SMARTY); + $this->taglineno = $this->line; + } + } + function yy_r2_76($yy_subpatterns) { $this->token = Smarty_Internal_Templateparser::TP_TEXT; @@ -892,7 +846,7 @@ class Smarty_Internal_Templatelexer - function yylex3() + public function yylex3() { $tokenMap = array ( 1 => 0, @@ -959,14 +913,22 @@ class Smarty_Internal_Templatelexer function yy_r3_1($yy_subpatterns) { - $this->token = Smarty_Internal_Templateparser::TP_LITERALSTART; - $this->yypushstate(self::LITERAL); + if ($this->smarty->auto_literal && (strpos(" \n\t\r",substr($this->value,$this->ldel_length,1)) !== false)) { + $this->token = Smarty_Internal_Templateparser::TP_TEXT; + } else { + $this->token = Smarty_Internal_Templateparser::TP_LITERALSTART; + $this->yypushstate(self::LITERAL); + } } function yy_r3_2($yy_subpatterns) { - $this->token = Smarty_Internal_Templateparser::TP_LITERALEND; - $this->yypopstate(); + if ($this->smarty->auto_literal && (strpos(" \n\t\r",substr($this->value,$this->ldel_length,1)) !== false)) { + $this->token = Smarty_Internal_Templateparser::TP_TEXT; + } else { + $this->token = Smarty_Internal_Templateparser::TP_LITERALEND; + $this->yypopstate(); + } } function yy_r3_3($yy_subpatterns) { @@ -1006,7 +968,7 @@ class Smarty_Internal_Templatelexer $to = $match[0][1]; } else { $this->compiler->trigger_template_error ("missing or misspelled literal closing tag"); - } + } if ($this->mbstring_overload) { $this->value = mb_substr($this->data,$this->counter,$to-$this->counter,'latin1'); } else { @@ -1016,11 +978,11 @@ class Smarty_Internal_Templatelexer } - function yylex4() + public function yylex4() { $tokenMap = array ( - 1 => 0, - 2 => 1, + 1 => 1, + 3 => 0, 4 => 0, 5 => 0, 6 => 0, @@ -1028,15 +990,13 @@ class Smarty_Internal_Templatelexer 8 => 0, 9 => 0, 10 => 0, - 11 => 0, - 12 => 0, - 13 => 3, - 17 => 0, + 11 => 3, + 15 => 0, ); if ($this->counter >= ($this->mbstring_overload ? mb_strlen($this->data,'latin1'): strlen($this->data))) { return false; // end of input } - $yy_global_pattern = "/\G(".$this->ldel."\\s{1,}\/)|\G(".$this->ldel."\\s*(if|elseif|else if|while)\\s+)|\G(".$this->ldel."\\s*for\\s+)|\G(".$this->ldel."\\s*foreach(?![^\s]))|\G(".$this->ldel."\\s{1,})|\G(".$this->ldel."\/)|\G(".$this->ldel.")|\G(\")|\G(`\\$)|\G(\\$[0-9]*[a-zA-Z_]\\w*)|\G(\\$)|\G(([^\"\\\\]*?)((?:\\\\.[^\"\\\\]*?)*?)(?=(".$this->ldel."|\\$|`\\$|\")))|\G([\S\s])/iS"; + $yy_global_pattern = "/\G(".$this->ldel."\\s*(if|elseif|else if|while)\\s+)|\G(".$this->ldel."\\s*for\\s+)|\G(".$this->ldel."\\s*foreach(?![^\s]))|\G(".$this->ldel."\\s*\/)|\G(".$this->ldel."\\s*)|\G(\")|\G(`\\$)|\G(\\$[0-9]*[a-zA-Z_]\\w*)|\G(\\$)|\G(([^\"\\\\]*?)((?:\\\\.[^\"\\\\]*?)*?)(?=(".$this->ldel."|\\$|`\\$|\")))|\G([\S\s])/iS"; do { if ($this->mbstring_overload ? preg_match($yy_global_pattern, mb_substr($this->data, $this->counter,2000000000,'latin1'), $yymatches) : preg_match($yy_global_pattern,$this->data, $yymatches, null, $this->counter)) { @@ -1089,18 +1049,7 @@ class Smarty_Internal_Templatelexer function yy_r4_1($yy_subpatterns) { - if ($this->smarty->auto_literal) { - $this->token = Smarty_Internal_Templateparser::TP_TEXT; - } else { - $this->token = Smarty_Internal_Templateparser::TP_LDELSLASH; - $this->yypushstate(self::SMARTY); - $this->taglineno = $this->line; - } - } - function yy_r4_2($yy_subpatterns) - { - - if ($this->smarty->auto_literal && trim(substr($this->value,$this->ldel_length,1)) == '') { + if ($this->smarty->auto_literal && (strpos(" \n\t\r",substr($this->value,$this->ldel_length,1)) !== false)) { $this->token = Smarty_Internal_Templateparser::TP_TEXT; } else { $this->token = Smarty_Internal_Templateparser::TP_LDELIF; @@ -1108,10 +1057,10 @@ class Smarty_Internal_Templatelexer $this->taglineno = $this->line; } } - function yy_r4_4($yy_subpatterns) + function yy_r4_3($yy_subpatterns) { - if ($this->smarty->auto_literal && trim(substr($this->value,$this->ldel_length,1)) == '') { + if ($this->smarty->auto_literal && (strpos(" \n\t\r",substr($this->value,$this->ldel_length,1)) !== false)) { $this->token = Smarty_Internal_Templateparser::TP_TEXT; } else { $this->token = Smarty_Internal_Templateparser::TP_LDELFOR; @@ -1119,22 +1068,33 @@ class Smarty_Internal_Templatelexer $this->taglineno = $this->line; } } - function yy_r4_5($yy_subpatterns) + function yy_r4_4($yy_subpatterns) { - if ($this->smarty->auto_literal && trim(substr($this->value,$this->ldel_length,1)) == '') { + if ($this->smarty->auto_literal && (strpos(" \n\t\r",substr($this->value,$this->ldel_length,1)) !== false)) { $this->token = Smarty_Internal_Templateparser::TP_TEXT; } else { $this->token = Smarty_Internal_Templateparser::TP_LDELFOREACH; $this->yypushstate(self::SMARTY); $this->taglineno = $this->line; + } + } + function yy_r4_5($yy_subpatterns) + { + + if ($this->smarty->auto_literal && (strpos(" \n\t\r",substr($this->value,$this->ldel_length,1)) !== false)) { + $this->token = Smarty_Internal_Templateparser::TP_TEXT; + } else { + $this->token = Smarty_Internal_Templateparser::TP_LDELSLASH; + $this->yypushstate(self::SMARTY); + $this->taglineno = $this->line; } } function yy_r4_6($yy_subpatterns) { - if ($this->smarty->auto_literal) { - $this->token = Smarty_Internal_Templateparser::TP_TEXT; + if ($this->smarty->auto_literal && (strpos(" \n\t\r",substr($this->value,$this->ldel_length,1)) !== false)) { + $this->token = Smarty_Internal_Templateparser::TP_TEXT; } else { $this->token = Smarty_Internal_Templateparser::TP_LDEL; $this->yypushstate(self::SMARTY); @@ -1144,24 +1104,10 @@ class Smarty_Internal_Templatelexer function yy_r4_7($yy_subpatterns) { - $this->token = Smarty_Internal_Templateparser::TP_LDELSLASH; - $this->yypushstate(self::SMARTY); - $this->taglineno = $this->line; - } - function yy_r4_8($yy_subpatterns) - { - - $this->token = Smarty_Internal_Templateparser::TP_LDEL; - $this->yypushstate(self::SMARTY); - $this->taglineno = $this->line; - } - function yy_r4_9($yy_subpatterns) - { - $this->token = Smarty_Internal_Templateparser::TP_QUOTE; $this->yypopstate(); } - function yy_r4_10($yy_subpatterns) + function yy_r4_8($yy_subpatterns) { $this->token = Smarty_Internal_Templateparser::TP_BACKTICK; @@ -1169,22 +1115,22 @@ class Smarty_Internal_Templatelexer $this->yypushstate(self::SMARTY); $this->taglineno = $this->line; } - function yy_r4_11($yy_subpatterns) + function yy_r4_9($yy_subpatterns) { $this->token = Smarty_Internal_Templateparser::TP_DOLLARID; } - function yy_r4_12($yy_subpatterns) + function yy_r4_10($yy_subpatterns) { $this->token = Smarty_Internal_Templateparser::TP_TEXT; } - function yy_r4_13($yy_subpatterns) + function yy_r4_11($yy_subpatterns) { $this->token = Smarty_Internal_Templateparser::TP_TEXT; } - function yy_r4_17($yy_subpatterns) + function yy_r4_15($yy_subpatterns) { if ($this->mbstring_overload) { @@ -1200,4 +1146,226 @@ class Smarty_Internal_Templatelexer $this->token = Smarty_Internal_Templateparser::TP_TEXT; } + + public function yylex5() + { + $tokenMap = array ( + 1 => 0, + 2 => 0, + 3 => 0, + 4 => 0, + ); + if ($this->counter >= ($this->mbstring_overload ? mb_strlen($this->data,'latin1'): strlen($this->data))) { + return false; // end of input + } + $yy_global_pattern = "/\G(".$this->ldel."\\s*strip\\s*".$this->rdel.")|\G(".$this->ldel."\\s*\/strip\\s*".$this->rdel.")|\G(".$this->ldel."\\s*block)|\G([\S\s])/iS"; + + do { + if ($this->mbstring_overload ? preg_match($yy_global_pattern, mb_substr($this->data, $this->counter,2000000000,'latin1'), $yymatches) : preg_match($yy_global_pattern,$this->data, $yymatches, null, $this->counter)) { + $yysubmatches = $yymatches; + $yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns + if (!count($yymatches)) { + throw new Exception('Error: lexing failed because a rule matched' . + ' an empty string. Input "' . substr($this->data, + $this->counter, 5) . '... state CHILDBODY'); + } + next($yymatches); // skip global match + $this->token = key($yymatches); // token number + if ($tokenMap[$this->token]) { + // extract sub-patterns for passing to lex function + $yysubmatches = array_slice($yysubmatches, $this->token + 1, + $tokenMap[$this->token]); + } else { + $yysubmatches = array(); + } + $this->value = current($yymatches); // token value + $r = $this->{'yy_r5_' . $this->token}($yysubmatches); + if ($r === null) { + $this->counter += ($this->mbstring_overload ? mb_strlen($this->value,'latin1'): strlen($this->value)); + $this->line += substr_count($this->value, "\n"); + // accept this token + return true; + } elseif ($r === true) { + // we have changed state + // process this token in the new state + return $this->yylex(); + } elseif ($r === false) { + $this->counter += ($this->mbstring_overload ? mb_strlen($this->value,'latin1'): strlen($this->value)); + $this->line += substr_count($this->value, "\n"); + if ($this->counter >= ($this->mbstring_overload ? mb_strlen($this->data,'latin1'): strlen($this->data))) { + return false; // end of input + } + // skip this token + continue; + } } else { + throw new Exception('Unexpected input at line' . $this->line . + ': ' . $this->data[$this->counter]); + } + break; + } while (true); + + } // end function + + + const CHILDBODY = 5; + function yy_r5_1($yy_subpatterns) + { + + if ($this->smarty->auto_literal && (strpos(" \n\t\r",substr($this->value,$this->ldel_length,1)) !== false)) { + return false; + } else { + $this->token = Smarty_Internal_Templateparser::TP_STRIPON; + } + } + function yy_r5_2($yy_subpatterns) + { + + if ($this->smarty->auto_literal && (strpos(" \n\t\r",substr($this->value,$this->ldel_length,1)) !== false)) { + return false; + } else { + $this->token = Smarty_Internal_Templateparser::TP_STRIPOFF; + } + } + function yy_r5_3($yy_subpatterns) + { + + if ($this->smarty->auto_literal && (strpos(" \n\t\r",substr($this->value,$this->ldel_length,1)) !== false)) { + return false; + } else { + $this->yypopstate(); + return true; + } + } + function yy_r5_4($yy_subpatterns) + { + + if ($this->mbstring_overload) { + $to = mb_strlen($this->data,'latin1'); + } else { + $to = strlen($this->data); + } + preg_match("/".$this->ldel."\s*((\/)?strip\s*".$this->rdel."|block\s+)/",$this->data,$match,PREG_OFFSET_CAPTURE,$this->counter); + if (isset($match[0][1])) { + $to = $match[0][1]; + } + if ($this->mbstring_overload) { + $this->value = mb_substr($this->data,$this->counter,$to-$this->counter,'latin1'); + } else { + $this->value = substr($this->data,$this->counter,$to-$this->counter); + } + return false; + } + + + public function yylex6() + { + $tokenMap = array ( + 1 => 0, + 2 => 0, + 3 => 1, + 5 => 0, + ); + if ($this->counter >= ($this->mbstring_overload ? mb_strlen($this->data,'latin1'): strlen($this->data))) { + return false; // end of input + } + $yy_global_pattern = "/\G(".$this->ldel."\\s*block)|\G(".$this->ldel."\\s*\/block)|\G(".$this->ldel."\\s*[$]smarty\\.block\\.(child|parent))|\G([\S\s])/iS"; + + do { + if ($this->mbstring_overload ? preg_match($yy_global_pattern, mb_substr($this->data, $this->counter,2000000000,'latin1'), $yymatches) : preg_match($yy_global_pattern,$this->data, $yymatches, null, $this->counter)) { + $yysubmatches = $yymatches; + $yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns + if (!count($yymatches)) { + throw new Exception('Error: lexing failed because a rule matched' . + ' an empty string. Input "' . substr($this->data, + $this->counter, 5) . '... state CHILDBLOCK'); + } + next($yymatches); // skip global match + $this->token = key($yymatches); // token number + if ($tokenMap[$this->token]) { + // extract sub-patterns for passing to lex function + $yysubmatches = array_slice($yysubmatches, $this->token + 1, + $tokenMap[$this->token]); + } else { + $yysubmatches = array(); + } + $this->value = current($yymatches); // token value + $r = $this->{'yy_r6_' . $this->token}($yysubmatches); + if ($r === null) { + $this->counter += ($this->mbstring_overload ? mb_strlen($this->value,'latin1'): strlen($this->value)); + $this->line += substr_count($this->value, "\n"); + // accept this token + return true; + } elseif ($r === true) { + // we have changed state + // process this token in the new state + return $this->yylex(); + } elseif ($r === false) { + $this->counter += ($this->mbstring_overload ? mb_strlen($this->value,'latin1'): strlen($this->value)); + $this->line += substr_count($this->value, "\n"); + if ($this->counter >= ($this->mbstring_overload ? mb_strlen($this->data,'latin1'): strlen($this->data))) { + return false; // end of input + } + // skip this token + continue; + } } else { + throw new Exception('Unexpected input at line' . $this->line . + ': ' . $this->data[$this->counter]); + } + break; + } while (true); + + } // end function + + + const CHILDBLOCK = 6; + function yy_r6_1($yy_subpatterns) + { + + if ($this->smarty->auto_literal && (strpos(" \n\t\r",substr($this->value,$this->ldel_length,1)) !== false)) { + $this->token = Smarty_Internal_Templateparser::TP_BLOCKSOURCE; + } else { + $this->yypopstate(); + return true; + } + } + function yy_r6_2($yy_subpatterns) + { + + if ($this->smarty->auto_literal && (strpos(" \n\t\r",substr($this->value,$this->ldel_length,1)) !== false)) { + $this->token = Smarty_Internal_Templateparser::TP_BLOCKSOURCE; + } else { + $this->yypopstate(); + return true; + } + } + function yy_r6_3($yy_subpatterns) + { + + if ($this->smarty->auto_literal && (strpos(" \n\t\r",substr($this->value,$this->ldel_length,1)) !== false)) { + $this->token = Smarty_Internal_Templateparser::TP_BLOCKSOURCE; + } else { + $this->yypopstate(); + return true; + } + } + function yy_r6_5($yy_subpatterns) + { + + if ($this->mbstring_overload) { + $to = mb_strlen($this->data,'latin1'); + } else { + $to = strlen($this->data); + } + preg_match("/".$this->ldel."\s*((\/)?block(\s|".$this->rdel.")|[\$]smarty\.block\.(child|parent)\s*".$this->rdel.")/",$this->data,$match,PREG_OFFSET_CAPTURE,$this->counter); + if (isset($match[0][1])) { + $to = $match[0][1]; + } + if ($this->mbstring_overload) { + $this->value = mb_substr($this->data,$this->counter,$to-$this->counter,'latin1'); + } else { + $this->value = substr($this->data,$this->counter,$to-$this->counter); + } + $this->token = Smarty_Internal_Templateparser::TP_BLOCKSOURCE; + } + } diff --git a/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_templateparser.php b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_templateparser.php new file mode 100644 index 00000000..482af6e2 --- /dev/null +++ b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_templateparser.php @@ -0,0 +1,3244 @@ +string = $s->string; + $this->metadata = $s->metadata; + } else { + $this->string = (string) $s; + if ($m instanceof TP_yyToken) { + $this->metadata = $m->metadata; + } elseif (is_array($m)) { + $this->metadata = $m; + } + } + } + + public function __toString() + { + return $this->_string; + } + + public function offsetExists($offset) + { + return isset($this->metadata[$offset]); + } + + public function offsetGet($offset) + { + return $this->metadata[$offset]; + } + + public function offsetSet($offset, $value) + { + if ($offset === null) { + if (isset($value[0])) { + $x = ($value instanceof TP_yyToken) ? + $value->metadata : $value; + $this->metadata = array_merge($this->metadata, $x); + + return; + } + $offset = count($this->metadata); + } + if ($value === null) { + return; + } + if ($value instanceof TP_yyToken) { + if ($value->metadata) { + $this->metadata[$offset] = $value->metadata; + } + } elseif ($value) { + $this->metadata[$offset] = $value; + } + } + + public function offsetUnset($offset) + { + unset($this->metadata[$offset]); + } +} + +class TP_yyStackEntry +{ + public $stateno; /* The state-number */ + public $major; /* The major token value. This is the code + ** number for the token at this stack level */ + public $minor; /* The user-supplied minor token value. This + ** is the value of the token */ +}; + + +#line 13 "smarty_internal_templateparser.y" +class Smarty_Internal_Templateparser#line 80 "smarty_internal_templateparser.php" +{ +#line 15 "smarty_internal_templateparser.y" + + const Err1 = "Security error: Call to private object member not allowed"; + const Err2 = "Security error: Call to dynamic object member not allowed"; + const Err3 = "PHP in template not allowed. Use SmartyBC to enable it"; + // states whether the parse was successful or not + public $successful = true; + public $retvalue = 0; + public static $prefix_number = 0; + private $lex; + private $internalError = false; + private $strip = false; + + function __construct($lex, $compiler) { + $this->lex = $lex; + $this->compiler = $compiler; + $this->smarty = $this->compiler->smarty; + $this->template = $this->compiler->template; + $this->compiler->has_variable_string = false; + $this->compiler->prefix_code = array(); + $this->block_nesting_level = 0; + if ($this->security = isset($this->smarty->security_policy)) { + $this->php_handling = $this->smarty->security_policy->php_handling; + } else { + $this->php_handling = $this->smarty->php_handling; + } + $this->is_xml = false; + $this->asp_tags = (ini_get('asp_tags') != '0'); + $this->current_buffer = $this->root_buffer = new _smarty_template_buffer($this); + } + + public static function escape_start_tag($tag_text) { + $tag = preg_replace('/\A<\?(.*)\z/', '<?\1', $tag_text, -1 , $count); //Escape tag + return $tag; + } + + public static function escape_end_tag($tag_text) { + return '?>'; + } + + public function compileVariable($variable) { + if (strpos($variable,'(') == 0) { + // not a variable variable + $var = trim($variable,'\''); + $this->compiler->tag_nocache=$this->compiler->tag_nocache|$this->template->getVariable($var, null, true, false)->nocache; + $this->template->properties['variables'][$var] = $this->compiler->tag_nocache|$this->compiler->nocache; + } +// return '(isset($_smarty_tpl->tpl_vars['. $variable .'])?$_smarty_tpl->tpl_vars['. $variable .']->value:$_smarty_tpl->getVariable('. $variable .')->value)'; + return '$_smarty_tpl->tpl_vars['. $variable .']->value'; + } +#line 133 "smarty_internal_templateparser.php" + + const TP_VERT = 1; + const TP_COLON = 2; + const TP_RDEL = 3; + const TP_COMMENT = 4; + const TP_PHPSTARTTAG = 5; + const TP_PHPENDTAG = 6; + const TP_ASPSTARTTAG = 7; + const TP_ASPENDTAG = 8; + const TP_FAKEPHPSTARTTAG = 9; + const TP_XMLTAG = 10; + const TP_TEXT = 11; + const TP_STRIPON = 12; + const TP_STRIPOFF = 13; + const TP_BLOCKSOURCE = 14; + const TP_LITERALSTART = 15; + const TP_LITERALEND = 16; + const TP_LITERAL = 17; + const TP_LDEL = 18; + const TP_DOLLAR = 19; + const TP_ID = 20; + const TP_EQUAL = 21; + const TP_PTR = 22; + const TP_LDELIF = 23; + const TP_LDELFOR = 24; + const TP_SEMICOLON = 25; + const TP_INCDEC = 26; + const TP_TO = 27; + const TP_STEP = 28; + const TP_LDELFOREACH = 29; + const TP_SPACE = 30; + const TP_AS = 31; + const TP_APTR = 32; + const TP_LDELSETFILTER = 33; + const TP_SMARTYBLOCKCHILDPARENT = 34; + const TP_LDELSLASH = 35; + const TP_ATTR = 36; + const TP_INTEGER = 37; + const TP_COMMA = 38; + const TP_OPENP = 39; + const TP_CLOSEP = 40; + const TP_MATH = 41; + const TP_UNIMATH = 42; + const TP_ANDSYM = 43; + const TP_ISIN = 44; + const TP_ISDIVBY = 45; + const TP_ISNOTDIVBY = 46; + const TP_ISEVEN = 47; + const TP_ISNOTEVEN = 48; + const TP_ISEVENBY = 49; + const TP_ISNOTEVENBY = 50; + const TP_ISODD = 51; + const TP_ISNOTODD = 52; + const TP_ISODDBY = 53; + const TP_ISNOTODDBY = 54; + const TP_INSTANCEOF = 55; + const TP_QMARK = 56; + const TP_NOT = 57; + const TP_TYPECAST = 58; + const TP_HEX = 59; + const TP_DOT = 60; + const TP_SINGLEQUOTESTRING = 61; + const TP_DOUBLECOLON = 62; + const TP_AT = 63; + const TP_HATCH = 64; + const TP_OPENB = 65; + const TP_CLOSEB = 66; + const TP_EQUALS = 67; + const TP_NOTEQUALS = 68; + const TP_GREATERTHAN = 69; + const TP_LESSTHAN = 70; + const TP_GREATEREQUAL = 71; + const TP_LESSEQUAL = 72; + const TP_IDENTITY = 73; + const TP_NONEIDENTITY = 74; + const TP_MOD = 75; + const TP_LAND = 76; + const TP_LOR = 77; + const TP_LXOR = 78; + const TP_QUOTE = 79; + const TP_BACKTICK = 80; + const TP_DOLLARID = 81; + const YY_NO_ACTION = 570; + const YY_ACCEPT_ACTION = 569; + const YY_ERROR_ACTION = 568; + + const YY_SZ_ACTTAB = 2407; +static public $yy_action = array( + /* 0 */ 219, 309, 305, 301, 302, 303, 304, 310, 311, 317, + /* 10 */ 318, 319, 201, 30, 273, 9, 33, 238, 280, 15, + /* 20 */ 5, 108, 235, 234, 220, 7, 126, 42, 30, 30, + /* 30 */ 259, 211, 256, 495, 15, 15, 10, 33, 495, 280, + /* 40 */ 46, 47, 51, 45, 24, 14, 352, 353, 39, 37, + /* 50 */ 278, 359, 12, 25, 219, 219, 326, 434, 219, 192, + /* 60 */ 434, 569, 95, 263, 227, 306, 360, 361, 358, 357, + /* 70 */ 354, 355, 356, 342, 341, 328, 329, 330, 292, 219, + /* 80 */ 202, 322, 242, 30, 434, 231, 207, 434, 143, 15, + /* 90 */ 434, 35, 158, 434, 46, 47, 51, 45, 24, 14, + /* 100 */ 352, 353, 39, 37, 278, 359, 12, 25, 219, 48, + /* 110 */ 32, 219, 48, 391, 196, 2, 31, 138, 321, 4, + /* 120 */ 360, 361, 358, 357, 354, 355, 356, 342, 341, 328, + /* 130 */ 329, 330, 127, 48, 290, 349, 251, 30, 145, 140, + /* 140 */ 30, 207, 264, 15, 200, 322, 15, 334, 46, 47, + /* 150 */ 51, 45, 24, 14, 352, 353, 39, 37, 278, 359, + /* 160 */ 12, 25, 219, 289, 219, 48, 431, 297, 219, 33, + /* 170 */ 396, 280, 18, 191, 360, 361, 358, 357, 354, 355, + /* 180 */ 356, 342, 341, 328, 329, 330, 300, 285, 286, 287, + /* 190 */ 299, 206, 219, 431, 428, 194, 201, 315, 314, 431, + /* 200 */ 207, 281, 46, 47, 51, 45, 24, 14, 352, 353, + /* 210 */ 39, 37, 278, 359, 12, 25, 219, 33, 48, 280, + /* 220 */ 34, 30, 48, 197, 322, 276, 158, 15, 360, 361, + /* 230 */ 358, 357, 354, 355, 356, 342, 341, 328, 329, 330, + /* 240 */ 230, 338, 16, 289, 103, 179, 244, 219, 295, 2, + /* 250 */ 41, 33, 265, 280, 283, 148, 46, 47, 51, 45, + /* 260 */ 24, 14, 352, 353, 39, 37, 278, 359, 12, 25, + /* 270 */ 219, 207, 145, 43, 132, 189, 109, 333, 307, 227, + /* 280 */ 306, 190, 360, 361, 358, 357, 354, 355, 356, 342, + /* 290 */ 341, 328, 329, 330, 20, 22, 248, 339, 219, 99, + /* 300 */ 174, 48, 324, 33, 346, 280, 18, 288, 207, 283, + /* 310 */ 46, 47, 51, 45, 24, 14, 352, 353, 39, 37, + /* 320 */ 278, 359, 12, 25, 219, 289, 207, 30, 41, 110, + /* 330 */ 275, 2, 41, 15, 272, 266, 360, 361, 358, 357, + /* 340 */ 354, 355, 356, 342, 341, 328, 329, 330, 242, 40, + /* 350 */ 236, 347, 104, 177, 145, 219, 44, 316, 148, 135, + /* 360 */ 228, 27, 283, 269, 46, 47, 51, 45, 24, 14, + /* 370 */ 352, 353, 39, 37, 278, 359, 12, 25, 219, 207, + /* 380 */ 208, 33, 7, 280, 245, 239, 136, 173, 241, 279, + /* 390 */ 360, 361, 358, 357, 354, 355, 356, 342, 341, 328, + /* 400 */ 329, 330, 29, 158, 106, 13, 122, 171, 181, 6, + /* 410 */ 33, 15, 226, 33, 219, 237, 283, 283, 46, 47, + /* 420 */ 51, 45, 24, 14, 352, 353, 39, 37, 278, 359, + /* 430 */ 12, 25, 219, 205, 205, 252, 313, 238, 312, 235, + /* 440 */ 232, 195, 97, 127, 360, 361, 358, 357, 354, 355, + /* 450 */ 356, 342, 341, 328, 329, 330, 28, 320, 230, 105, + /* 460 */ 182, 164, 176, 33, 279, 254, 282, 186, 207, 283, + /* 470 */ 283, 253, 46, 47, 51, 45, 24, 14, 352, 353, + /* 480 */ 39, 37, 278, 359, 12, 25, 219, 205, 260, 107, + /* 490 */ 235, 262, 33, 193, 214, 332, 166, 198, 360, 361, + /* 500 */ 358, 357, 354, 355, 356, 342, 341, 328, 329, 330, + /* 510 */ 137, 175, 167, 291, 308, 344, 185, 261, 267, 161, + /* 520 */ 283, 283, 128, 337, 124, 283, 46, 47, 51, 45, + /* 530 */ 24, 14, 352, 353, 39, 37, 278, 359, 12, 25, + /* 540 */ 219, 38, 205, 203, 141, 169, 257, 134, 35, 130, + /* 550 */ 156, 114, 360, 361, 358, 357, 354, 355, 356, 342, + /* 560 */ 341, 328, 329, 330, 320, 158, 320, 241, 36, 293, + /* 570 */ 298, 94, 21, 26, 284, 219, 292, 168, 271, 162, + /* 580 */ 46, 47, 51, 45, 24, 14, 352, 353, 39, 37, + /* 590 */ 278, 359, 12, 25, 219, 279, 229, 205, 44, 281, + /* 600 */ 187, 17, 270, 331, 98, 127, 360, 361, 358, 357, + /* 610 */ 354, 355, 356, 342, 341, 328, 329, 330, 199, 320, + /* 620 */ 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, + /* 630 */ 331, 331, 331, 331, 46, 47, 51, 45, 24, 14, + /* 640 */ 352, 353, 39, 37, 278, 359, 12, 25, 219, 331, + /* 650 */ 268, 331, 331, 331, 331, 331, 331, 331, 125, 115, + /* 660 */ 360, 361, 358, 357, 354, 355, 356, 342, 341, 328, + /* 670 */ 329, 330, 279, 331, 320, 331, 331, 331, 331, 331, + /* 680 */ 331, 331, 331, 331, 331, 331, 331, 331, 46, 47, + /* 690 */ 51, 45, 24, 14, 352, 353, 39, 37, 278, 359, + /* 700 */ 12, 25, 219, 331, 204, 331, 331, 331, 331, 331, + /* 710 */ 331, 159, 100, 116, 360, 361, 358, 357, 354, 355, + /* 720 */ 356, 342, 341, 328, 329, 330, 320, 320, 320, 331, + /* 730 */ 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, + /* 740 */ 331, 331, 46, 47, 51, 45, 24, 14, 352, 353, + /* 750 */ 39, 37, 278, 359, 12, 25, 219, 331, 331, 331, + /* 760 */ 331, 331, 331, 331, 331, 102, 117, 331, 360, 361, + /* 770 */ 358, 357, 354, 355, 356, 342, 341, 328, 329, 330, + /* 780 */ 320, 320, 331, 331, 331, 331, 331, 331, 331, 331, + /* 790 */ 331, 331, 331, 331, 331, 331, 46, 47, 51, 45, + /* 800 */ 24, 14, 352, 353, 39, 37, 278, 359, 12, 25, + /* 810 */ 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, + /* 820 */ 158, 331, 360, 361, 358, 357, 354, 355, 356, 342, + /* 830 */ 341, 328, 329, 330, 331, 331, 331, 331, 46, 47, + /* 840 */ 51, 45, 24, 14, 352, 353, 39, 37, 278, 359, + /* 850 */ 12, 25, 331, 331, 331, 331, 331, 331, 211, 331, + /* 860 */ 331, 331, 331, 10, 360, 361, 358, 357, 354, 355, + /* 870 */ 356, 342, 341, 328, 329, 330, 331, 331, 331, 331, + /* 880 */ 331, 331, 331, 9, 142, 212, 331, 331, 5, 108, + /* 890 */ 331, 246, 331, 331, 126, 157, 183, 331, 259, 123, + /* 900 */ 256, 331, 250, 331, 23, 283, 331, 52, 277, 331, + /* 910 */ 331, 255, 350, 348, 331, 345, 331, 279, 180, 178, + /* 920 */ 331, 331, 49, 50, 296, 240, 351, 283, 283, 106, + /* 930 */ 1, 274, 331, 147, 331, 331, 331, 331, 331, 279, + /* 940 */ 279, 9, 144, 92, 96, 233, 5, 108, 331, 345, + /* 950 */ 331, 331, 126, 331, 331, 246, 259, 323, 256, 146, + /* 960 */ 250, 331, 23, 123, 184, 52, 331, 331, 331, 331, + /* 970 */ 246, 331, 343, 283, 153, 255, 350, 348, 123, 345, + /* 980 */ 49, 50, 296, 240, 351, 279, 331, 106, 1, 331, + /* 990 */ 255, 350, 348, 331, 345, 33, 331, 280, 331, 9, + /* 1000 */ 142, 224, 96, 331, 5, 108, 331, 30, 331, 247, + /* 1010 */ 126, 246, 331, 15, 259, 149, 256, 331, 250, 123, + /* 1020 */ 23, 331, 331, 52, 331, 331, 331, 331, 331, 331, + /* 1030 */ 331, 255, 350, 348, 331, 345, 331, 331, 49, 50, + /* 1040 */ 296, 240, 351, 331, 331, 106, 1, 331, 331, 331, + /* 1050 */ 331, 331, 33, 331, 280, 331, 331, 9, 135, 224, + /* 1060 */ 96, 331, 5, 108, 30, 246, 258, 331, 126, 151, + /* 1070 */ 15, 246, 259, 123, 256, 154, 250, 331, 11, 123, + /* 1080 */ 331, 52, 331, 331, 331, 255, 350, 348, 331, 345, + /* 1090 */ 331, 255, 350, 348, 331, 345, 49, 50, 296, 240, + /* 1100 */ 351, 331, 331, 106, 1, 331, 331, 331, 331, 331, + /* 1110 */ 331, 331, 331, 331, 331, 9, 142, 210, 96, 331, + /* 1120 */ 5, 108, 331, 331, 331, 331, 126, 246, 331, 331, + /* 1130 */ 259, 155, 256, 331, 216, 123, 23, 331, 331, 52, + /* 1140 */ 331, 331, 331, 331, 331, 331, 331, 255, 350, 348, + /* 1150 */ 331, 345, 331, 331, 49, 50, 296, 240, 351, 331, + /* 1160 */ 331, 106, 1, 331, 331, 331, 331, 331, 331, 331, + /* 1170 */ 331, 331, 331, 9, 131, 224, 96, 331, 5, 108, + /* 1180 */ 331, 331, 331, 331, 126, 246, 331, 331, 259, 152, + /* 1190 */ 256, 331, 250, 123, 3, 331, 331, 52, 331, 331, + /* 1200 */ 331, 331, 331, 331, 331, 255, 350, 348, 331, 345, + /* 1210 */ 331, 331, 49, 50, 296, 240, 351, 331, 331, 106, + /* 1220 */ 1, 331, 331, 331, 331, 331, 331, 331, 331, 331, + /* 1230 */ 331, 9, 142, 213, 96, 331, 5, 108, 331, 331, + /* 1240 */ 331, 331, 126, 246, 331, 331, 259, 150, 256, 331, + /* 1250 */ 250, 123, 23, 331, 331, 52, 331, 331, 331, 331, + /* 1260 */ 331, 331, 331, 255, 350, 348, 331, 345, 331, 331, + /* 1270 */ 49, 50, 296, 240, 351, 331, 331, 106, 1, 331, + /* 1280 */ 219, 331, 401, 331, 331, 331, 331, 331, 331, 9, + /* 1290 */ 142, 209, 96, 331, 5, 108, 331, 331, 331, 331, + /* 1300 */ 126, 249, 331, 331, 259, 331, 256, 331, 250, 30, + /* 1310 */ 23, 190, 163, 52, 331, 15, 331, 331, 2, 331, + /* 1320 */ 331, 283, 331, 331, 20, 22, 331, 331, 49, 50, + /* 1330 */ 296, 240, 351, 331, 331, 106, 1, 331, 207, 331, + /* 1340 */ 331, 145, 331, 331, 331, 432, 331, 9, 139, 224, + /* 1350 */ 96, 331, 5, 108, 331, 331, 331, 331, 126, 331, + /* 1360 */ 331, 331, 259, 243, 256, 331, 250, 331, 23, 190, + /* 1370 */ 188, 52, 432, 331, 331, 331, 331, 331, 432, 283, + /* 1380 */ 331, 2, 20, 22, 331, 331, 49, 50, 296, 240, + /* 1390 */ 351, 331, 331, 106, 1, 331, 207, 331, 331, 331, + /* 1400 */ 331, 331, 331, 331, 145, 9, 135, 224, 96, 331, + /* 1410 */ 5, 108, 331, 331, 331, 331, 126, 331, 331, 331, + /* 1420 */ 259, 331, 256, 331, 250, 331, 11, 101, 160, 52, + /* 1430 */ 331, 331, 331, 331, 331, 331, 331, 283, 331, 331, + /* 1440 */ 20, 22, 331, 331, 49, 50, 296, 240, 351, 331, + /* 1450 */ 331, 106, 331, 331, 207, 331, 331, 331, 331, 331, + /* 1460 */ 331, 331, 331, 9, 135, 225, 96, 331, 5, 108, + /* 1470 */ 331, 331, 331, 331, 126, 331, 331, 331, 259, 331, + /* 1480 */ 256, 331, 250, 331, 11, 331, 477, 52, 331, 331, + /* 1490 */ 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, + /* 1500 */ 331, 331, 49, 50, 296, 240, 351, 331, 477, 106, + /* 1510 */ 477, 477, 331, 477, 477, 331, 331, 331, 331, 477, + /* 1520 */ 331, 477, 2, 477, 96, 331, 331, 331, 331, 331, + /* 1530 */ 331, 331, 331, 331, 331, 246, 331, 331, 477, 120, + /* 1540 */ 331, 331, 84, 123, 331, 145, 331, 331, 331, 477, + /* 1550 */ 331, 294, 327, 331, 331, 255, 350, 348, 331, 345, + /* 1560 */ 331, 331, 331, 477, 331, 331, 331, 246, 331, 218, + /* 1570 */ 362, 120, 331, 331, 84, 123, 331, 331, 331, 331, + /* 1580 */ 331, 331, 331, 294, 327, 331, 331, 255, 350, 348, + /* 1590 */ 246, 345, 331, 331, 129, 331, 331, 61, 119, 232, + /* 1600 */ 331, 246, 335, 331, 331, 129, 294, 327, 80, 123, + /* 1610 */ 255, 350, 348, 331, 345, 331, 331, 294, 327, 331, + /* 1620 */ 331, 255, 350, 348, 331, 345, 246, 331, 331, 331, + /* 1630 */ 129, 331, 215, 80, 123, 331, 331, 331, 331, 331, + /* 1640 */ 331, 331, 294, 327, 331, 331, 255, 350, 348, 331, + /* 1650 */ 345, 331, 331, 331, 246, 190, 170, 221, 129, 331, + /* 1660 */ 331, 55, 119, 133, 331, 283, 331, 331, 20, 22, + /* 1670 */ 294, 327, 331, 331, 255, 350, 348, 246, 345, 331, + /* 1680 */ 331, 129, 207, 331, 80, 123, 331, 331, 331, 331, + /* 1690 */ 331, 331, 331, 294, 327, 331, 246, 255, 350, 348, + /* 1700 */ 129, 345, 331, 89, 123, 331, 331, 331, 223, 331, + /* 1710 */ 331, 331, 294, 327, 331, 331, 255, 350, 348, 246, + /* 1720 */ 345, 331, 331, 129, 331, 331, 70, 123, 331, 331, + /* 1730 */ 246, 331, 331, 331, 111, 294, 327, 67, 123, 255, + /* 1740 */ 350, 348, 331, 345, 331, 331, 294, 327, 331, 246, + /* 1750 */ 255, 350, 348, 129, 345, 331, 86, 123, 331, 331, + /* 1760 */ 331, 331, 331, 331, 331, 294, 327, 331, 246, 255, + /* 1770 */ 350, 348, 129, 345, 331, 90, 123, 331, 331, 331, + /* 1780 */ 331, 331, 331, 331, 294, 327, 331, 246, 255, 350, + /* 1790 */ 348, 129, 345, 331, 77, 123, 331, 331, 331, 331, + /* 1800 */ 331, 331, 331, 294, 327, 331, 246, 255, 350, 348, + /* 1810 */ 129, 345, 331, 74, 123, 331, 331, 246, 331, 331, + /* 1820 */ 331, 129, 294, 327, 66, 123, 255, 350, 348, 331, + /* 1830 */ 345, 331, 331, 294, 327, 331, 246, 222, 350, 348, + /* 1840 */ 129, 345, 331, 69, 123, 331, 331, 331, 331, 331, + /* 1850 */ 331, 331, 294, 327, 331, 246, 255, 350, 348, 129, + /* 1860 */ 345, 331, 78, 123, 331, 331, 331, 331, 331, 331, + /* 1870 */ 331, 294, 327, 331, 246, 255, 350, 348, 129, 345, + /* 1880 */ 331, 60, 123, 331, 331, 331, 331, 331, 331, 331, + /* 1890 */ 294, 327, 331, 246, 255, 350, 348, 129, 345, 331, + /* 1900 */ 53, 123, 331, 331, 246, 331, 331, 331, 129, 294, + /* 1910 */ 327, 65, 123, 255, 350, 348, 331, 345, 331, 331, + /* 1920 */ 294, 327, 336, 331, 255, 350, 348, 331, 345, 8, + /* 1930 */ 331, 331, 331, 331, 5, 108, 331, 331, 331, 331, + /* 1940 */ 126, 331, 331, 246, 259, 331, 256, 129, 331, 331, + /* 1950 */ 72, 123, 331, 331, 331, 331, 331, 331, 331, 294, + /* 1960 */ 327, 331, 246, 255, 350, 348, 129, 345, 331, 85, + /* 1970 */ 123, 331, 331, 331, 331, 331, 331, 331, 294, 327, + /* 1980 */ 331, 246, 255, 350, 348, 129, 345, 331, 81, 123, + /* 1990 */ 331, 19, 340, 331, 331, 331, 331, 294, 327, 331, + /* 2000 */ 246, 255, 350, 348, 113, 345, 331, 82, 123, 331, + /* 2010 */ 331, 246, 331, 331, 331, 93, 294, 327, 54, 121, + /* 2020 */ 255, 350, 348, 331, 345, 331, 331, 294, 327, 331, + /* 2030 */ 246, 217, 350, 348, 129, 345, 331, 58, 123, 331, + /* 2040 */ 331, 331, 331, 331, 331, 331, 294, 327, 331, 336, + /* 2050 */ 255, 350, 348, 331, 345, 331, 8, 331, 331, 331, + /* 2060 */ 331, 5, 108, 331, 331, 331, 331, 126, 246, 331, + /* 2070 */ 331, 259, 129, 256, 331, 88, 123, 331, 331, 246, + /* 2080 */ 331, 331, 331, 129, 294, 327, 56, 123, 255, 350, + /* 2090 */ 348, 331, 345, 331, 331, 294, 327, 331, 331, 255, + /* 2100 */ 350, 348, 331, 345, 246, 331, 331, 331, 129, 331, + /* 2110 */ 331, 68, 123, 331, 331, 331, 331, 325, 19, 340, + /* 2120 */ 294, 327, 331, 331, 255, 350, 348, 331, 345, 331, + /* 2130 */ 331, 331, 331, 246, 331, 331, 331, 118, 331, 331, + /* 2140 */ 59, 123, 331, 331, 331, 331, 190, 172, 331, 294, + /* 2150 */ 327, 331, 331, 255, 350, 348, 283, 345, 246, 20, + /* 2160 */ 22, 331, 93, 331, 331, 57, 121, 331, 331, 331, + /* 2170 */ 331, 331, 331, 207, 294, 327, 331, 246, 255, 350, + /* 2180 */ 348, 129, 345, 331, 64, 123, 331, 331, 246, 331, + /* 2190 */ 331, 331, 129, 294, 327, 63, 123, 255, 350, 348, + /* 2200 */ 331, 345, 331, 331, 294, 327, 331, 246, 255, 350, + /* 2210 */ 348, 129, 345, 331, 73, 123, 331, 331, 331, 331, + /* 2220 */ 190, 165, 331, 294, 327, 331, 331, 255, 350, 348, + /* 2230 */ 283, 345, 331, 20, 22, 331, 246, 331, 331, 331, + /* 2240 */ 129, 331, 331, 87, 123, 331, 331, 207, 331, 331, + /* 2250 */ 331, 331, 294, 327, 331, 331, 255, 350, 348, 331, + /* 2260 */ 345, 246, 331, 331, 331, 129, 331, 331, 75, 123, + /* 2270 */ 331, 331, 246, 331, 331, 331, 129, 294, 327, 61, + /* 2280 */ 123, 255, 350, 348, 331, 345, 331, 331, 294, 327, + /* 2290 */ 331, 246, 255, 350, 348, 129, 345, 331, 71, 123, + /* 2300 */ 331, 331, 246, 331, 331, 331, 129, 294, 327, 83, + /* 2310 */ 123, 255, 350, 348, 331, 345, 331, 331, 294, 327, + /* 2320 */ 331, 331, 255, 350, 348, 331, 345, 246, 331, 331, + /* 2330 */ 331, 112, 331, 331, 76, 123, 331, 331, 331, 331, + /* 2340 */ 331, 331, 331, 294, 327, 331, 331, 255, 350, 348, + /* 2350 */ 331, 345, 246, 331, 331, 331, 129, 331, 331, 91, + /* 2360 */ 123, 331, 331, 246, 331, 331, 331, 129, 294, 327, + /* 2370 */ 62, 123, 255, 350, 348, 331, 345, 331, 331, 294, + /* 2380 */ 327, 331, 246, 255, 350, 348, 129, 345, 331, 79, + /* 2390 */ 123, 331, 331, 331, 331, 331, 331, 331, 294, 327, + /* 2400 */ 331, 331, 255, 350, 348, 331, 345, + ); + static public $yy_lookahead = array( + /* 0 */ 1, 4, 5, 6, 7, 8, 9, 10, 11, 12, + /* 10 */ 13, 14, 15, 30, 66, 18, 18, 2, 20, 36, + /* 20 */ 23, 24, 94, 95, 96, 39, 29, 28, 30, 30, + /* 30 */ 33, 60, 35, 60, 36, 36, 65, 18, 65, 20, + /* 40 */ 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, + /* 50 */ 51, 52, 53, 54, 1, 1, 3, 3, 1, 91, + /* 60 */ 3, 83, 84, 85, 86, 87, 67, 68, 69, 70, + /* 70 */ 71, 72, 73, 74, 75, 76, 77, 78, 112, 1, + /* 80 */ 114, 115, 63, 30, 30, 31, 118, 30, 19, 36, + /* 90 */ 36, 21, 22, 36, 41, 42, 43, 44, 45, 46, + /* 100 */ 47, 48, 49, 50, 51, 52, 53, 54, 1, 55, + /* 110 */ 32, 1, 55, 3, 91, 39, 18, 19, 20, 38, + /* 120 */ 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + /* 130 */ 77, 78, 62, 55, 20, 37, 60, 30, 62, 20, + /* 140 */ 30, 118, 66, 36, 114, 115, 36, 66, 41, 42, + /* 150 */ 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + /* 160 */ 53, 54, 1, 26, 1, 55, 3, 37, 1, 18, + /* 170 */ 3, 20, 21, 91, 67, 68, 69, 70, 71, 72, + /* 180 */ 73, 74, 75, 76, 77, 78, 5, 6, 7, 8, + /* 190 */ 9, 20, 1, 30, 3, 100, 15, 16, 17, 36, + /* 200 */ 118, 119, 41, 42, 43, 44, 45, 46, 47, 48, + /* 210 */ 49, 50, 51, 52, 53, 54, 1, 18, 55, 20, + /* 220 */ 21, 30, 55, 114, 115, 26, 22, 36, 67, 68, + /* 230 */ 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, + /* 240 */ 86, 80, 32, 26, 91, 92, 31, 1, 109, 39, + /* 250 */ 38, 18, 40, 20, 101, 116, 41, 42, 43, 44, + /* 260 */ 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + /* 270 */ 1, 118, 62, 18, 19, 20, 122, 123, 85, 86, + /* 280 */ 87, 91, 67, 68, 69, 70, 71, 72, 73, 74, + /* 290 */ 75, 76, 77, 78, 104, 105, 63, 80, 1, 91, + /* 300 */ 92, 55, 3, 18, 115, 20, 21, 20, 118, 101, + /* 310 */ 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, + /* 320 */ 51, 52, 53, 54, 1, 26, 118, 30, 38, 88, + /* 330 */ 40, 39, 38, 36, 40, 66, 67, 68, 69, 70, + /* 340 */ 71, 72, 73, 74, 75, 76, 77, 78, 63, 21, + /* 350 */ 63, 109, 91, 92, 62, 1, 2, 16, 116, 19, + /* 360 */ 20, 18, 101, 40, 41, 42, 43, 44, 45, 46, + /* 370 */ 47, 48, 49, 50, 51, 52, 53, 54, 1, 118, + /* 380 */ 3, 18, 39, 20, 19, 20, 19, 111, 60, 113, + /* 390 */ 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + /* 400 */ 77, 78, 21, 22, 64, 30, 39, 92, 92, 39, + /* 410 */ 18, 36, 20, 18, 1, 20, 101, 101, 41, 42, + /* 420 */ 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + /* 430 */ 53, 54, 1, 118, 118, 22, 87, 2, 89, 94, + /* 440 */ 95, 91, 98, 62, 67, 68, 69, 70, 71, 72, + /* 450 */ 73, 74, 75, 76, 77, 78, 21, 113, 86, 111, + /* 460 */ 92, 92, 111, 18, 113, 20, 20, 111, 118, 101, + /* 470 */ 101, 40, 41, 42, 43, 44, 45, 46, 47, 48, + /* 480 */ 49, 50, 51, 52, 53, 54, 1, 118, 3, 100, + /* 490 */ 94, 95, 18, 100, 20, 123, 111, 25, 67, 68, + /* 500 */ 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, + /* 510 */ 38, 92, 92, 20, 3, 3, 92, 20, 40, 64, + /* 520 */ 101, 101, 19, 3, 19, 101, 41, 42, 43, 44, + /* 530 */ 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + /* 540 */ 1, 2, 118, 20, 19, 64, 20, 19, 21, 98, + /* 550 */ 20, 98, 67, 68, 69, 70, 71, 72, 73, 74, + /* 560 */ 75, 76, 77, 78, 113, 22, 113, 60, 27, 20, + /* 570 */ 37, 20, 56, 2, 101, 1, 112, 111, 116, 111, + /* 580 */ 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, + /* 590 */ 51, 52, 53, 54, 1, 113, 97, 118, 2, 119, + /* 600 */ 111, 97, 30, 124, 98, 62, 67, 68, 69, 70, + /* 610 */ 71, 72, 73, 74, 75, 76, 77, 78, 25, 113, + /* 620 */ 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, + /* 630 */ 124, 124, 124, 124, 41, 42, 43, 44, 45, 46, + /* 640 */ 47, 48, 49, 50, 51, 52, 53, 54, 1, 124, + /* 650 */ 3, 124, 124, 124, 124, 124, 124, 124, 99, 98, + /* 660 */ 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + /* 670 */ 77, 78, 113, 124, 113, 124, 124, 124, 124, 124, + /* 680 */ 124, 124, 124, 124, 124, 124, 124, 124, 41, 42, + /* 690 */ 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + /* 700 */ 53, 54, 1, 124, 3, 124, 124, 124, 124, 124, + /* 710 */ 124, 98, 98, 98, 67, 68, 69, 70, 71, 72, + /* 720 */ 73, 74, 75, 76, 77, 78, 113, 113, 113, 124, + /* 730 */ 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, + /* 740 */ 124, 124, 41, 42, 43, 44, 45, 46, 47, 48, + /* 750 */ 49, 50, 51, 52, 53, 54, 1, 124, 124, 124, + /* 760 */ 124, 124, 124, 124, 124, 98, 98, 124, 67, 68, + /* 770 */ 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, + /* 780 */ 113, 113, 124, 124, 124, 124, 124, 124, 124, 124, + /* 790 */ 124, 124, 124, 124, 124, 124, 41, 42, 43, 44, + /* 800 */ 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + /* 810 */ 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, + /* 820 */ 22, 124, 67, 68, 69, 70, 71, 72, 73, 74, + /* 830 */ 75, 76, 77, 78, 124, 124, 124, 124, 41, 42, + /* 840 */ 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + /* 850 */ 53, 54, 124, 124, 124, 124, 124, 124, 60, 124, + /* 860 */ 124, 124, 124, 65, 67, 68, 69, 70, 71, 72, + /* 870 */ 73, 74, 75, 76, 77, 78, 124, 124, 124, 124, + /* 880 */ 124, 124, 124, 18, 19, 20, 124, 124, 23, 24, + /* 890 */ 124, 86, 124, 124, 29, 90, 92, 124, 33, 94, + /* 900 */ 35, 124, 37, 124, 39, 101, 124, 42, 103, 124, + /* 910 */ 124, 106, 107, 108, 124, 110, 124, 113, 92, 92, + /* 920 */ 124, 124, 57, 58, 59, 60, 61, 101, 101, 64, + /* 930 */ 65, 66, 124, 94, 124, 124, 124, 124, 124, 113, + /* 940 */ 113, 18, 19, 20, 79, 106, 23, 24, 124, 110, + /* 950 */ 124, 124, 29, 124, 124, 86, 33, 34, 35, 90, + /* 960 */ 37, 124, 39, 94, 92, 42, 124, 124, 124, 124, + /* 970 */ 86, 124, 103, 101, 90, 106, 107, 108, 94, 110, + /* 980 */ 57, 58, 59, 60, 61, 113, 124, 64, 65, 124, + /* 990 */ 106, 107, 108, 124, 110, 18, 124, 20, 124, 18, + /* 1000 */ 19, 20, 79, 124, 23, 24, 124, 30, 124, 32, + /* 1010 */ 29, 86, 124, 36, 33, 90, 35, 124, 37, 94, + /* 1020 */ 39, 124, 124, 42, 124, 124, 124, 124, 124, 124, + /* 1030 */ 124, 106, 107, 108, 124, 110, 124, 124, 57, 58, + /* 1040 */ 59, 60, 61, 124, 124, 64, 65, 124, 124, 124, + /* 1050 */ 124, 124, 18, 124, 20, 124, 124, 18, 19, 20, + /* 1060 */ 79, 124, 23, 24, 30, 86, 32, 124, 29, 90, + /* 1070 */ 36, 86, 33, 94, 35, 90, 37, 124, 39, 94, + /* 1080 */ 124, 42, 124, 124, 124, 106, 107, 108, 124, 110, + /* 1090 */ 124, 106, 107, 108, 124, 110, 57, 58, 59, 60, + /* 1100 */ 61, 124, 124, 64, 65, 124, 124, 124, 124, 124, + /* 1110 */ 124, 124, 124, 124, 124, 18, 19, 20, 79, 124, + /* 1120 */ 23, 24, 124, 124, 124, 124, 29, 86, 124, 124, + /* 1130 */ 33, 90, 35, 124, 37, 94, 39, 124, 124, 42, + /* 1140 */ 124, 124, 124, 124, 124, 124, 124, 106, 107, 108, + /* 1150 */ 124, 110, 124, 124, 57, 58, 59, 60, 61, 124, + /* 1160 */ 124, 64, 65, 124, 124, 124, 124, 124, 124, 124, + /* 1170 */ 124, 124, 124, 18, 19, 20, 79, 124, 23, 24, + /* 1180 */ 124, 124, 124, 124, 29, 86, 124, 124, 33, 90, + /* 1190 */ 35, 124, 37, 94, 39, 124, 124, 42, 124, 124, + /* 1200 */ 124, 124, 124, 124, 124, 106, 107, 108, 124, 110, + /* 1210 */ 124, 124, 57, 58, 59, 60, 61, 124, 124, 64, + /* 1220 */ 65, 124, 124, 124, 124, 124, 124, 124, 124, 124, + /* 1230 */ 124, 18, 19, 20, 79, 124, 23, 24, 124, 124, + /* 1240 */ 124, 124, 29, 86, 124, 124, 33, 90, 35, 124, + /* 1250 */ 37, 94, 39, 124, 124, 42, 124, 124, 124, 124, + /* 1260 */ 124, 124, 124, 106, 107, 108, 124, 110, 124, 124, + /* 1270 */ 57, 58, 59, 60, 61, 124, 124, 64, 65, 124, + /* 1280 */ 1, 124, 3, 124, 124, 124, 124, 124, 124, 18, + /* 1290 */ 19, 20, 79, 124, 23, 24, 124, 124, 124, 124, + /* 1300 */ 29, 22, 124, 124, 33, 124, 35, 124, 37, 30, + /* 1310 */ 39, 91, 92, 42, 124, 36, 124, 124, 39, 124, + /* 1320 */ 124, 101, 124, 124, 104, 105, 124, 124, 57, 58, + /* 1330 */ 59, 60, 61, 124, 124, 64, 65, 124, 118, 124, + /* 1340 */ 124, 62, 124, 124, 124, 3, 124, 18, 19, 20, + /* 1350 */ 79, 124, 23, 24, 124, 124, 124, 124, 29, 124, + /* 1360 */ 124, 124, 33, 21, 35, 124, 37, 124, 39, 91, + /* 1370 */ 92, 42, 30, 124, 124, 124, 124, 124, 36, 101, + /* 1380 */ 124, 39, 104, 105, 124, 124, 57, 58, 59, 60, + /* 1390 */ 61, 124, 124, 64, 65, 124, 118, 124, 124, 124, + /* 1400 */ 124, 124, 124, 124, 62, 18, 19, 20, 79, 124, + /* 1410 */ 23, 24, 124, 124, 124, 124, 29, 124, 124, 124, + /* 1420 */ 33, 124, 35, 124, 37, 124, 39, 91, 92, 42, + /* 1430 */ 124, 124, 124, 124, 124, 124, 124, 101, 124, 124, + /* 1440 */ 104, 105, 124, 124, 57, 58, 59, 60, 61, 124, + /* 1450 */ 124, 64, 124, 124, 118, 124, 124, 124, 124, 124, + /* 1460 */ 124, 124, 124, 18, 19, 20, 79, 124, 23, 24, + /* 1470 */ 124, 124, 124, 124, 29, 124, 124, 124, 33, 124, + /* 1480 */ 35, 124, 37, 124, 39, 124, 3, 42, 124, 124, + /* 1490 */ 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, + /* 1500 */ 124, 124, 57, 58, 59, 60, 61, 124, 25, 64, + /* 1510 */ 27, 28, 124, 30, 31, 124, 124, 124, 124, 36, + /* 1520 */ 124, 38, 39, 40, 79, 124, 124, 124, 124, 124, + /* 1530 */ 124, 124, 124, 124, 124, 86, 124, 124, 55, 90, + /* 1540 */ 124, 124, 93, 94, 124, 62, 124, 124, 124, 66, + /* 1550 */ 124, 102, 103, 124, 124, 106, 107, 108, 124, 110, + /* 1560 */ 124, 124, 124, 80, 124, 124, 124, 86, 124, 120, + /* 1570 */ 121, 90, 124, 124, 93, 94, 124, 124, 124, 124, + /* 1580 */ 124, 124, 124, 102, 103, 124, 124, 106, 107, 108, + /* 1590 */ 86, 110, 124, 124, 90, 124, 124, 93, 94, 95, + /* 1600 */ 124, 86, 121, 124, 124, 90, 102, 103, 93, 94, + /* 1610 */ 106, 107, 108, 124, 110, 124, 124, 102, 103, 124, + /* 1620 */ 124, 106, 107, 108, 124, 110, 86, 124, 124, 124, + /* 1630 */ 90, 124, 117, 93, 94, 124, 124, 124, 124, 124, + /* 1640 */ 124, 124, 102, 103, 124, 124, 106, 107, 108, 124, + /* 1650 */ 110, 124, 124, 124, 86, 91, 92, 117, 90, 124, + /* 1660 */ 124, 93, 94, 95, 124, 101, 124, 124, 104, 105, + /* 1670 */ 102, 103, 124, 124, 106, 107, 108, 86, 110, 124, + /* 1680 */ 124, 90, 118, 124, 93, 94, 124, 124, 124, 124, + /* 1690 */ 124, 124, 124, 102, 103, 124, 86, 106, 107, 108, + /* 1700 */ 90, 110, 124, 93, 94, 124, 124, 124, 117, 124, + /* 1710 */ 124, 124, 102, 103, 124, 124, 106, 107, 108, 86, + /* 1720 */ 110, 124, 124, 90, 124, 124, 93, 94, 124, 124, + /* 1730 */ 86, 124, 124, 124, 90, 102, 103, 93, 94, 106, + /* 1740 */ 107, 108, 124, 110, 124, 124, 102, 103, 124, 86, + /* 1750 */ 106, 107, 108, 90, 110, 124, 93, 94, 124, 124, + /* 1760 */ 124, 124, 124, 124, 124, 102, 103, 124, 86, 106, + /* 1770 */ 107, 108, 90, 110, 124, 93, 94, 124, 124, 124, + /* 1780 */ 124, 124, 124, 124, 102, 103, 124, 86, 106, 107, + /* 1790 */ 108, 90, 110, 124, 93, 94, 124, 124, 124, 124, + /* 1800 */ 124, 124, 124, 102, 103, 124, 86, 106, 107, 108, + /* 1810 */ 90, 110, 124, 93, 94, 124, 124, 86, 124, 124, + /* 1820 */ 124, 90, 102, 103, 93, 94, 106, 107, 108, 124, + /* 1830 */ 110, 124, 124, 102, 103, 124, 86, 106, 107, 108, + /* 1840 */ 90, 110, 124, 93, 94, 124, 124, 124, 124, 124, + /* 1850 */ 124, 124, 102, 103, 124, 86, 106, 107, 108, 90, + /* 1860 */ 110, 124, 93, 94, 124, 124, 124, 124, 124, 124, + /* 1870 */ 124, 102, 103, 124, 86, 106, 107, 108, 90, 110, + /* 1880 */ 124, 93, 94, 124, 124, 124, 124, 124, 124, 124, + /* 1890 */ 102, 103, 124, 86, 106, 107, 108, 90, 110, 124, + /* 1900 */ 93, 94, 124, 124, 86, 124, 124, 124, 90, 102, + /* 1910 */ 103, 93, 94, 106, 107, 108, 124, 110, 124, 124, + /* 1920 */ 102, 103, 11, 124, 106, 107, 108, 124, 110, 18, + /* 1930 */ 124, 124, 124, 124, 23, 24, 124, 124, 124, 124, + /* 1940 */ 29, 124, 124, 86, 33, 124, 35, 90, 124, 124, + /* 1950 */ 93, 94, 124, 124, 124, 124, 124, 124, 124, 102, + /* 1960 */ 103, 124, 86, 106, 107, 108, 90, 110, 124, 93, + /* 1970 */ 94, 124, 124, 124, 124, 124, 124, 124, 102, 103, + /* 1980 */ 124, 86, 106, 107, 108, 90, 110, 124, 93, 94, + /* 1990 */ 79, 80, 81, 124, 124, 124, 124, 102, 103, 124, + /* 2000 */ 86, 106, 107, 108, 90, 110, 124, 93, 94, 124, + /* 2010 */ 124, 86, 124, 124, 124, 90, 102, 103, 93, 94, + /* 2020 */ 106, 107, 108, 124, 110, 124, 124, 102, 103, 124, + /* 2030 */ 86, 106, 107, 108, 90, 110, 124, 93, 94, 124, + /* 2040 */ 124, 124, 124, 124, 124, 124, 102, 103, 124, 11, + /* 2050 */ 106, 107, 108, 124, 110, 124, 18, 124, 124, 124, + /* 2060 */ 124, 23, 24, 124, 124, 124, 124, 29, 86, 124, + /* 2070 */ 124, 33, 90, 35, 124, 93, 94, 124, 124, 86, + /* 2080 */ 124, 124, 124, 90, 102, 103, 93, 94, 106, 107, + /* 2090 */ 108, 124, 110, 124, 124, 102, 103, 124, 124, 106, + /* 2100 */ 107, 108, 124, 110, 86, 124, 124, 124, 90, 124, + /* 2110 */ 124, 93, 94, 124, 124, 124, 124, 79, 80, 81, + /* 2120 */ 102, 103, 124, 124, 106, 107, 108, 124, 110, 124, + /* 2130 */ 124, 124, 124, 86, 124, 124, 124, 90, 124, 124, + /* 2140 */ 93, 94, 124, 124, 124, 124, 91, 92, 124, 102, + /* 2150 */ 103, 124, 124, 106, 107, 108, 101, 110, 86, 104, + /* 2160 */ 105, 124, 90, 124, 124, 93, 94, 124, 124, 124, + /* 2170 */ 124, 124, 124, 118, 102, 103, 124, 86, 106, 107, + /* 2180 */ 108, 90, 110, 124, 93, 94, 124, 124, 86, 124, + /* 2190 */ 124, 124, 90, 102, 103, 93, 94, 106, 107, 108, + /* 2200 */ 124, 110, 124, 124, 102, 103, 124, 86, 106, 107, + /* 2210 */ 108, 90, 110, 124, 93, 94, 124, 124, 124, 124, + /* 2220 */ 91, 92, 124, 102, 103, 124, 124, 106, 107, 108, + /* 2230 */ 101, 110, 124, 104, 105, 124, 86, 124, 124, 124, + /* 2240 */ 90, 124, 124, 93, 94, 124, 124, 118, 124, 124, + /* 2250 */ 124, 124, 102, 103, 124, 124, 106, 107, 108, 124, + /* 2260 */ 110, 86, 124, 124, 124, 90, 124, 124, 93, 94, + /* 2270 */ 124, 124, 86, 124, 124, 124, 90, 102, 103, 93, + /* 2280 */ 94, 106, 107, 108, 124, 110, 124, 124, 102, 103, + /* 2290 */ 124, 86, 106, 107, 108, 90, 110, 124, 93, 94, + /* 2300 */ 124, 124, 86, 124, 124, 124, 90, 102, 103, 93, + /* 2310 */ 94, 106, 107, 108, 124, 110, 124, 124, 102, 103, + /* 2320 */ 124, 124, 106, 107, 108, 124, 110, 86, 124, 124, + /* 2330 */ 124, 90, 124, 124, 93, 94, 124, 124, 124, 124, + /* 2340 */ 124, 124, 124, 102, 103, 124, 124, 106, 107, 108, + /* 2350 */ 124, 110, 86, 124, 124, 124, 90, 124, 124, 93, + /* 2360 */ 94, 124, 124, 86, 124, 124, 124, 90, 102, 103, + /* 2370 */ 93, 94, 106, 107, 108, 124, 110, 124, 124, 102, + /* 2380 */ 103, 124, 86, 106, 107, 108, 90, 110, 124, 93, + /* 2390 */ 94, 124, 124, 124, 124, 124, 124, 124, 102, 103, + /* 2400 */ 124, 124, 106, 107, 108, 124, 110, +); + const YY_SHIFT_USE_DFLT = -53; + const YY_SHIFT_MAX = 259; + static public $yy_shift_ofst = array( + /* 0 */ -3, 1213, 981, 1155, 1213, 1155, 981, 981, 923, 923, + /* 10 */ 865, 981, 981, 1097, 981, 981, 981, 981, 981, 981, + /* 20 */ 981, 1329, 981, 981, 981, 981, 1271, 981, 981, 981, + /* 30 */ 1097, 981, 981, 981, 981, 981, 981, 981, 981, 981, + /* 40 */ 981, 981, 981, 981, 1039, 1039, 1387, 1387, 1445, 1387, + /* 50 */ 1387, 1387, 1387, -1, 53, 107, 107, 107, 107, 107, + /* 60 */ 485, 431, 593, 647, 701, 323, 161, 215, 377, 269, + /* 70 */ 539, 755, 755, 755, 755, 755, 755, 755, 755, 755, + /* 80 */ 755, 755, 755, 755, 755, 755, 755, 755, 755, 755, + /* 90 */ 797, 797, 1279, 110, 297, -3, 2038, 977, 1034, 191, + /* 100 */ -2, 191, -2, 297, 297, 798, 340, 354, 367, 1911, + /* 110 */ 181, 54, 57, 163, 199, 285, 19, 151, 167, 70, + /* 120 */ 78, 381, 367, 543, 363, -17, 375, 365, 363, 246, + /* 130 */ 363, 395, 392, -17, 363, 363, 363, 367, 363, 445, + /* 140 */ 413, 363, 395, 363, 474, 365, 574, 204, 204, 574, + /* 150 */ 574, 574, 574, 574, 574, 574, 574, -53, 255, 233, + /* 160 */ -17, -27, -29, -17, -17, -17, -29, -17, -29, -27, + /* 170 */ -17, -17, -17, -29, -17, -17, -29, -17, -17, -17, + /* 180 */ -17, -17, -17, -17, -17, -17, -29, -29, -17, 343, + /* 190 */ 574, 574, 574, 596, 596, 574, 574, 204, 572, 572, + /* 200 */ 204, 341, 204, 370, -53, -53, -53, -53, -53, 1483, + /* 210 */ 1342, 98, 76, 210, 435, 212, 328, 299, 81, 287, + /* 220 */ 472, 294, 217, 290, 292, 292, 370, 511, 455, 505, + /* 230 */ 520, 528, 478, 481, 541, 527, 446, 15, 114, -14, + /* 240 */ 533, 130, 493, 497, 503, 523, 512, 525, 549, 551, + /* 250 */ 507, 526, 530, 516, 571, 137, 119, -52, 69, 171, +); + const YY_REDUCE_USE_DFLT = -73; + const YY_REDUCE_MAX = 208; + static public $yy_reduce_ofst = array( + /* 0 */ -22, 1449, 1540, 1504, 1481, 1568, 1515, 1591, 1925, 2072, + /* 10 */ 1750, 1818, 1895, 1644, 1663, 1914, 2205, 2277, 1876, 1731, + /* 20 */ 1857, 1633, 1701, 2186, 2150, 2296, 2266, 2091, 2047, 1993, + /* 30 */ 2241, 2102, 1720, 1788, 1982, 1769, 1807, 1610, 1682, 2175, + /* 40 */ 2216, 2121, 1944, 2018, 805, 869, 884, 979, 925, 985, + /* 50 */ 1041, 1157, 1099, 1220, 1336, 2129, 1278, 1336, 1564, 2055, + /* 60 */ 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, + /* 70 */ 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, + /* 80 */ 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, + /* 90 */ 190, 190, 261, 208, 153, 193, 154, 827, 826, 369, + /* 100 */ 804, 315, 872, 316, 424, -34, 839, 82, -72, 372, + /* 110 */ 349, -32, -32, -32, 559, 351, 351, 351, -32, 30, + /* 120 */ -32, 30, 345, 30, 453, 420, 368, 242, 344, -32, + /* 130 */ 276, 561, 451, 419, 506, 615, 668, 396, 613, 615, + /* 140 */ 350, 614, 615, 667, 615, 139, -32, 30, 109, -32, + /* 150 */ -32, -32, -32, -32, -32, -32, 23, -32, 462, 482, + /* 160 */ 473, 466, 464, 473, 473, 473, 464, 473, 464, 468, + /* 170 */ 473, 473, 473, 464, 473, 473, 464, 473, 473, 473, + /* 180 */ 473, 473, 473, 473, 473, 473, 464, 464, 473, 489, + /* 190 */ 479, 479, 479, 480, 480, 479, 479, 189, 504, 499, + /* 200 */ 189, 241, 189, 348, 356, 393, 389, 95, 385, +); + static public $yyExpectedTokens = array( + /* 0 */ array(4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 18, 23, 24, 29, 33, 35, ), + /* 1 */ array(18, 19, 20, 23, 24, 29, 33, 35, 37, 39, 42, 57, 58, 59, 60, 61, 64, 65, 79, ), + /* 2 */ array(18, 19, 20, 23, 24, 29, 33, 35, 37, 39, 42, 57, 58, 59, 60, 61, 64, 65, 79, ), + /* 3 */ array(18, 19, 20, 23, 24, 29, 33, 35, 37, 39, 42, 57, 58, 59, 60, 61, 64, 65, 79, ), + /* 4 */ array(18, 19, 20, 23, 24, 29, 33, 35, 37, 39, 42, 57, 58, 59, 60, 61, 64, 65, 79, ), + /* 5 */ array(18, 19, 20, 23, 24, 29, 33, 35, 37, 39, 42, 57, 58, 59, 60, 61, 64, 65, 79, ), + /* 6 */ array(18, 19, 20, 23, 24, 29, 33, 35, 37, 39, 42, 57, 58, 59, 60, 61, 64, 65, 79, ), + /* 7 */ array(18, 19, 20, 23, 24, 29, 33, 35, 37, 39, 42, 57, 58, 59, 60, 61, 64, 65, 79, ), + /* 8 */ array(18, 19, 20, 23, 24, 29, 33, 34, 35, 37, 39, 42, 57, 58, 59, 60, 61, 64, 65, 79, ), + /* 9 */ array(18, 19, 20, 23, 24, 29, 33, 34, 35, 37, 39, 42, 57, 58, 59, 60, 61, 64, 65, 79, ), + /* 10 */ array(18, 19, 20, 23, 24, 29, 33, 35, 37, 39, 42, 57, 58, 59, 60, 61, 64, 65, 66, 79, ), + /* 11 */ array(18, 19, 20, 23, 24, 29, 33, 35, 37, 39, 42, 57, 58, 59, 60, 61, 64, 65, 79, ), + /* 12 */ array(18, 19, 20, 23, 24, 29, 33, 35, 37, 39, 42, 57, 58, 59, 60, 61, 64, 65, 79, ), + /* 13 */ array(18, 19, 20, 23, 24, 29, 33, 35, 37, 39, 42, 57, 58, 59, 60, 61, 64, 65, 79, ), + /* 14 */ array(18, 19, 20, 23, 24, 29, 33, 35, 37, 39, 42, 57, 58, 59, 60, 61, 64, 65, 79, ), + /* 15 */ array(18, 19, 20, 23, 24, 29, 33, 35, 37, 39, 42, 57, 58, 59, 60, 61, 64, 65, 79, ), + /* 16 */ array(18, 19, 20, 23, 24, 29, 33, 35, 37, 39, 42, 57, 58, 59, 60, 61, 64, 65, 79, ), + /* 17 */ array(18, 19, 20, 23, 24, 29, 33, 35, 37, 39, 42, 57, 58, 59, 60, 61, 64, 65, 79, ), + /* 18 */ array(18, 19, 20, 23, 24, 29, 33, 35, 37, 39, 42, 57, 58, 59, 60, 61, 64, 65, 79, ), + /* 19 */ array(18, 19, 20, 23, 24, 29, 33, 35, 37, 39, 42, 57, 58, 59, 60, 61, 64, 65, 79, ), + /* 20 */ array(18, 19, 20, 23, 24, 29, 33, 35, 37, 39, 42, 57, 58, 59, 60, 61, 64, 65, 79, ), + /* 21 */ array(18, 19, 20, 23, 24, 29, 33, 35, 37, 39, 42, 57, 58, 59, 60, 61, 64, 65, 79, ), + /* 22 */ array(18, 19, 20, 23, 24, 29, 33, 35, 37, 39, 42, 57, 58, 59, 60, 61, 64, 65, 79, ), + /* 23 */ array(18, 19, 20, 23, 24, 29, 33, 35, 37, 39, 42, 57, 58, 59, 60, 61, 64, 65, 79, ), + /* 24 */ array(18, 19, 20, 23, 24, 29, 33, 35, 37, 39, 42, 57, 58, 59, 60, 61, 64, 65, 79, ), + /* 25 */ array(18, 19, 20, 23, 24, 29, 33, 35, 37, 39, 42, 57, 58, 59, 60, 61, 64, 65, 79, ), + /* 26 */ array(18, 19, 20, 23, 24, 29, 33, 35, 37, 39, 42, 57, 58, 59, 60, 61, 64, 65, 79, ), + /* 27 */ array(18, 19, 20, 23, 24, 29, 33, 35, 37, 39, 42, 57, 58, 59, 60, 61, 64, 65, 79, ), + /* 28 */ array(18, 19, 20, 23, 24, 29, 33, 35, 37, 39, 42, 57, 58, 59, 60, 61, 64, 65, 79, ), + /* 29 */ array(18, 19, 20, 23, 24, 29, 33, 35, 37, 39, 42, 57, 58, 59, 60, 61, 64, 65, 79, ), + /* 30 */ array(18, 19, 20, 23, 24, 29, 33, 35, 37, 39, 42, 57, 58, 59, 60, 61, 64, 65, 79, ), + /* 31 */ array(18, 19, 20, 23, 24, 29, 33, 35, 37, 39, 42, 57, 58, 59, 60, 61, 64, 65, 79, ), + /* 32 */ array(18, 19, 20, 23, 24, 29, 33, 35, 37, 39, 42, 57, 58, 59, 60, 61, 64, 65, 79, ), + /* 33 */ array(18, 19, 20, 23, 24, 29, 33, 35, 37, 39, 42, 57, 58, 59, 60, 61, 64, 65, 79, ), + /* 34 */ array(18, 19, 20, 23, 24, 29, 33, 35, 37, 39, 42, 57, 58, 59, 60, 61, 64, 65, 79, ), + /* 35 */ array(18, 19, 20, 23, 24, 29, 33, 35, 37, 39, 42, 57, 58, 59, 60, 61, 64, 65, 79, ), + /* 36 */ array(18, 19, 20, 23, 24, 29, 33, 35, 37, 39, 42, 57, 58, 59, 60, 61, 64, 65, 79, ), + /* 37 */ array(18, 19, 20, 23, 24, 29, 33, 35, 37, 39, 42, 57, 58, 59, 60, 61, 64, 65, 79, ), + /* 38 */ array(18, 19, 20, 23, 24, 29, 33, 35, 37, 39, 42, 57, 58, 59, 60, 61, 64, 65, 79, ), + /* 39 */ array(18, 19, 20, 23, 24, 29, 33, 35, 37, 39, 42, 57, 58, 59, 60, 61, 64, 65, 79, ), + /* 40 */ array(18, 19, 20, 23, 24, 29, 33, 35, 37, 39, 42, 57, 58, 59, 60, 61, 64, 65, 79, ), + /* 41 */ array(18, 19, 20, 23, 24, 29, 33, 35, 37, 39, 42, 57, 58, 59, 60, 61, 64, 65, 79, ), + /* 42 */ array(18, 19, 20, 23, 24, 29, 33, 35, 37, 39, 42, 57, 58, 59, 60, 61, 64, 65, 79, ), + /* 43 */ array(18, 19, 20, 23, 24, 29, 33, 35, 37, 39, 42, 57, 58, 59, 60, 61, 64, 65, 79, ), + /* 44 */ array(18, 19, 20, 23, 24, 29, 33, 35, 37, 39, 42, 57, 58, 59, 60, 61, 64, 65, 79, ), + /* 45 */ array(18, 19, 20, 23, 24, 29, 33, 35, 37, 39, 42, 57, 58, 59, 60, 61, 64, 65, 79, ), + /* 46 */ array(18, 19, 20, 23, 24, 29, 33, 35, 37, 39, 42, 57, 58, 59, 60, 61, 64, 79, ), + /* 47 */ array(18, 19, 20, 23, 24, 29, 33, 35, 37, 39, 42, 57, 58, 59, 60, 61, 64, 79, ), + /* 48 */ array(18, 19, 20, 23, 24, 29, 33, 35, 37, 39, 42, 57, 58, 59, 60, 61, 64, 79, ), + /* 49 */ array(18, 19, 20, 23, 24, 29, 33, 35, 37, 39, 42, 57, 58, 59, 60, 61, 64, 79, ), + /* 50 */ array(18, 19, 20, 23, 24, 29, 33, 35, 37, 39, 42, 57, 58, 59, 60, 61, 64, 79, ), + /* 51 */ array(18, 19, 20, 23, 24, 29, 33, 35, 37, 39, 42, 57, 58, 59, 60, 61, 64, 79, ), + /* 52 */ array(18, 19, 20, 23, 24, 29, 33, 35, 37, 39, 42, 57, 58, 59, 60, 61, 64, 79, ), + /* 53 */ array(1, 28, 30, 36, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, ), + /* 54 */ array(1, 3, 30, 36, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, ), + /* 55 */ array(1, 30, 36, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, ), + /* 56 */ array(1, 30, 36, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, ), + /* 57 */ array(1, 30, 36, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, ), + /* 58 */ array(1, 30, 36, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, ), + /* 59 */ array(1, 30, 36, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, ), + /* 60 */ array(1, 3, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, ), + /* 61 */ array(1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, ), + /* 62 */ array(1, 25, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, ), + /* 63 */ array(1, 3, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, ), + /* 64 */ array(1, 3, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, ), + /* 65 */ array(1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, ), + /* 66 */ array(1, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 80, ), + /* 67 */ array(1, 31, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, ), + /* 68 */ array(1, 3, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, ), + /* 69 */ array(1, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, ), + /* 70 */ array(1, 2, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, ), + /* 71 */ array(1, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, ), + /* 72 */ array(1, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, ), + /* 73 */ array(1, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, ), + /* 74 */ array(1, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, ), + /* 75 */ array(1, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, ), + /* 76 */ array(1, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, ), + /* 77 */ array(1, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, ), + /* 78 */ array(1, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, ), + /* 79 */ array(1, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, ), + /* 80 */ array(1, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, ), + /* 81 */ array(1, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, ), + /* 82 */ array(1, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, ), + /* 83 */ array(1, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, ), + /* 84 */ array(1, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, ), + /* 85 */ array(1, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, ), + /* 86 */ array(1, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, ), + /* 87 */ array(1, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, ), + /* 88 */ array(1, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, ), + /* 89 */ array(1, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, ), + /* 90 */ array(41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, ), + /* 91 */ array(41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, ), + /* 92 */ array(1, 3, 22, 30, 36, 39, 62, ), + /* 93 */ array(1, 3, 30, 36, 55, ), + /* 94 */ array(1, 30, 36, ), + /* 95 */ array(4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 18, 23, 24, 29, 33, 35, ), + /* 96 */ array(11, 18, 23, 24, 29, 33, 35, 79, 80, 81, ), + /* 97 */ array(18, 20, 30, 32, 36, ), + /* 98 */ array(18, 20, 30, 32, 36, ), + /* 99 */ array(1, 3, 30, 36, ), + /* 100 */ array(18, 20, 30, 36, ), + /* 101 */ array(1, 3, 30, 36, ), + /* 102 */ array(18, 20, 30, 36, ), + /* 103 */ array(1, 30, 36, ), + /* 104 */ array(1, 30, 36, ), + /* 105 */ array(22, 60, 65, ), + /* 106 */ array(19, 20, 64, ), + /* 107 */ array(1, 2, ), + /* 108 */ array(19, 39, ), + /* 109 */ array(11, 18, 23, 24, 29, 33, 35, 79, 80, 81, ), + /* 110 */ array(5, 6, 7, 8, 9, 15, 16, 17, ), + /* 111 */ array(1, 3, 30, 31, 36, 55, ), + /* 112 */ array(1, 3, 30, 36, 55, ), + /* 113 */ array(1, 3, 30, 36, 55, ), + /* 114 */ array(18, 20, 21, 26, ), + /* 115 */ array(18, 20, 21, 63, ), + /* 116 */ array(18, 20, 63, ), + /* 117 */ array(18, 20, 21, ), + /* 118 */ array(1, 3, 55, ), + /* 119 */ array(21, 22, 62, ), + /* 120 */ array(1, 32, 55, ), + /* 121 */ array(21, 22, 62, ), + /* 122 */ array(19, 39, ), + /* 123 */ array(22, 62, ), + /* 124 */ array(18, 20, ), + /* 125 */ array(30, 36, ), + /* 126 */ array(30, 36, ), + /* 127 */ array(19, 20, ), + /* 128 */ array(18, 20, ), + /* 129 */ array(1, 55, ), + /* 130 */ array(18, 20, ), + /* 131 */ array(18, 20, ), + /* 132 */ array(18, 20, ), + /* 133 */ array(30, 36, ), + /* 134 */ array(18, 20, ), + /* 135 */ array(18, 20, ), + /* 136 */ array(18, 20, ), + /* 137 */ array(19, 39, ), + /* 138 */ array(18, 20, ), + /* 139 */ array(18, 20, ), + /* 140 */ array(1, 22, ), + /* 141 */ array(18, 20, ), + /* 142 */ array(18, 20, ), + /* 143 */ array(18, 20, ), + /* 144 */ array(18, 20, ), + /* 145 */ array(19, 20, ), + /* 146 */ array(1, ), + /* 147 */ array(22, ), + /* 148 */ array(22, ), + /* 149 */ array(1, ), + /* 150 */ array(1, ), + /* 151 */ array(1, ), + /* 152 */ array(1, ), + /* 153 */ array(1, ), + /* 154 */ array(1, ), + /* 155 */ array(1, ), + /* 156 */ array(1, ), + /* 157 */ array(), + /* 158 */ array(18, 19, 20, ), + /* 159 */ array(18, 20, 63, ), + /* 160 */ array(30, 36, ), + /* 161 */ array(60, 65, ), + /* 162 */ array(60, 65, ), + /* 163 */ array(30, 36, ), + /* 164 */ array(30, 36, ), + /* 165 */ array(30, 36, ), + /* 166 */ array(60, 65, ), + /* 167 */ array(30, 36, ), + /* 168 */ array(60, 65, ), + /* 169 */ array(60, 65, ), + /* 170 */ array(30, 36, ), + /* 171 */ array(30, 36, ), + /* 172 */ array(30, 36, ), + /* 173 */ array(60, 65, ), + /* 174 */ array(30, 36, ), + /* 175 */ array(30, 36, ), + /* 176 */ array(60, 65, ), + /* 177 */ array(30, 36, ), + /* 178 */ array(30, 36, ), + /* 179 */ array(30, 36, ), + /* 180 */ array(30, 36, ), + /* 181 */ array(30, 36, ), + /* 182 */ array(30, 36, ), + /* 183 */ array(30, 36, ), + /* 184 */ array(30, 36, ), + /* 185 */ array(30, 36, ), + /* 186 */ array(60, 65, ), + /* 187 */ array(60, 65, ), + /* 188 */ array(30, 36, ), + /* 189 */ array(18, 39, ), + /* 190 */ array(1, ), + /* 191 */ array(1, ), + /* 192 */ array(1, ), + /* 193 */ array(2, ), + /* 194 */ array(2, ), + /* 195 */ array(1, ), + /* 196 */ array(1, ), + /* 197 */ array(22, ), + /* 198 */ array(30, ), + /* 199 */ array(30, ), + /* 200 */ array(22, ), + /* 201 */ array(16, ), + /* 202 */ array(22, ), + /* 203 */ array(39, ), + /* 204 */ array(), + /* 205 */ array(), + /* 206 */ array(), + /* 207 */ array(), + /* 208 */ array(), + /* 209 */ array(3, 25, 27, 28, 30, 31, 36, 38, 39, 40, 55, 62, 66, 80, ), + /* 210 */ array(3, 21, 30, 36, 39, 62, ), + /* 211 */ array(18, 19, 20, 37, ), + /* 212 */ array(39, 60, 62, 66, ), + /* 213 */ array(32, 39, 62, ), + /* 214 */ array(2, 21, ), + /* 215 */ array(38, 40, ), + /* 216 */ array(21, 60, ), + /* 217 */ array(3, 26, ), + /* 218 */ array(38, 66, ), + /* 219 */ array(20, 63, ), + /* 220 */ array(25, 38, ), + /* 221 */ array(38, 40, ), + /* 222 */ array(26, 80, ), + /* 223 */ array(38, 40, ), + /* 224 */ array(39, 62, ), + /* 225 */ array(39, 62, ), + /* 226 */ array(39, ), + /* 227 */ array(3, ), + /* 228 */ array(64, ), + /* 229 */ array(19, ), + /* 230 */ array(3, ), + /* 231 */ array(19, ), + /* 232 */ array(40, ), + /* 233 */ array(64, ), + /* 234 */ array(27, ), + /* 235 */ array(21, ), + /* 236 */ array(20, ), + /* 237 */ array(2, ), + /* 238 */ array(20, ), + /* 239 */ array(39, ), + /* 240 */ array(37, ), + /* 241 */ array(37, ), + /* 242 */ array(20, ), + /* 243 */ array(20, ), + /* 244 */ array(19, ), + /* 245 */ array(20, ), + /* 246 */ array(3, ), + /* 247 */ array(19, ), + /* 248 */ array(20, ), + /* 249 */ array(20, ), + /* 250 */ array(60, ), + /* 251 */ array(20, ), + /* 252 */ array(20, ), + /* 253 */ array(56, ), + /* 254 */ array(2, ), + /* 255 */ array(26, ), + /* 256 */ array(20, ), + /* 257 */ array(66, ), + /* 258 */ array(19, ), + /* 259 */ array(20, ), + /* 260 */ array(), + /* 261 */ array(), + /* 262 */ array(), + /* 263 */ array(), + /* 264 */ array(), + /* 265 */ array(), + /* 266 */ array(), + /* 267 */ array(), + /* 268 */ array(), + /* 269 */ array(), + /* 270 */ array(), + /* 271 */ array(), + /* 272 */ array(), + /* 273 */ array(), + /* 274 */ array(), + /* 275 */ array(), + /* 276 */ array(), + /* 277 */ array(), + /* 278 */ array(), + /* 279 */ array(), + /* 280 */ array(), + /* 281 */ array(), + /* 282 */ array(), + /* 283 */ array(), + /* 284 */ array(), + /* 285 */ array(), + /* 286 */ array(), + /* 287 */ array(), + /* 288 */ array(), + /* 289 */ array(), + /* 290 */ array(), + /* 291 */ array(), + /* 292 */ array(), + /* 293 */ array(), + /* 294 */ array(), + /* 295 */ array(), + /* 296 */ array(), + /* 297 */ array(), + /* 298 */ array(), + /* 299 */ array(), + /* 300 */ array(), + /* 301 */ array(), + /* 302 */ array(), + /* 303 */ array(), + /* 304 */ array(), + /* 305 */ array(), + /* 306 */ array(), + /* 307 */ array(), + /* 308 */ array(), + /* 309 */ array(), + /* 310 */ array(), + /* 311 */ array(), + /* 312 */ array(), + /* 313 */ array(), + /* 314 */ array(), + /* 315 */ array(), + /* 316 */ array(), + /* 317 */ array(), + /* 318 */ array(), + /* 319 */ array(), + /* 320 */ array(), + /* 321 */ array(), + /* 322 */ array(), + /* 323 */ array(), + /* 324 */ array(), + /* 325 */ array(), + /* 326 */ array(), + /* 327 */ array(), + /* 328 */ array(), + /* 329 */ array(), + /* 330 */ array(), + /* 331 */ array(), + /* 332 */ array(), + /* 333 */ array(), + /* 334 */ array(), + /* 335 */ array(), + /* 336 */ array(), + /* 337 */ array(), + /* 338 */ array(), + /* 339 */ array(), + /* 340 */ array(), + /* 341 */ array(), + /* 342 */ array(), + /* 343 */ array(), + /* 344 */ array(), + /* 345 */ array(), + /* 346 */ array(), + /* 347 */ array(), + /* 348 */ array(), + /* 349 */ array(), + /* 350 */ array(), + /* 351 */ array(), + /* 352 */ array(), + /* 353 */ array(), + /* 354 */ array(), + /* 355 */ array(), + /* 356 */ array(), + /* 357 */ array(), + /* 358 */ array(), + /* 359 */ array(), + /* 360 */ array(), + /* 361 */ array(), + /* 362 */ array(), +); + static public $yy_default = array( + /* 0 */ 366, 551, 522, 568, 568, 568, 522, 522, 568, 568, + /* 10 */ 568, 568, 568, 568, 568, 568, 568, 568, 568, 568, + /* 20 */ 568, 568, 568, 568, 568, 568, 568, 568, 568, 568, + /* 30 */ 568, 568, 568, 568, 568, 568, 568, 568, 568, 568, + /* 40 */ 568, 568, 568, 568, 568, 568, 568, 568, 568, 568, + /* 50 */ 568, 568, 568, 428, 568, 405, 428, 428, 428, 397, + /* 60 */ 568, 568, 568, 568, 568, 568, 568, 433, 568, 568, + /* 70 */ 568, 553, 449, 520, 552, 457, 433, 452, 439, 462, + /* 80 */ 521, 461, 430, 435, 554, 438, 454, 453, 410, 458, + /* 90 */ 466, 465, 477, 441, 428, 363, 568, 428, 428, 485, + /* 100 */ 428, 448, 428, 428, 428, 534, 568, 419, 568, 568, + /* 110 */ 568, 441, 441, 441, 568, 495, 495, 495, 441, 486, + /* 120 */ 441, 486, 568, 486, 568, 428, 428, 568, 568, 441, + /* 130 */ 495, 568, 568, 407, 568, 568, 568, 568, 568, 568, + /* 140 */ 422, 568, 568, 568, 568, 568, 451, 486, 531, 464, + /* 150 */ 446, 445, 468, 444, 469, 470, 424, 529, 568, 496, + /* 160 */ 395, 489, 492, 412, 392, 406, 514, 409, 490, 491, + /* 170 */ 413, 394, 398, 513, 393, 408, 493, 400, 417, 402, + /* 180 */ 415, 404, 414, 418, 416, 403, 515, 512, 399, 495, + /* 190 */ 448, 420, 485, 523, 524, 423, 425, 532, 567, 567, + /* 200 */ 509, 383, 535, 495, 495, 528, 528, 528, 495, 443, + /* 210 */ 477, 568, 477, 477, 507, 568, 473, 467, 568, 568, + /* 220 */ 568, 568, 467, 568, 477, 463, 507, 568, 568, 568, + /* 230 */ 568, 568, 568, 568, 436, 568, 568, 507, 568, 533, + /* 240 */ 568, 475, 568, 568, 568, 568, 568, 568, 568, 568, + /* 250 */ 473, 568, 568, 479, 507, 467, 568, 568, 568, 568, + /* 260 */ 508, 429, 437, 364, 501, 519, 503, 440, 500, 479, + /* 270 */ 566, 516, 517, 502, 504, 518, 411, 530, 459, 506, + /* 280 */ 507, 527, 525, 427, 426, 388, 389, 390, 526, 471, + /* 290 */ 443, 487, 494, 497, 442, 482, 472, 474, 476, 387, + /* 300 */ 386, 371, 372, 373, 374, 370, 369, 365, 367, 368, + /* 310 */ 375, 376, 382, 384, 385, 381, 380, 377, 378, 379, + /* 320 */ 505, 498, 510, 421, 562, 555, 563, 447, 545, 546, + /* 330 */ 547, 556, 557, 558, 548, 550, 565, 564, 560, 559, + /* 340 */ 561, 544, 543, 450, 484, 488, 511, 483, 481, 499, + /* 350 */ 478, 480, 455, 456, 540, 541, 542, 539, 538, 460, + /* 360 */ 536, 537, 549, +); + const YYNOCODE = 125; + const YYSTACKDEPTH = 500; + const YYNSTATE = 363; + const YYNRULE = 205; + const YYERRORSYMBOL = 82; + const YYERRSYMDT = 'yy0'; + const YYFALLBACK = 0; + public static $yyFallback = array( + ); + public static function Trace($TraceFILE, $zTracePrompt) + { + if (!$TraceFILE) { + $zTracePrompt = 0; + } elseif (!$zTracePrompt) { + $TraceFILE = 0; + } + self::$yyTraceFILE = $TraceFILE; + self::$yyTracePrompt = $zTracePrompt; + } + + public static function PrintTrace() + { + self::$yyTraceFILE = fopen('php://output', 'w'); + self::$yyTracePrompt = ''; + } + + public static $yyTraceFILE; + public static $yyTracePrompt; + public $yyidx; /* Index of top element in stack */ + public $yyerrcnt; /* Shifts left before out of the error */ + public $yystack = array(); /* The parser's stack */ + + public $yyTokenName = array( + '$', 'VERT', 'COLON', 'RDEL', + 'COMMENT', 'PHPSTARTTAG', 'PHPENDTAG', 'ASPSTARTTAG', + 'ASPENDTAG', 'FAKEPHPSTARTTAG', 'XMLTAG', 'TEXT', + 'STRIPON', 'STRIPOFF', 'BLOCKSOURCE', 'LITERALSTART', + 'LITERALEND', 'LITERAL', 'LDEL', 'DOLLAR', + 'ID', 'EQUAL', 'PTR', 'LDELIF', + 'LDELFOR', 'SEMICOLON', 'INCDEC', 'TO', + 'STEP', 'LDELFOREACH', 'SPACE', 'AS', + 'APTR', 'LDELSETFILTER', 'SMARTYBLOCKCHILDPARENT', 'LDELSLASH', + 'ATTR', 'INTEGER', 'COMMA', 'OPENP', + 'CLOSEP', 'MATH', 'UNIMATH', 'ANDSYM', + 'ISIN', 'ISDIVBY', 'ISNOTDIVBY', 'ISEVEN', + 'ISNOTEVEN', 'ISEVENBY', 'ISNOTEVENBY', 'ISODD', + 'ISNOTODD', 'ISODDBY', 'ISNOTODDBY', 'INSTANCEOF', + 'QMARK', 'NOT', 'TYPECAST', 'HEX', + 'DOT', 'SINGLEQUOTESTRING', 'DOUBLECOLON', 'AT', + 'HATCH', 'OPENB', 'CLOSEB', 'EQUALS', + 'NOTEQUALS', 'GREATERTHAN', 'LESSTHAN', 'GREATEREQUAL', + 'LESSEQUAL', 'IDENTITY', 'NONEIDENTITY', 'MOD', + 'LAND', 'LOR', 'LXOR', 'QUOTE', + 'BACKTICK', 'DOLLARID', 'error', 'start', + 'template', 'template_element', 'smartytag', 'literal', + 'literal_elements', 'literal_element', 'value', 'modifierlist', + 'attributes', 'expr', 'varindexed', 'statement', + 'statements', 'optspace', 'varvar', 'foraction', + 'modparameters', 'attribute', 'ternary', 'array', + 'ifcond', 'lop', 'variable', 'function', + 'doublequoted_with_quotes', 'static_class_access', 'object', 'arrayindex', + 'indexdef', 'varvarele', 'objectchain', 'objectelement', + 'method', 'params', 'modifier', 'modparameter', + 'arrayelements', 'arrayelement', 'doublequoted', 'doublequotedcontent', + ); + + public static $yyRuleName = array( + /* 0 */ "start ::= template", + /* 1 */ "template ::= template_element", + /* 2 */ "template ::= template template_element", + /* 3 */ "template ::=", + /* 4 */ "template_element ::= smartytag RDEL", + /* 5 */ "template_element ::= COMMENT", + /* 6 */ "template_element ::= literal", + /* 7 */ "template_element ::= PHPSTARTTAG", + /* 8 */ "template_element ::= PHPENDTAG", + /* 9 */ "template_element ::= ASPSTARTTAG", + /* 10 */ "template_element ::= ASPENDTAG", + /* 11 */ "template_element ::= FAKEPHPSTARTTAG", + /* 12 */ "template_element ::= XMLTAG", + /* 13 */ "template_element ::= TEXT", + /* 14 */ "template_element ::= STRIPON", + /* 15 */ "template_element ::= STRIPOFF", + /* 16 */ "template_element ::= BLOCKSOURCE", + /* 17 */ "literal ::= LITERALSTART LITERALEND", + /* 18 */ "literal ::= LITERALSTART literal_elements LITERALEND", + /* 19 */ "literal_elements ::= literal_elements literal_element", + /* 20 */ "literal_elements ::=", + /* 21 */ "literal_element ::= literal", + /* 22 */ "literal_element ::= LITERAL", + /* 23 */ "literal_element ::= PHPSTARTTAG", + /* 24 */ "literal_element ::= FAKEPHPSTARTTAG", + /* 25 */ "literal_element ::= PHPENDTAG", + /* 26 */ "literal_element ::= ASPSTARTTAG", + /* 27 */ "literal_element ::= ASPENDTAG", + /* 28 */ "smartytag ::= LDEL value", + /* 29 */ "smartytag ::= LDEL value modifierlist attributes", + /* 30 */ "smartytag ::= LDEL value attributes", + /* 31 */ "smartytag ::= LDEL expr modifierlist attributes", + /* 32 */ "smartytag ::= LDEL expr attributes", + /* 33 */ "smartytag ::= LDEL DOLLAR ID EQUAL value", + /* 34 */ "smartytag ::= LDEL DOLLAR ID EQUAL expr", + /* 35 */ "smartytag ::= LDEL DOLLAR ID EQUAL expr attributes", + /* 36 */ "smartytag ::= LDEL varindexed EQUAL expr attributes", + /* 37 */ "smartytag ::= LDEL ID attributes", + /* 38 */ "smartytag ::= LDEL ID", + /* 39 */ "smartytag ::= LDEL ID PTR ID attributes", + /* 40 */ "smartytag ::= LDEL ID modifierlist attributes", + /* 41 */ "smartytag ::= LDEL ID PTR ID modifierlist attributes", + /* 42 */ "smartytag ::= LDELIF expr", + /* 43 */ "smartytag ::= LDELIF expr attributes", + /* 44 */ "smartytag ::= LDELIF statement", + /* 45 */ "smartytag ::= LDELIF statement attributes", + /* 46 */ "smartytag ::= LDELFOR statements SEMICOLON optspace expr SEMICOLON optspace DOLLAR varvar foraction attributes", + /* 47 */ "foraction ::= EQUAL expr", + /* 48 */ "foraction ::= INCDEC", + /* 49 */ "smartytag ::= LDELFOR statement TO expr attributes", + /* 50 */ "smartytag ::= LDELFOR statement TO expr STEP expr attributes", + /* 51 */ "smartytag ::= LDELFOREACH attributes", + /* 52 */ "smartytag ::= LDELFOREACH SPACE value AS DOLLAR varvar attributes", + /* 53 */ "smartytag ::= LDELFOREACH SPACE value AS DOLLAR varvar APTR DOLLAR varvar attributes", + /* 54 */ "smartytag ::= LDELFOREACH SPACE expr AS DOLLAR varvar attributes", + /* 55 */ "smartytag ::= LDELFOREACH SPACE expr AS DOLLAR varvar APTR DOLLAR varvar attributes", + /* 56 */ "smartytag ::= LDELSETFILTER ID modparameters", + /* 57 */ "smartytag ::= LDELSETFILTER ID modparameters modifierlist", + /* 58 */ "smartytag ::= LDEL SMARTYBLOCKCHILDPARENT", + /* 59 */ "smartytag ::= LDELSLASH ID", + /* 60 */ "smartytag ::= LDELSLASH ID modifierlist", + /* 61 */ "smartytag ::= LDELSLASH ID PTR ID", + /* 62 */ "smartytag ::= LDELSLASH ID PTR ID modifierlist", + /* 63 */ "attributes ::= attributes attribute", + /* 64 */ "attributes ::= attribute", + /* 65 */ "attributes ::=", + /* 66 */ "attribute ::= SPACE ID EQUAL ID", + /* 67 */ "attribute ::= ATTR expr", + /* 68 */ "attribute ::= ATTR value", + /* 69 */ "attribute ::= SPACE ID", + /* 70 */ "attribute ::= SPACE expr", + /* 71 */ "attribute ::= SPACE value", + /* 72 */ "attribute ::= SPACE INTEGER EQUAL expr", + /* 73 */ "statements ::= statement", + /* 74 */ "statements ::= statements COMMA statement", + /* 75 */ "statement ::= DOLLAR varvar EQUAL expr", + /* 76 */ "statement ::= varindexed EQUAL expr", + /* 77 */ "statement ::= OPENP statement CLOSEP", + /* 78 */ "expr ::= value", + /* 79 */ "expr ::= ternary", + /* 80 */ "expr ::= DOLLAR ID COLON ID", + /* 81 */ "expr ::= expr MATH value", + /* 82 */ "expr ::= expr UNIMATH value", + /* 83 */ "expr ::= expr ANDSYM value", + /* 84 */ "expr ::= array", + /* 85 */ "expr ::= expr modifierlist", + /* 86 */ "expr ::= expr ifcond expr", + /* 87 */ "expr ::= expr ISIN array", + /* 88 */ "expr ::= expr ISIN value", + /* 89 */ "expr ::= expr lop expr", + /* 90 */ "expr ::= expr ISDIVBY expr", + /* 91 */ "expr ::= expr ISNOTDIVBY expr", + /* 92 */ "expr ::= expr ISEVEN", + /* 93 */ "expr ::= expr ISNOTEVEN", + /* 94 */ "expr ::= expr ISEVENBY expr", + /* 95 */ "expr ::= expr ISNOTEVENBY expr", + /* 96 */ "expr ::= expr ISODD", + /* 97 */ "expr ::= expr ISNOTODD", + /* 98 */ "expr ::= expr ISODDBY expr", + /* 99 */ "expr ::= expr ISNOTODDBY expr", + /* 100 */ "expr ::= value INSTANCEOF ID", + /* 101 */ "expr ::= value INSTANCEOF value", + /* 102 */ "ternary ::= OPENP expr CLOSEP QMARK DOLLAR ID COLON expr", + /* 103 */ "ternary ::= OPENP expr CLOSEP QMARK expr COLON expr", + /* 104 */ "value ::= variable", + /* 105 */ "value ::= UNIMATH value", + /* 106 */ "value ::= NOT value", + /* 107 */ "value ::= TYPECAST value", + /* 108 */ "value ::= variable INCDEC", + /* 109 */ "value ::= HEX", + /* 110 */ "value ::= INTEGER", + /* 111 */ "value ::= INTEGER DOT INTEGER", + /* 112 */ "value ::= INTEGER DOT", + /* 113 */ "value ::= DOT INTEGER", + /* 114 */ "value ::= ID", + /* 115 */ "value ::= function", + /* 116 */ "value ::= OPENP expr CLOSEP", + /* 117 */ "value ::= SINGLEQUOTESTRING", + /* 118 */ "value ::= doublequoted_with_quotes", + /* 119 */ "value ::= ID DOUBLECOLON static_class_access", + /* 120 */ "value ::= varindexed DOUBLECOLON static_class_access", + /* 121 */ "value ::= smartytag RDEL", + /* 122 */ "value ::= value modifierlist", + /* 123 */ "variable ::= varindexed", + /* 124 */ "variable ::= DOLLAR varvar AT ID", + /* 125 */ "variable ::= object", + /* 126 */ "variable ::= HATCH ID HATCH", + /* 127 */ "variable ::= HATCH ID HATCH arrayindex", + /* 128 */ "variable ::= HATCH variable HATCH", + /* 129 */ "variable ::= HATCH variable HATCH arrayindex", + /* 130 */ "varindexed ::= DOLLAR varvar arrayindex", + /* 131 */ "arrayindex ::= arrayindex indexdef", + /* 132 */ "arrayindex ::=", + /* 133 */ "indexdef ::= DOT DOLLAR varvar", + /* 134 */ "indexdef ::= DOT DOLLAR varvar AT ID", + /* 135 */ "indexdef ::= DOT ID", + /* 136 */ "indexdef ::= DOT INTEGER", + /* 137 */ "indexdef ::= DOT LDEL expr RDEL", + /* 138 */ "indexdef ::= OPENB ID CLOSEB", + /* 139 */ "indexdef ::= OPENB ID DOT ID CLOSEB", + /* 140 */ "indexdef ::= OPENB expr CLOSEB", + /* 141 */ "indexdef ::= OPENB CLOSEB", + /* 142 */ "varvar ::= varvarele", + /* 143 */ "varvar ::= varvar varvarele", + /* 144 */ "varvarele ::= ID", + /* 145 */ "varvarele ::= LDEL expr RDEL", + /* 146 */ "object ::= varindexed objectchain", + /* 147 */ "objectchain ::= objectelement", + /* 148 */ "objectchain ::= objectchain objectelement", + /* 149 */ "objectelement ::= PTR ID arrayindex", + /* 150 */ "objectelement ::= PTR DOLLAR varvar arrayindex", + /* 151 */ "objectelement ::= PTR LDEL expr RDEL arrayindex", + /* 152 */ "objectelement ::= PTR ID LDEL expr RDEL arrayindex", + /* 153 */ "objectelement ::= PTR method", + /* 154 */ "function ::= ID OPENP params CLOSEP", + /* 155 */ "method ::= ID OPENP params CLOSEP", + /* 156 */ "method ::= DOLLAR ID OPENP params CLOSEP", + /* 157 */ "params ::= params COMMA expr", + /* 158 */ "params ::= expr", + /* 159 */ "params ::=", + /* 160 */ "modifierlist ::= modifierlist modifier modparameters", + /* 161 */ "modifierlist ::= modifier modparameters", + /* 162 */ "modifier ::= VERT AT ID", + /* 163 */ "modifier ::= VERT ID", + /* 164 */ "modparameters ::= modparameters modparameter", + /* 165 */ "modparameters ::=", + /* 166 */ "modparameter ::= COLON value", + /* 167 */ "modparameter ::= COLON array", + /* 168 */ "static_class_access ::= method", + /* 169 */ "static_class_access ::= method objectchain", + /* 170 */ "static_class_access ::= ID", + /* 171 */ "static_class_access ::= DOLLAR ID arrayindex", + /* 172 */ "static_class_access ::= DOLLAR ID arrayindex objectchain", + /* 173 */ "ifcond ::= EQUALS", + /* 174 */ "ifcond ::= NOTEQUALS", + /* 175 */ "ifcond ::= GREATERTHAN", + /* 176 */ "ifcond ::= LESSTHAN", + /* 177 */ "ifcond ::= GREATEREQUAL", + /* 178 */ "ifcond ::= LESSEQUAL", + /* 179 */ "ifcond ::= IDENTITY", + /* 180 */ "ifcond ::= NONEIDENTITY", + /* 181 */ "ifcond ::= MOD", + /* 182 */ "lop ::= LAND", + /* 183 */ "lop ::= LOR", + /* 184 */ "lop ::= LXOR", + /* 185 */ "array ::= OPENB arrayelements CLOSEB", + /* 186 */ "arrayelements ::= arrayelement", + /* 187 */ "arrayelements ::= arrayelements COMMA arrayelement", + /* 188 */ "arrayelements ::=", + /* 189 */ "arrayelement ::= value APTR expr", + /* 190 */ "arrayelement ::= ID APTR expr", + /* 191 */ "arrayelement ::= expr", + /* 192 */ "doublequoted_with_quotes ::= QUOTE QUOTE", + /* 193 */ "doublequoted_with_quotes ::= QUOTE doublequoted QUOTE", + /* 194 */ "doublequoted ::= doublequoted doublequotedcontent", + /* 195 */ "doublequoted ::= doublequotedcontent", + /* 196 */ "doublequotedcontent ::= BACKTICK variable BACKTICK", + /* 197 */ "doublequotedcontent ::= BACKTICK expr BACKTICK", + /* 198 */ "doublequotedcontent ::= DOLLARID", + /* 199 */ "doublequotedcontent ::= LDEL variable RDEL", + /* 200 */ "doublequotedcontent ::= LDEL expr RDEL", + /* 201 */ "doublequotedcontent ::= smartytag RDEL", + /* 202 */ "doublequotedcontent ::= TEXT", + /* 203 */ "optspace ::= SPACE", + /* 204 */ "optspace ::=", + ); + + public function tokenName($tokenType) + { + if ($tokenType === 0) { + return 'End of Input'; + } + if ($tokenType > 0 && $tokenType < count($this->yyTokenName)) { + return $this->yyTokenName[$tokenType]; + } else { + return "Unknown"; + } + } + + public static function yy_destructor($yymajor, $yypminor) + { + switch ($yymajor) { + default: break; /* If no destructor action specified: do nothing */ + } + } + + public function yy_pop_parser_stack() + { + if (!count($this->yystack)) { + return; + } + $yytos = array_pop($this->yystack); + if (self::$yyTraceFILE && $this->yyidx >= 0) { + fwrite(self::$yyTraceFILE, + self::$yyTracePrompt . 'Popping ' . $this->yyTokenName[$yytos->major] . + "\n"); + } + $yymajor = $yytos->major; + self::yy_destructor($yymajor, $yytos->minor); + $this->yyidx--; + + return $yymajor; + } + + public function __destruct() + { + while ($this->yystack !== Array()) { + $this->yy_pop_parser_stack(); + } + if (is_resource(self::$yyTraceFILE)) { + fclose(self::$yyTraceFILE); + } + } + + public function yy_get_expected_tokens($token) + { + $state = $this->yystack[$this->yyidx]->stateno; + $expected = self::$yyExpectedTokens[$state]; + if (in_array($token, self::$yyExpectedTokens[$state], true)) { + return $expected; + } + $stack = $this->yystack; + $yyidx = $this->yyidx; + do { + $yyact = $this->yy_find_shift_action($token); + if ($yyact >= self::YYNSTATE && $yyact < self::YYNSTATE + self::YYNRULE) { + // reduce action + $done = 0; + do { + if ($done++ == 100) { + $this->yyidx = $yyidx; + $this->yystack = $stack; + // too much recursion prevents proper detection + // so give up + return array_unique($expected); + } + $yyruleno = $yyact - self::YYNSTATE; + $this->yyidx -= self::$yyRuleInfo[$yyruleno]['rhs']; + $nextstate = $this->yy_find_reduce_action( + $this->yystack[$this->yyidx]->stateno, + self::$yyRuleInfo[$yyruleno]['lhs']); + if (isset(self::$yyExpectedTokens[$nextstate])) { + $expected = array_merge($expected, self::$yyExpectedTokens[$nextstate]); + if (in_array($token, + self::$yyExpectedTokens[$nextstate], true)) { + $this->yyidx = $yyidx; + $this->yystack = $stack; + + return array_unique($expected); + } + } + if ($nextstate < self::YYNSTATE) { + // we need to shift a non-terminal + $this->yyidx++; + $x = new TP_yyStackEntry; + $x->stateno = $nextstate; + $x->major = self::$yyRuleInfo[$yyruleno]['lhs']; + $this->yystack[$this->yyidx] = $x; + continue 2; + } elseif ($nextstate == self::YYNSTATE + self::YYNRULE + 1) { + $this->yyidx = $yyidx; + $this->yystack = $stack; + // the last token was just ignored, we can't accept + // by ignoring input, this is in essence ignoring a + // syntax error! + return array_unique($expected); + } elseif ($nextstate === self::YY_NO_ACTION) { + $this->yyidx = $yyidx; + $this->yystack = $stack; + // input accepted, but not shifted (I guess) + return $expected; + } else { + $yyact = $nextstate; + } + } while (true); + } + break; + } while (true); + $this->yyidx = $yyidx; + $this->yystack = $stack; + + return array_unique($expected); + } + + public function yy_is_expected_token($token) + { + if ($token === 0) { + return true; // 0 is not part of this + } + $state = $this->yystack[$this->yyidx]->stateno; + if (in_array($token, self::$yyExpectedTokens[$state], true)) { + return true; + } + $stack = $this->yystack; + $yyidx = $this->yyidx; + do { + $yyact = $this->yy_find_shift_action($token); + if ($yyact >= self::YYNSTATE && $yyact < self::YYNSTATE + self::YYNRULE) { + // reduce action + $done = 0; + do { + if ($done++ == 100) { + $this->yyidx = $yyidx; + $this->yystack = $stack; + // too much recursion prevents proper detection + // so give up + return true; + } + $yyruleno = $yyact - self::YYNSTATE; + $this->yyidx -= self::$yyRuleInfo[$yyruleno]['rhs']; + $nextstate = $this->yy_find_reduce_action( + $this->yystack[$this->yyidx]->stateno, + self::$yyRuleInfo[$yyruleno]['lhs']); + if (isset(self::$yyExpectedTokens[$nextstate]) && + in_array($token, self::$yyExpectedTokens[$nextstate], true)) { + $this->yyidx = $yyidx; + $this->yystack = $stack; + + return true; + } + if ($nextstate < self::YYNSTATE) { + // we need to shift a non-terminal + $this->yyidx++; + $x = new TP_yyStackEntry; + $x->stateno = $nextstate; + $x->major = self::$yyRuleInfo[$yyruleno]['lhs']; + $this->yystack[$this->yyidx] = $x; + continue 2; + } elseif ($nextstate == self::YYNSTATE + self::YYNRULE + 1) { + $this->yyidx = $yyidx; + $this->yystack = $stack; + if (!$token) { + // end of input: this is valid + return true; + } + // the last token was just ignored, we can't accept + // by ignoring input, this is in essence ignoring a + // syntax error! + return false; + } elseif ($nextstate === self::YY_NO_ACTION) { + $this->yyidx = $yyidx; + $this->yystack = $stack; + // input accepted, but not shifted (I guess) + return true; + } else { + $yyact = $nextstate; + } + } while (true); + } + break; + } while (true); + $this->yyidx = $yyidx; + $this->yystack = $stack; + + return true; + } + + public function yy_find_shift_action($iLookAhead) + { + $stateno = $this->yystack[$this->yyidx]->stateno; + + /* if ($this->yyidx < 0) return self::YY_NO_ACTION; */ + if (!isset(self::$yy_shift_ofst[$stateno])) { + // no shift actions + return self::$yy_default[$stateno]; + } + $i = self::$yy_shift_ofst[$stateno]; + if ($i === self::YY_SHIFT_USE_DFLT) { + return self::$yy_default[$stateno]; + } + if ($iLookAhead == self::YYNOCODE) { + return self::YY_NO_ACTION; + } + $i += $iLookAhead; + if ($i < 0 || $i >= self::YY_SZ_ACTTAB || + self::$yy_lookahead[$i] != $iLookAhead) { + if (count(self::$yyFallback) && $iLookAhead < count(self::$yyFallback) + && ($iFallback = self::$yyFallback[$iLookAhead]) != 0) { + if (self::$yyTraceFILE) { + fwrite(self::$yyTraceFILE, self::$yyTracePrompt . "FALLBACK " . + $this->yyTokenName[$iLookAhead] . " => " . + $this->yyTokenName[$iFallback] . "\n"); + } + + return $this->yy_find_shift_action($iFallback); + } + + return self::$yy_default[$stateno]; + } else { + return self::$yy_action[$i]; + } + } + + public function yy_find_reduce_action($stateno, $iLookAhead) + { + /* $stateno = $this->yystack[$this->yyidx]->stateno; */ + + if (!isset(self::$yy_reduce_ofst[$stateno])) { + return self::$yy_default[$stateno]; + } + $i = self::$yy_reduce_ofst[$stateno]; + if ($i == self::YY_REDUCE_USE_DFLT) { + return self::$yy_default[$stateno]; + } + if ($iLookAhead == self::YYNOCODE) { + return self::YY_NO_ACTION; + } + $i += $iLookAhead; + if ($i < 0 || $i >= self::YY_SZ_ACTTAB || + self::$yy_lookahead[$i] != $iLookAhead) { + return self::$yy_default[$stateno]; + } else { + return self::$yy_action[$i]; + } + } + + public function yy_shift($yyNewState, $yyMajor, $yypMinor) + { + $this->yyidx++; + if ($this->yyidx >= self::YYSTACKDEPTH) { + $this->yyidx--; + if (self::$yyTraceFILE) { + fprintf(self::$yyTraceFILE, "%sStack Overflow!\n", self::$yyTracePrompt); + } + while ($this->yyidx >= 0) { + $this->yy_pop_parser_stack(); + } +#line 85 "smarty_internal_templateparser.y" + + $this->internalError = true; + $this->compiler->trigger_template_error("Stack overflow in template parser"); +#line 1707 "smarty_internal_templateparser.php" + + return; + } + $yytos = new TP_yyStackEntry; + $yytos->stateno = $yyNewState; + $yytos->major = $yyMajor; + $yytos->minor = $yypMinor; + array_push($this->yystack, $yytos); + if (self::$yyTraceFILE && $this->yyidx > 0) { + fprintf(self::$yyTraceFILE, "%sShift %d\n", self::$yyTracePrompt, + $yyNewState); + fprintf(self::$yyTraceFILE, "%sStack:", self::$yyTracePrompt); + for ($i = 1; $i <= $this->yyidx; $i++) { + fprintf(self::$yyTraceFILE, " %s", + $this->yyTokenName[$this->yystack[$i]->major]); + } + fwrite(self::$yyTraceFILE,"\n"); + } + } + + public static $yyRuleInfo = array( + array( 'lhs' => 83, 'rhs' => 1 ), + array( 'lhs' => 84, 'rhs' => 1 ), + array( 'lhs' => 84, 'rhs' => 2 ), + array( 'lhs' => 84, 'rhs' => 0 ), + array( 'lhs' => 85, 'rhs' => 2 ), + array( 'lhs' => 85, 'rhs' => 1 ), + array( 'lhs' => 85, 'rhs' => 1 ), + array( 'lhs' => 85, 'rhs' => 1 ), + array( 'lhs' => 85, 'rhs' => 1 ), + array( 'lhs' => 85, 'rhs' => 1 ), + array( 'lhs' => 85, 'rhs' => 1 ), + array( 'lhs' => 85, 'rhs' => 1 ), + array( 'lhs' => 85, 'rhs' => 1 ), + array( 'lhs' => 85, 'rhs' => 1 ), + array( 'lhs' => 85, 'rhs' => 1 ), + array( 'lhs' => 85, 'rhs' => 1 ), + array( 'lhs' => 85, 'rhs' => 1 ), + array( 'lhs' => 87, 'rhs' => 2 ), + array( 'lhs' => 87, 'rhs' => 3 ), + array( 'lhs' => 88, 'rhs' => 2 ), + array( 'lhs' => 88, 'rhs' => 0 ), + array( 'lhs' => 89, 'rhs' => 1 ), + array( 'lhs' => 89, 'rhs' => 1 ), + array( 'lhs' => 89, 'rhs' => 1 ), + array( 'lhs' => 89, 'rhs' => 1 ), + array( 'lhs' => 89, 'rhs' => 1 ), + array( 'lhs' => 89, 'rhs' => 1 ), + array( 'lhs' => 89, 'rhs' => 1 ), + array( 'lhs' => 86, 'rhs' => 2 ), + array( 'lhs' => 86, 'rhs' => 4 ), + array( 'lhs' => 86, 'rhs' => 3 ), + array( 'lhs' => 86, 'rhs' => 4 ), + array( 'lhs' => 86, 'rhs' => 3 ), + array( 'lhs' => 86, 'rhs' => 5 ), + array( 'lhs' => 86, 'rhs' => 5 ), + array( 'lhs' => 86, 'rhs' => 6 ), + array( 'lhs' => 86, 'rhs' => 5 ), + array( 'lhs' => 86, 'rhs' => 3 ), + array( 'lhs' => 86, 'rhs' => 2 ), + array( 'lhs' => 86, 'rhs' => 5 ), + array( 'lhs' => 86, 'rhs' => 4 ), + array( 'lhs' => 86, 'rhs' => 6 ), + array( 'lhs' => 86, 'rhs' => 2 ), + array( 'lhs' => 86, 'rhs' => 3 ), + array( 'lhs' => 86, 'rhs' => 2 ), + array( 'lhs' => 86, 'rhs' => 3 ), + array( 'lhs' => 86, 'rhs' => 11 ), + array( 'lhs' => 99, 'rhs' => 2 ), + array( 'lhs' => 99, 'rhs' => 1 ), + array( 'lhs' => 86, 'rhs' => 5 ), + array( 'lhs' => 86, 'rhs' => 7 ), + array( 'lhs' => 86, 'rhs' => 2 ), + array( 'lhs' => 86, 'rhs' => 7 ), + array( 'lhs' => 86, 'rhs' => 10 ), + array( 'lhs' => 86, 'rhs' => 7 ), + array( 'lhs' => 86, 'rhs' => 10 ), + array( 'lhs' => 86, 'rhs' => 3 ), + array( 'lhs' => 86, 'rhs' => 4 ), + array( 'lhs' => 86, 'rhs' => 2 ), + array( 'lhs' => 86, 'rhs' => 2 ), + array( 'lhs' => 86, 'rhs' => 3 ), + array( 'lhs' => 86, 'rhs' => 4 ), + array( 'lhs' => 86, 'rhs' => 5 ), + array( 'lhs' => 92, 'rhs' => 2 ), + array( 'lhs' => 92, 'rhs' => 1 ), + array( 'lhs' => 92, 'rhs' => 0 ), + array( 'lhs' => 101, 'rhs' => 4 ), + array( 'lhs' => 101, 'rhs' => 2 ), + array( 'lhs' => 101, 'rhs' => 2 ), + array( 'lhs' => 101, 'rhs' => 2 ), + array( 'lhs' => 101, 'rhs' => 2 ), + array( 'lhs' => 101, 'rhs' => 2 ), + array( 'lhs' => 101, 'rhs' => 4 ), + array( 'lhs' => 96, 'rhs' => 1 ), + array( 'lhs' => 96, 'rhs' => 3 ), + array( 'lhs' => 95, 'rhs' => 4 ), + array( 'lhs' => 95, 'rhs' => 3 ), + array( 'lhs' => 95, 'rhs' => 3 ), + array( 'lhs' => 93, 'rhs' => 1 ), + array( 'lhs' => 93, 'rhs' => 1 ), + array( 'lhs' => 93, 'rhs' => 4 ), + array( 'lhs' => 93, 'rhs' => 3 ), + array( 'lhs' => 93, 'rhs' => 3 ), + array( 'lhs' => 93, 'rhs' => 3 ), + array( 'lhs' => 93, 'rhs' => 1 ), + array( 'lhs' => 93, 'rhs' => 2 ), + array( 'lhs' => 93, 'rhs' => 3 ), + array( 'lhs' => 93, 'rhs' => 3 ), + array( 'lhs' => 93, 'rhs' => 3 ), + array( 'lhs' => 93, 'rhs' => 3 ), + array( 'lhs' => 93, 'rhs' => 3 ), + array( 'lhs' => 93, 'rhs' => 3 ), + array( 'lhs' => 93, 'rhs' => 2 ), + array( 'lhs' => 93, 'rhs' => 2 ), + array( 'lhs' => 93, 'rhs' => 3 ), + array( 'lhs' => 93, 'rhs' => 3 ), + array( 'lhs' => 93, 'rhs' => 2 ), + array( 'lhs' => 93, 'rhs' => 2 ), + array( 'lhs' => 93, 'rhs' => 3 ), + array( 'lhs' => 93, 'rhs' => 3 ), + array( 'lhs' => 93, 'rhs' => 3 ), + array( 'lhs' => 93, 'rhs' => 3 ), + array( 'lhs' => 102, 'rhs' => 8 ), + array( 'lhs' => 102, 'rhs' => 7 ), + array( 'lhs' => 90, 'rhs' => 1 ), + array( 'lhs' => 90, 'rhs' => 2 ), + array( 'lhs' => 90, 'rhs' => 2 ), + array( 'lhs' => 90, 'rhs' => 2 ), + array( 'lhs' => 90, 'rhs' => 2 ), + array( 'lhs' => 90, 'rhs' => 1 ), + array( 'lhs' => 90, 'rhs' => 1 ), + array( 'lhs' => 90, 'rhs' => 3 ), + array( 'lhs' => 90, 'rhs' => 2 ), + array( 'lhs' => 90, 'rhs' => 2 ), + array( 'lhs' => 90, 'rhs' => 1 ), + array( 'lhs' => 90, 'rhs' => 1 ), + array( 'lhs' => 90, 'rhs' => 3 ), + array( 'lhs' => 90, 'rhs' => 1 ), + array( 'lhs' => 90, 'rhs' => 1 ), + array( 'lhs' => 90, 'rhs' => 3 ), + array( 'lhs' => 90, 'rhs' => 3 ), + array( 'lhs' => 90, 'rhs' => 2 ), + array( 'lhs' => 90, 'rhs' => 2 ), + array( 'lhs' => 106, 'rhs' => 1 ), + array( 'lhs' => 106, 'rhs' => 4 ), + array( 'lhs' => 106, 'rhs' => 1 ), + array( 'lhs' => 106, 'rhs' => 3 ), + array( 'lhs' => 106, 'rhs' => 4 ), + array( 'lhs' => 106, 'rhs' => 3 ), + array( 'lhs' => 106, 'rhs' => 4 ), + array( 'lhs' => 94, 'rhs' => 3 ), + array( 'lhs' => 111, 'rhs' => 2 ), + array( 'lhs' => 111, 'rhs' => 0 ), + array( 'lhs' => 112, 'rhs' => 3 ), + array( 'lhs' => 112, 'rhs' => 5 ), + array( 'lhs' => 112, 'rhs' => 2 ), + array( 'lhs' => 112, 'rhs' => 2 ), + array( 'lhs' => 112, 'rhs' => 4 ), + array( 'lhs' => 112, 'rhs' => 3 ), + array( 'lhs' => 112, 'rhs' => 5 ), + array( 'lhs' => 112, 'rhs' => 3 ), + array( 'lhs' => 112, 'rhs' => 2 ), + array( 'lhs' => 98, 'rhs' => 1 ), + array( 'lhs' => 98, 'rhs' => 2 ), + array( 'lhs' => 113, 'rhs' => 1 ), + array( 'lhs' => 113, 'rhs' => 3 ), + array( 'lhs' => 110, 'rhs' => 2 ), + array( 'lhs' => 114, 'rhs' => 1 ), + array( 'lhs' => 114, 'rhs' => 2 ), + array( 'lhs' => 115, 'rhs' => 3 ), + array( 'lhs' => 115, 'rhs' => 4 ), + array( 'lhs' => 115, 'rhs' => 5 ), + array( 'lhs' => 115, 'rhs' => 6 ), + array( 'lhs' => 115, 'rhs' => 2 ), + array( 'lhs' => 107, 'rhs' => 4 ), + array( 'lhs' => 116, 'rhs' => 4 ), + array( 'lhs' => 116, 'rhs' => 5 ), + array( 'lhs' => 117, 'rhs' => 3 ), + array( 'lhs' => 117, 'rhs' => 1 ), + array( 'lhs' => 117, 'rhs' => 0 ), + array( 'lhs' => 91, 'rhs' => 3 ), + array( 'lhs' => 91, 'rhs' => 2 ), + array( 'lhs' => 118, 'rhs' => 3 ), + array( 'lhs' => 118, 'rhs' => 2 ), + array( 'lhs' => 100, 'rhs' => 2 ), + array( 'lhs' => 100, 'rhs' => 0 ), + array( 'lhs' => 119, 'rhs' => 2 ), + array( 'lhs' => 119, 'rhs' => 2 ), + array( 'lhs' => 109, 'rhs' => 1 ), + array( 'lhs' => 109, 'rhs' => 2 ), + array( 'lhs' => 109, 'rhs' => 1 ), + array( 'lhs' => 109, 'rhs' => 3 ), + array( 'lhs' => 109, 'rhs' => 4 ), + array( 'lhs' => 104, 'rhs' => 1 ), + array( 'lhs' => 104, 'rhs' => 1 ), + array( 'lhs' => 104, 'rhs' => 1 ), + array( 'lhs' => 104, 'rhs' => 1 ), + array( 'lhs' => 104, 'rhs' => 1 ), + array( 'lhs' => 104, 'rhs' => 1 ), + array( 'lhs' => 104, 'rhs' => 1 ), + array( 'lhs' => 104, 'rhs' => 1 ), + array( 'lhs' => 104, 'rhs' => 1 ), + array( 'lhs' => 105, 'rhs' => 1 ), + array( 'lhs' => 105, 'rhs' => 1 ), + array( 'lhs' => 105, 'rhs' => 1 ), + array( 'lhs' => 103, 'rhs' => 3 ), + array( 'lhs' => 120, 'rhs' => 1 ), + array( 'lhs' => 120, 'rhs' => 3 ), + array( 'lhs' => 120, 'rhs' => 0 ), + array( 'lhs' => 121, 'rhs' => 3 ), + array( 'lhs' => 121, 'rhs' => 3 ), + array( 'lhs' => 121, 'rhs' => 1 ), + array( 'lhs' => 108, 'rhs' => 2 ), + array( 'lhs' => 108, 'rhs' => 3 ), + array( 'lhs' => 122, 'rhs' => 2 ), + array( 'lhs' => 122, 'rhs' => 1 ), + array( 'lhs' => 123, 'rhs' => 3 ), + array( 'lhs' => 123, 'rhs' => 3 ), + array( 'lhs' => 123, 'rhs' => 1 ), + array( 'lhs' => 123, 'rhs' => 3 ), + array( 'lhs' => 123, 'rhs' => 3 ), + array( 'lhs' => 123, 'rhs' => 2 ), + array( 'lhs' => 123, 'rhs' => 1 ), + array( 'lhs' => 97, 'rhs' => 1 ), + array( 'lhs' => 97, 'rhs' => 0 ), + ); + + public static $yyReduceMap = array( + 0 => 0, + 1 => 1, + 2 => 1, + 4 => 4, + 5 => 5, + 6 => 6, + 7 => 7, + 8 => 8, + 9 => 9, + 10 => 10, + 11 => 11, + 12 => 12, + 13 => 13, + 14 => 14, + 15 => 15, + 16 => 16, + 17 => 17, + 20 => 17, + 204 => 17, + 18 => 18, + 77 => 18, + 19 => 19, + 105 => 19, + 107 => 19, + 108 => 19, + 131 => 19, + 169 => 19, + 21 => 21, + 22 => 21, + 48 => 21, + 70 => 21, + 71 => 21, + 78 => 21, + 79 => 21, + 84 => 21, + 104 => 21, + 109 => 21, + 110 => 21, + 115 => 21, + 117 => 21, + 118 => 21, + 125 => 21, + 142 => 21, + 168 => 21, + 170 => 21, + 186 => 21, + 191 => 21, + 203 => 21, + 23 => 23, + 24 => 23, + 25 => 25, + 26 => 26, + 27 => 27, + 28 => 28, + 29 => 29, + 30 => 30, + 32 => 30, + 31 => 31, + 33 => 33, + 34 => 33, + 35 => 35, + 36 => 36, + 37 => 37, + 38 => 38, + 39 => 39, + 40 => 40, + 41 => 41, + 42 => 42, + 43 => 43, + 45 => 43, + 44 => 44, + 46 => 46, + 47 => 47, + 49 => 49, + 50 => 50, + 51 => 51, + 52 => 52, + 54 => 52, + 53 => 53, + 55 => 53, + 56 => 56, + 57 => 57, + 58 => 58, + 59 => 59, + 60 => 60, + 61 => 61, + 62 => 62, + 63 => 63, + 64 => 64, + 73 => 64, + 158 => 64, + 162 => 64, + 166 => 64, + 167 => 64, + 65 => 65, + 159 => 65, + 165 => 65, + 66 => 66, + 67 => 67, + 68 => 67, + 69 => 69, + 72 => 72, + 74 => 74, + 75 => 75, + 76 => 75, + 80 => 80, + 81 => 81, + 82 => 81, + 83 => 81, + 85 => 85, + 122 => 85, + 86 => 86, + 89 => 86, + 100 => 86, + 87 => 87, + 88 => 88, + 90 => 90, + 91 => 91, + 92 => 92, + 97 => 92, + 93 => 93, + 96 => 93, + 94 => 94, + 99 => 94, + 95 => 95, + 98 => 95, + 101 => 101, + 102 => 102, + 103 => 103, + 106 => 106, + 111 => 111, + 112 => 112, + 113 => 113, + 114 => 114, + 116 => 116, + 119 => 119, + 120 => 120, + 121 => 121, + 123 => 123, + 124 => 124, + 126 => 126, + 127 => 127, + 128 => 128, + 129 => 129, + 130 => 130, + 132 => 132, + 188 => 132, + 133 => 133, + 134 => 134, + 135 => 135, + 136 => 136, + 137 => 137, + 140 => 137, + 138 => 138, + 139 => 139, + 141 => 141, + 143 => 143, + 144 => 144, + 145 => 145, + 146 => 146, + 147 => 147, + 148 => 148, + 149 => 149, + 150 => 150, + 151 => 151, + 152 => 152, + 153 => 153, + 154 => 154, + 155 => 155, + 156 => 156, + 157 => 157, + 160 => 160, + 161 => 161, + 163 => 163, + 164 => 164, + 171 => 171, + 172 => 172, + 173 => 173, + 174 => 174, + 175 => 175, + 176 => 176, + 177 => 177, + 178 => 178, + 179 => 179, + 180 => 180, + 181 => 181, + 182 => 182, + 183 => 183, + 184 => 184, + 185 => 185, + 187 => 187, + 189 => 189, + 190 => 190, + 192 => 192, + 193 => 193, + 194 => 194, + 195 => 195, + 196 => 196, + 197 => 196, + 199 => 196, + 198 => 198, + 200 => 200, + 201 => 201, + 202 => 202, + ); +#line 96 "smarty_internal_templateparser.y" + function yy_r0(){ + $this->_retvalue = $this->root_buffer->to_smarty_php(); + } +#line 2146 "smarty_internal_templateparser.php" +#line 104 "smarty_internal_templateparser.y" + function yy_r1(){ + if ($this->yystack[$this->yyidx + 0]->minor != null) { + $this->current_buffer->append_subtree($this->yystack[$this->yyidx + 0]->minor); + } + } +#line 2153 "smarty_internal_templateparser.php" +#line 124 "smarty_internal_templateparser.y" + function yy_r4(){ + if ($this->compiler->has_code) { + $tmp =''; foreach ($this->compiler->prefix_code as $code) {$tmp.=$code;} $this->compiler->prefix_code=array(); + $this->_retvalue = new _smarty_tag($this, $this->compiler->processNocacheCode($tmp.$this->yystack[$this->yyidx + -1]->minor,true)); + } else { + $this->_retvalue = null; + } + $this->compiler->has_variable_string = false; + $this->block_nesting_level = count($this->compiler->_tag_stack); + } +#line 2165 "smarty_internal_templateparser.php" +#line 136 "smarty_internal_templateparser.y" + function yy_r5(){ + $this->_retvalue = null; + } +#line 2170 "smarty_internal_templateparser.php" +#line 141 "smarty_internal_templateparser.y" + function yy_r6(){ + $this->_retvalue = new _smarty_text($this, $this->yystack[$this->yyidx + 0]->minor); + } +#line 2175 "smarty_internal_templateparser.php" +#line 146 "smarty_internal_templateparser.y" + function yy_r7(){ + if ($this->php_handling == Smarty::PHP_PASSTHRU) { + $this->_retvalue = new _smarty_text($this, self::escape_start_tag($this->yystack[$this->yyidx + 0]->minor)); + } elseif ($this->php_handling == Smarty::PHP_QUOTE) { + $this->_retvalue = new _smarty_text($this, htmlspecialchars($this->yystack[$this->yyidx + 0]->minor, ENT_QUOTES)); + } elseif ($this->php_handling == Smarty::PHP_ALLOW) { + if (!($this->smarty instanceof SmartyBC)) { + $this->compiler->trigger_template_error (self::Err3); + } + $this->_retvalue = new _smarty_text($this, $this->compiler->processNocacheCode('php_handling == Smarty::PHP_REMOVE) { + $this->_retvalue = null; + } + } +#line 2191 "smarty_internal_templateparser.php" +#line 162 "smarty_internal_templateparser.y" + function yy_r8(){ + if ($this->is_xml) { + $this->compiler->tag_nocache = true; + $this->is_xml = false; + $save = $this->template->has_nocache_code; + $this->_retvalue = new _smarty_text($this, $this->compiler->processNocacheCode("';?>\n", $this->compiler, true)); + $this->template->has_nocache_code = $save; + } elseif ($this->php_handling == Smarty::PHP_PASSTHRU) { + $this->_retvalue = new _smarty_text($this, '?>'); + } elseif ($this->php_handling == Smarty::PHP_QUOTE) { + $this->_retvalue = new _smarty_text($this, htmlspecialchars('?>', ENT_QUOTES)); + } elseif ($this->php_handling == Smarty::PHP_ALLOW) { + $this->_retvalue = new _smarty_text($this, $this->compiler->processNocacheCode('?>', true)); + } elseif ($this->php_handling == Smarty::PHP_REMOVE) { + $this->_retvalue = null; + } + } +#line 2210 "smarty_internal_templateparser.php" +#line 181 "smarty_internal_templateparser.y" + function yy_r9(){ + if ($this->php_handling == Smarty::PHP_PASSTHRU) { + $this->_retvalue = new _smarty_text($this, '<%'); + } elseif ($this->php_handling == Smarty::PHP_QUOTE) { + $this->_retvalue = new _smarty_text($this, htmlspecialchars($this->yystack[$this->yyidx + 0]->minor, ENT_QUOTES)); + } elseif ($this->php_handling == Smarty::PHP_ALLOW) { + if ($this->asp_tags) { + if (!($this->smarty instanceof SmartyBC)) { + $this->compiler->trigger_template_error (self::Err3); + } + $this->_retvalue = new _smarty_text($this, $this->compiler->processNocacheCode('<%', true)); + } else { + $this->_retvalue = new _smarty_text($this, '<%'); + } + } elseif ($this->php_handling == Smarty::PHP_REMOVE) { + if ($this->asp_tags) { + $this->_retvalue = null; + } else { + $this->_retvalue = new _smarty_text($this, '<%'); + } + } + } +#line 2234 "smarty_internal_templateparser.php" +#line 205 "smarty_internal_templateparser.y" + function yy_r10(){ + if ($this->php_handling == Smarty::PHP_PASSTHRU) { + $this->_retvalue = new _smarty_text($this, '%>'); + } elseif ($this->php_handling == Smarty::PHP_QUOTE) { + $this->_retvalue = new _smarty_text($this, htmlspecialchars('%>', ENT_QUOTES)); + } elseif ($this->php_handling == Smarty::PHP_ALLOW) { + if ($this->asp_tags) { + $this->_retvalue = new _smarty_text($this, $this->compiler->processNocacheCode('%>', true)); + } else { + $this->_retvalue = new _smarty_text($this, '%>'); + } + } elseif ($this->php_handling == Smarty::PHP_REMOVE) { + if ($this->asp_tags) { + $this->_retvalue = null; + } else { + $this->_retvalue = new _smarty_text($this, '%>'); + } + } + } +#line 2255 "smarty_internal_templateparser.php" +#line 225 "smarty_internal_templateparser.y" + function yy_r11(){ + if ($this->strip) { + $this->_retvalue = new _smarty_text($this, preg_replace('![\t ]*[\r\n]+[\t ]*!', '', self::escape_start_tag($this->yystack[$this->yyidx + 0]->minor))); + } else { + $this->_retvalue = new _smarty_text($this, self::escape_start_tag($this->yystack[$this->yyidx + 0]->minor)); + } + } +#line 2264 "smarty_internal_templateparser.php" +#line 234 "smarty_internal_templateparser.y" + function yy_r12(){ + $this->compiler->tag_nocache = true; + $this->is_xml = true; + $save = $this->template->has_nocache_code; + $this->_retvalue = new _smarty_text($this, $this->compiler->processNocacheCode("", $this->compiler, true)); + $this->template->has_nocache_code = $save; + } +#line 2273 "smarty_internal_templateparser.php" +#line 243 "smarty_internal_templateparser.y" + function yy_r13(){ + if ($this->strip) { + $this->_retvalue = new _smarty_text($this, preg_replace('![\t ]*[\r\n]+[\t ]*!', '', $this->yystack[$this->yyidx + 0]->minor)); + } else { + $this->_retvalue = new _smarty_text($this, $this->yystack[$this->yyidx + 0]->minor); + } + } +#line 2282 "smarty_internal_templateparser.php" +#line 252 "smarty_internal_templateparser.y" + function yy_r14(){ + $this->strip = true; + } +#line 2287 "smarty_internal_templateparser.php" +#line 256 "smarty_internal_templateparser.y" + function yy_r15(){ + $this->strip = false; + } +#line 2292 "smarty_internal_templateparser.php" +#line 260 "smarty_internal_templateparser.y" + function yy_r16(){ + if ($this->strip) { + SMARTY_INTERNAL_COMPILE_BLOCK::blockSource($this->compiler, preg_replace('![\t ]*[\r\n]+[\t ]*!', '', $this->yystack[$this->yyidx + 0]->minor)); + } else { + SMARTY_INTERNAL_COMPILE_BLOCK::blockSource($this->compiler, $this->yystack[$this->yyidx + 0]->minor); + } + } +#line 2301 "smarty_internal_templateparser.php" +#line 269 "smarty_internal_templateparser.y" + function yy_r17(){ + $this->_retvalue = ''; + } +#line 2306 "smarty_internal_templateparser.php" +#line 273 "smarty_internal_templateparser.y" + function yy_r18(){ + $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor; + } +#line 2311 "smarty_internal_templateparser.php" +#line 277 "smarty_internal_templateparser.y" + function yy_r19(){ + $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor; + } +#line 2316 "smarty_internal_templateparser.php" +#line 285 "smarty_internal_templateparser.y" + function yy_r21(){ + $this->_retvalue = $this->yystack[$this->yyidx + 0]->minor; + } +#line 2321 "smarty_internal_templateparser.php" +#line 293 "smarty_internal_templateparser.y" + function yy_r23(){ + $this->_retvalue = self::escape_start_tag($this->yystack[$this->yyidx + 0]->minor); + } +#line 2326 "smarty_internal_templateparser.php" +#line 301 "smarty_internal_templateparser.y" + function yy_r25(){ + $this->_retvalue = self::escape_end_tag($this->yystack[$this->yyidx + 0]->minor); + } +#line 2331 "smarty_internal_templateparser.php" +#line 305 "smarty_internal_templateparser.y" + function yy_r26(){ + $this->_retvalue = '<%'; + } +#line 2336 "smarty_internal_templateparser.php" +#line 309 "smarty_internal_templateparser.y" + function yy_r27(){ + $this->_retvalue = '%>'; + } +#line 2341 "smarty_internal_templateparser.php" +#line 318 "smarty_internal_templateparser.y" + function yy_r28(){ + $this->_retvalue = $this->compiler->compileTag('private_print_expression',array(),array('value'=>$this->yystack[$this->yyidx + 0]->minor)); + } +#line 2346 "smarty_internal_templateparser.php" +#line 322 "smarty_internal_templateparser.y" + function yy_r29(){ + $this->_retvalue = $this->compiler->compileTag('private_print_expression',$this->yystack[$this->yyidx + 0]->minor,array('value'=>$this->yystack[$this->yyidx + -2]->minor, 'modifierlist'=>$this->yystack[$this->yyidx + -1]->minor)); + } +#line 2351 "smarty_internal_templateparser.php" +#line 326 "smarty_internal_templateparser.y" + function yy_r30(){ + $this->_retvalue = $this->compiler->compileTag('private_print_expression',$this->yystack[$this->yyidx + 0]->minor,array('value'=>$this->yystack[$this->yyidx + -1]->minor)); + } +#line 2356 "smarty_internal_templateparser.php" +#line 330 "smarty_internal_templateparser.y" + function yy_r31(){ + $this->_retvalue = $this->compiler->compileTag('private_print_expression',$this->yystack[$this->yyidx + 0]->minor,array('value'=>$this->yystack[$this->yyidx + -2]->minor,'modifierlist'=>$this->yystack[$this->yyidx + -1]->minor)); + } +#line 2361 "smarty_internal_templateparser.php" +#line 343 "smarty_internal_templateparser.y" + function yy_r33(){ + $this->_retvalue = $this->compiler->compileTag('assign',array(array('value'=>$this->yystack[$this->yyidx + 0]->minor),array('var'=>"'".$this->yystack[$this->yyidx + -2]->minor."'"))); + } +#line 2366 "smarty_internal_templateparser.php" +#line 351 "smarty_internal_templateparser.y" + function yy_r35(){ + $this->_retvalue = $this->compiler->compileTag('assign',array_merge(array(array('value'=>$this->yystack[$this->yyidx + -1]->minor),array('var'=>"'".$this->yystack[$this->yyidx + -3]->minor."'")),$this->yystack[$this->yyidx + 0]->minor)); + } +#line 2371 "smarty_internal_templateparser.php" +#line 355 "smarty_internal_templateparser.y" + function yy_r36(){ + $this->_retvalue = $this->compiler->compileTag('assign',array_merge(array(array('value'=>$this->yystack[$this->yyidx + -1]->minor),array('var'=>$this->yystack[$this->yyidx + -3]->minor['var'])),$this->yystack[$this->yyidx + 0]->minor),array('smarty_internal_index'=>$this->yystack[$this->yyidx + -3]->minor['smarty_internal_index'])); + } +#line 2376 "smarty_internal_templateparser.php" +#line 360 "smarty_internal_templateparser.y" + function yy_r37(){ + $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + -1]->minor,$this->yystack[$this->yyidx + 0]->minor); + } +#line 2381 "smarty_internal_templateparser.php" +#line 364 "smarty_internal_templateparser.y" + function yy_r38(){ + $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + 0]->minor,array()); + } +#line 2386 "smarty_internal_templateparser.php" +#line 369 "smarty_internal_templateparser.y" + function yy_r39(){ + $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + -3]->minor,$this->yystack[$this->yyidx + 0]->minor,array('object_methode'=>$this->yystack[$this->yyidx + -1]->minor)); + } +#line 2391 "smarty_internal_templateparser.php" +#line 374 "smarty_internal_templateparser.y" + function yy_r40(){ + $this->_retvalue = ''.$this->compiler->compileTag($this->yystack[$this->yyidx + -2]->minor,$this->yystack[$this->yyidx + 0]->minor).'_retvalue .= $this->compiler->compileTag('private_modifier',array(),array('modifierlist'=>$this->yystack[$this->yyidx + -1]->minor,'value'=>'ob_get_clean()')).'?>'; + } +#line 2397 "smarty_internal_templateparser.php" +#line 380 "smarty_internal_templateparser.y" + function yy_r41(){ + $this->_retvalue = ''.$this->compiler->compileTag($this->yystack[$this->yyidx + -4]->minor,$this->yystack[$this->yyidx + 0]->minor,array('object_methode'=>$this->yystack[$this->yyidx + -2]->minor)).'_retvalue .= $this->compiler->compileTag('private_modifier',array(),array('modifierlist'=>$this->yystack[$this->yyidx + -1]->minor,'value'=>'ob_get_clean()')).'?>'; + } +#line 2403 "smarty_internal_templateparser.php" +#line 386 "smarty_internal_templateparser.y" + function yy_r42(){ + $tag = trim(substr($this->yystack[$this->yyidx + -1]->minor,$this->lex->ldel_length)); + $this->_retvalue = $this->compiler->compileTag(($tag == 'else if')? 'elseif' : $tag,array(),array('if condition'=>$this->yystack[$this->yyidx + 0]->minor)); + } +#line 2409 "smarty_internal_templateparser.php" +#line 391 "smarty_internal_templateparser.y" + function yy_r43(){ + $tag = trim(substr($this->yystack[$this->yyidx + -2]->minor,$this->lex->ldel_length)); + $this->_retvalue = $this->compiler->compileTag(($tag == 'else if')? 'elseif' : $tag,$this->yystack[$this->yyidx + 0]->minor,array('if condition'=>$this->yystack[$this->yyidx + -1]->minor)); + } +#line 2415 "smarty_internal_templateparser.php" +#line 396 "smarty_internal_templateparser.y" + function yy_r44(){ + $tag = trim(substr($this->yystack[$this->yyidx + -1]->minor,$this->lex->ldel_length)); + $this->_retvalue = $this->compiler->compileTag(($tag == 'else if')? 'elseif' : $tag,array(),array('if condition'=>$this->yystack[$this->yyidx + 0]->minor)); + } +#line 2421 "smarty_internal_templateparser.php" +#line 407 "smarty_internal_templateparser.y" + function yy_r46(){ + $this->_retvalue = $this->compiler->compileTag('for',array_merge($this->yystack[$this->yyidx + 0]->minor,array(array('start'=>$this->yystack[$this->yyidx + -9]->minor),array('ifexp'=>$this->yystack[$this->yyidx + -6]->minor),array('var'=>$this->yystack[$this->yyidx + -2]->minor),array('step'=>$this->yystack[$this->yyidx + -1]->minor))),1); + } +#line 2426 "smarty_internal_templateparser.php" +#line 411 "smarty_internal_templateparser.y" + function yy_r47(){ + $this->_retvalue = '='.$this->yystack[$this->yyidx + 0]->minor; + } +#line 2431 "smarty_internal_templateparser.php" +#line 419 "smarty_internal_templateparser.y" + function yy_r49(){ + $this->_retvalue = $this->compiler->compileTag('for',array_merge($this->yystack[$this->yyidx + 0]->minor,array(array('start'=>$this->yystack[$this->yyidx + -3]->minor),array('to'=>$this->yystack[$this->yyidx + -1]->minor))),0); + } +#line 2436 "smarty_internal_templateparser.php" +#line 423 "smarty_internal_templateparser.y" + function yy_r50(){ + $this->_retvalue = $this->compiler->compileTag('for',array_merge($this->yystack[$this->yyidx + 0]->minor,array(array('start'=>$this->yystack[$this->yyidx + -5]->minor),array('to'=>$this->yystack[$this->yyidx + -3]->minor),array('step'=>$this->yystack[$this->yyidx + -1]->minor))),0); + } +#line 2441 "smarty_internal_templateparser.php" +#line 428 "smarty_internal_templateparser.y" + function yy_r51(){ + $this->_retvalue = $this->compiler->compileTag('foreach',$this->yystack[$this->yyidx + 0]->minor); + } +#line 2446 "smarty_internal_templateparser.php" +#line 433 "smarty_internal_templateparser.y" + function yy_r52(){ + $this->_retvalue = $this->compiler->compileTag('foreach',array_merge($this->yystack[$this->yyidx + 0]->minor,array(array('from'=>$this->yystack[$this->yyidx + -4]->minor),array('item'=>$this->yystack[$this->yyidx + -1]->minor)))); + } +#line 2451 "smarty_internal_templateparser.php" +#line 437 "smarty_internal_templateparser.y" + function yy_r53(){ + $this->_retvalue = $this->compiler->compileTag('foreach',array_merge($this->yystack[$this->yyidx + 0]->minor,array(array('from'=>$this->yystack[$this->yyidx + -7]->minor),array('item'=>$this->yystack[$this->yyidx + -1]->minor),array('key'=>$this->yystack[$this->yyidx + -4]->minor)))); + } +#line 2456 "smarty_internal_templateparser.php" +#line 450 "smarty_internal_templateparser.y" + function yy_r56(){ + $this->_retvalue = $this->compiler->compileTag('setfilter',array(),array('modifier_list'=>array(array_merge(array($this->yystack[$this->yyidx + -1]->minor),$this->yystack[$this->yyidx + 0]->minor)))); + } +#line 2461 "smarty_internal_templateparser.php" +#line 454 "smarty_internal_templateparser.y" + function yy_r57(){ + $this->_retvalue = $this->compiler->compileTag('setfilter',array(),array('modifier_list'=>array_merge(array(array_merge(array($this->yystack[$this->yyidx + -2]->minor),$this->yystack[$this->yyidx + -1]->minor)),$this->yystack[$this->yyidx + 0]->minor))); + } +#line 2466 "smarty_internal_templateparser.php" +#line 459 "smarty_internal_templateparser.y" + function yy_r58(){ + $j = strrpos($this->yystack[$this->yyidx + 0]->minor,'.'); + if ($this->yystack[$this->yyidx + 0]->minor[$j+1] == 'c') { + // {$smarty.block.child} + $this->_retvalue = SMARTY_INTERNAL_COMPILE_BLOCK::compileChildBlock($this->compiler); + } else { + // {$smarty.block.parent} + $this->_retvalue = SMARTY_INTERNAL_COMPILE_BLOCK::compileParentBlock($this->compiler); + } + } +#line 2478 "smarty_internal_templateparser.php" +#line 472 "smarty_internal_templateparser.y" + function yy_r59(){ + $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + 0]->minor.'close',array()); + } +#line 2483 "smarty_internal_templateparser.php" +#line 476 "smarty_internal_templateparser.y" + function yy_r60(){ + $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + -1]->minor.'close',array(),array('modifier_list'=>$this->yystack[$this->yyidx + 0]->minor)); + } +#line 2488 "smarty_internal_templateparser.php" +#line 481 "smarty_internal_templateparser.y" + function yy_r61(){ + $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + -2]->minor.'close',array(),array('object_methode'=>$this->yystack[$this->yyidx + 0]->minor)); + } +#line 2493 "smarty_internal_templateparser.php" +#line 485 "smarty_internal_templateparser.y" + function yy_r62(){ + $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + -3]->minor.'close',array(),array('object_methode'=>$this->yystack[$this->yyidx + -1]->minor, 'modifier_list'=>$this->yystack[$this->yyidx + 0]->minor)); + } +#line 2498 "smarty_internal_templateparser.php" +#line 493 "smarty_internal_templateparser.y" + function yy_r63(){ + $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor; + $this->_retvalue[] = $this->yystack[$this->yyidx + 0]->minor; + } +#line 2504 "smarty_internal_templateparser.php" +#line 499 "smarty_internal_templateparser.y" + function yy_r64(){ + $this->_retvalue = array($this->yystack[$this->yyidx + 0]->minor); + } +#line 2509 "smarty_internal_templateparser.php" +#line 504 "smarty_internal_templateparser.y" + function yy_r65(){ + $this->_retvalue = array(); + } +#line 2514 "smarty_internal_templateparser.php" +#line 509 "smarty_internal_templateparser.y" + function yy_r66(){ + if (preg_match('~^true$~i', $this->yystack[$this->yyidx + 0]->minor)) { + $this->_retvalue = array($this->yystack[$this->yyidx + -2]->minor=>'true'); + } elseif (preg_match('~^false$~i', $this->yystack[$this->yyidx + 0]->minor)) { + $this->_retvalue = array($this->yystack[$this->yyidx + -2]->minor=>'false'); + } elseif (preg_match('~^null$~i', $this->yystack[$this->yyidx + 0]->minor)) { + $this->_retvalue = array($this->yystack[$this->yyidx + -2]->minor=>'null'); + } else { + $this->_retvalue = array($this->yystack[$this->yyidx + -2]->minor=>"'".$this->yystack[$this->yyidx + 0]->minor."'"); + } + } +#line 2527 "smarty_internal_templateparser.php" +#line 521 "smarty_internal_templateparser.y" + function yy_r67(){ + $this->_retvalue = array(trim($this->yystack[$this->yyidx + -1]->minor," =\n\r\t")=>$this->yystack[$this->yyidx + 0]->minor); + } +#line 2532 "smarty_internal_templateparser.php" +#line 529 "smarty_internal_templateparser.y" + function yy_r69(){ + $this->_retvalue = "'".$this->yystack[$this->yyidx + 0]->minor."'"; + } +#line 2537 "smarty_internal_templateparser.php" +#line 541 "smarty_internal_templateparser.y" + function yy_r72(){ + $this->_retvalue = array($this->yystack[$this->yyidx + -2]->minor=>$this->yystack[$this->yyidx + 0]->minor); + } +#line 2542 "smarty_internal_templateparser.php" +#line 554 "smarty_internal_templateparser.y" + function yy_r74(){ + $this->yystack[$this->yyidx + -2]->minor[]=$this->yystack[$this->yyidx + 0]->minor; + $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor; + } +#line 2548 "smarty_internal_templateparser.php" +#line 559 "smarty_internal_templateparser.y" + function yy_r75(){ + $this->_retvalue = array('var' => $this->yystack[$this->yyidx + -2]->minor, 'value'=>$this->yystack[$this->yyidx + 0]->minor); + } +#line 2553 "smarty_internal_templateparser.php" +#line 587 "smarty_internal_templateparser.y" + function yy_r80(){ + $this->_retvalue = '$_smarty_tpl->getStreamVariable(\''. $this->yystack[$this->yyidx + -2]->minor .'://'. $this->yystack[$this->yyidx + 0]->minor . '\')'; + } +#line 2558 "smarty_internal_templateparser.php" +#line 592 "smarty_internal_templateparser.y" + function yy_r81(){ + $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor . trim($this->yystack[$this->yyidx + -1]->minor) . $this->yystack[$this->yyidx + 0]->minor; + } +#line 2563 "smarty_internal_templateparser.php" +#line 611 "smarty_internal_templateparser.y" + function yy_r85(){ + $this->_retvalue = $this->compiler->compileTag('private_modifier',array(),array('value'=>$this->yystack[$this->yyidx + -1]->minor,'modifierlist'=>$this->yystack[$this->yyidx + 0]->minor)); + } +#line 2568 "smarty_internal_templateparser.php" +#line 617 "smarty_internal_templateparser.y" + function yy_r86(){ + $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.$this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor; + } +#line 2573 "smarty_internal_templateparser.php" +#line 621 "smarty_internal_templateparser.y" + function yy_r87(){ + $this->_retvalue = 'in_array('.$this->yystack[$this->yyidx + -2]->minor.','.$this->yystack[$this->yyidx + 0]->minor.')'; + } +#line 2578 "smarty_internal_templateparser.php" +#line 625 "smarty_internal_templateparser.y" + function yy_r88(){ + $this->_retvalue = 'in_array('.$this->yystack[$this->yyidx + -2]->minor.',(array)'.$this->yystack[$this->yyidx + 0]->minor.')'; + } +#line 2583 "smarty_internal_templateparser.php" +#line 633 "smarty_internal_templateparser.y" + function yy_r90(){ + $this->_retvalue = '!('.$this->yystack[$this->yyidx + -2]->minor.' % '.$this->yystack[$this->yyidx + 0]->minor.')'; + } +#line 2588 "smarty_internal_templateparser.php" +#line 637 "smarty_internal_templateparser.y" + function yy_r91(){ + $this->_retvalue = '('.$this->yystack[$this->yyidx + -2]->minor.' % '.$this->yystack[$this->yyidx + 0]->minor.')'; + } +#line 2593 "smarty_internal_templateparser.php" +#line 641 "smarty_internal_templateparser.y" + function yy_r92(){ + $this->_retvalue = '!(1 & '.$this->yystack[$this->yyidx + -1]->minor.')'; + } +#line 2598 "smarty_internal_templateparser.php" +#line 645 "smarty_internal_templateparser.y" + function yy_r93(){ + $this->_retvalue = '(1 & '.$this->yystack[$this->yyidx + -1]->minor.')'; + } +#line 2603 "smarty_internal_templateparser.php" +#line 649 "smarty_internal_templateparser.y" + function yy_r94(){ + $this->_retvalue = '!(1 & '.$this->yystack[$this->yyidx + -2]->minor.' / '.$this->yystack[$this->yyidx + 0]->minor.')'; + } +#line 2608 "smarty_internal_templateparser.php" +#line 653 "smarty_internal_templateparser.y" + function yy_r95(){ + $this->_retvalue = '(1 & '.$this->yystack[$this->yyidx + -2]->minor.' / '.$this->yystack[$this->yyidx + 0]->minor.')'; + } +#line 2613 "smarty_internal_templateparser.php" +#line 677 "smarty_internal_templateparser.y" + function yy_r101(){ + self::$prefix_number++; + $this->compiler->prefix_code[] = 'yystack[$this->yyidx + 0]->minor.';?>'; + $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.$this->yystack[$this->yyidx + -1]->minor.'$_tmp'.self::$prefix_number; + } +#line 2620 "smarty_internal_templateparser.php" +#line 686 "smarty_internal_templateparser.y" + function yy_r102(){ + $this->_retvalue = $this->yystack[$this->yyidx + -6]->minor.' ? '. $this->compileVariable("'".$this->yystack[$this->yyidx + -2]->minor."'") . ' : '.$this->yystack[$this->yyidx + 0]->minor; + } +#line 2625 "smarty_internal_templateparser.php" +#line 690 "smarty_internal_templateparser.y" + function yy_r103(){ + $this->_retvalue = $this->yystack[$this->yyidx + -5]->minor.' ? '.$this->yystack[$this->yyidx + -2]->minor.' : '.$this->yystack[$this->yyidx + 0]->minor; + } +#line 2630 "smarty_internal_templateparser.php" +#line 705 "smarty_internal_templateparser.y" + function yy_r106(){ + $this->_retvalue = '!'.$this->yystack[$this->yyidx + 0]->minor; + } +#line 2635 "smarty_internal_templateparser.php" +#line 726 "smarty_internal_templateparser.y" + function yy_r111(){ + $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.'.'.$this->yystack[$this->yyidx + 0]->minor; + } +#line 2640 "smarty_internal_templateparser.php" +#line 730 "smarty_internal_templateparser.y" + function yy_r112(){ + $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor.'.'; + } +#line 2645 "smarty_internal_templateparser.php" +#line 734 "smarty_internal_templateparser.y" + function yy_r113(){ + $this->_retvalue = '.'.$this->yystack[$this->yyidx + 0]->minor; + } +#line 2650 "smarty_internal_templateparser.php" +#line 739 "smarty_internal_templateparser.y" + function yy_r114(){ + if (preg_match('~^true$~i', $this->yystack[$this->yyidx + 0]->minor)) { + $this->_retvalue = 'true'; + } elseif (preg_match('~^false$~i', $this->yystack[$this->yyidx + 0]->minor)) { + $this->_retvalue = 'false'; + } elseif (preg_match('~^null$~i', $this->yystack[$this->yyidx + 0]->minor)) { + $this->_retvalue = 'null'; + } else { + $this->_retvalue = "'".$this->yystack[$this->yyidx + 0]->minor."'"; + } + } +#line 2663 "smarty_internal_templateparser.php" +#line 757 "smarty_internal_templateparser.y" + function yy_r116(){ + $this->_retvalue = "(". $this->yystack[$this->yyidx + -1]->minor .")"; + } +#line 2668 "smarty_internal_templateparser.php" +#line 772 "smarty_internal_templateparser.y" + function yy_r119(){ + if (!$this->security || isset($this->smarty->registered_classes[$this->yystack[$this->yyidx + -2]->minor]) || $this->smarty->security_policy->isTrustedStaticClass($this->yystack[$this->yyidx + -2]->minor, $this->compiler)) { + if (isset($this->smarty->registered_classes[$this->yystack[$this->yyidx + -2]->minor])) { + $this->_retvalue = $this->smarty->registered_classes[$this->yystack[$this->yyidx + -2]->minor].'::'.$this->yystack[$this->yyidx + 0]->minor; + } else { + $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.'::'.$this->yystack[$this->yyidx + 0]->minor; + } + } else { + $this->compiler->trigger_template_error ("static class '".$this->yystack[$this->yyidx + -2]->minor."' is undefined or not allowed by security setting"); + } + } +#line 2681 "smarty_internal_templateparser.php" +#line 784 "smarty_internal_templateparser.y" + function yy_r120(){ + if ($this->yystack[$this->yyidx + -2]->minor['var'] == '\'smarty\'') { + $this->_retvalue = $this->compiler->compileTag('private_special_variable',array(),$this->yystack[$this->yyidx + -2]->minor['smarty_internal_index']).'::'.$this->yystack[$this->yyidx + 0]->minor; + } else { + $this->_retvalue = $this->compileVariable($this->yystack[$this->yyidx + -2]->minor['var']).$this->yystack[$this->yyidx + -2]->minor['smarty_internal_index'].'::'.$this->yystack[$this->yyidx + 0]->minor; + } + } +#line 2690 "smarty_internal_templateparser.php" +#line 793 "smarty_internal_templateparser.y" + function yy_r121(){ + self::$prefix_number++; + $this->compiler->prefix_code[] = ''.$this->yystack[$this->yyidx + -1]->minor.''; + $this->_retvalue = '$_tmp'.self::$prefix_number; + } +#line 2697 "smarty_internal_templateparser.php" +#line 808 "smarty_internal_templateparser.y" + function yy_r123(){ + if ($this->yystack[$this->yyidx + 0]->minor['var'] == '\'smarty\'') { + $smarty_var = $this->compiler->compileTag('private_special_variable',array(),$this->yystack[$this->yyidx + 0]->minor['smarty_internal_index']); + $this->_retvalue = $smarty_var; + } else { + // used for array reset,next,prev,end,current + $this->last_variable = $this->yystack[$this->yyidx + 0]->minor['var']; + $this->last_index = $this->yystack[$this->yyidx + 0]->minor['smarty_internal_index']; + $this->_retvalue = $this->compileVariable($this->yystack[$this->yyidx + 0]->minor['var']).$this->yystack[$this->yyidx + 0]->minor['smarty_internal_index']; + } + } +#line 2710 "smarty_internal_templateparser.php" +#line 821 "smarty_internal_templateparser.y" + function yy_r124(){ + $this->_retvalue = '$_smarty_tpl->tpl_vars['. $this->yystack[$this->yyidx + -2]->minor .']->'.$this->yystack[$this->yyidx + 0]->minor; + } +#line 2715 "smarty_internal_templateparser.php" +#line 831 "smarty_internal_templateparser.y" + function yy_r126(){ + $this->_retvalue = '$_smarty_tpl->getConfigVariable(\''. $this->yystack[$this->yyidx + -1]->minor .'\')'; + } +#line 2720 "smarty_internal_templateparser.php" +#line 835 "smarty_internal_templateparser.y" + function yy_r127(){ + $this->_retvalue = '(is_array($tmp = $_smarty_tpl->getConfigVariable(\''. $this->yystack[$this->yyidx + -2]->minor .'\')) ? $tmp'.$this->yystack[$this->yyidx + 0]->minor.' :null)'; + } +#line 2725 "smarty_internal_templateparser.php" +#line 839 "smarty_internal_templateparser.y" + function yy_r128(){ + $this->_retvalue = '$_smarty_tpl->getConfigVariable('. $this->yystack[$this->yyidx + -1]->minor .')'; + } +#line 2730 "smarty_internal_templateparser.php" +#line 843 "smarty_internal_templateparser.y" + function yy_r129(){ + $this->_retvalue = '(is_array($tmp = $_smarty_tpl->getConfigVariable('. $this->yystack[$this->yyidx + -2]->minor .')) ? $tmp'.$this->yystack[$this->yyidx + 0]->minor.' : null)'; + } +#line 2735 "smarty_internal_templateparser.php" +#line 847 "smarty_internal_templateparser.y" + function yy_r130(){ + $this->_retvalue = array('var'=>$this->yystack[$this->yyidx + -1]->minor, 'smarty_internal_index'=>$this->yystack[$this->yyidx + 0]->minor); + } +#line 2740 "smarty_internal_templateparser.php" +#line 860 "smarty_internal_templateparser.y" + function yy_r132(){ + return; + } +#line 2745 "smarty_internal_templateparser.php" +#line 866 "smarty_internal_templateparser.y" + function yy_r133(){ + $this->_retvalue = '['.$this->compileVariable($this->yystack[$this->yyidx + 0]->minor).']'; + } +#line 2750 "smarty_internal_templateparser.php" +#line 870 "smarty_internal_templateparser.y" + function yy_r134(){ + $this->_retvalue = '['.$this->compileVariable($this->yystack[$this->yyidx + -2]->minor).'->'.$this->yystack[$this->yyidx + 0]->minor.']'; + } +#line 2755 "smarty_internal_templateparser.php" +#line 874 "smarty_internal_templateparser.y" + function yy_r135(){ + $this->_retvalue = "['". $this->yystack[$this->yyidx + 0]->minor ."']"; + } +#line 2760 "smarty_internal_templateparser.php" +#line 878 "smarty_internal_templateparser.y" + function yy_r136(){ + $this->_retvalue = "[". $this->yystack[$this->yyidx + 0]->minor ."]"; + } +#line 2765 "smarty_internal_templateparser.php" +#line 882 "smarty_internal_templateparser.y" + function yy_r137(){ + $this->_retvalue = "[". $this->yystack[$this->yyidx + -1]->minor ."]"; + } +#line 2770 "smarty_internal_templateparser.php" +#line 887 "smarty_internal_templateparser.y" + function yy_r138(){ + $this->_retvalue = '['.$this->compiler->compileTag('private_special_variable',array(),'[\'section\'][\''.$this->yystack[$this->yyidx + -1]->minor.'\'][\'index\']').']'; + } +#line 2775 "smarty_internal_templateparser.php" +#line 891 "smarty_internal_templateparser.y" + function yy_r139(){ + $this->_retvalue = '['.$this->compiler->compileTag('private_special_variable',array(),'[\'section\'][\''.$this->yystack[$this->yyidx + -3]->minor.'\'][\''.$this->yystack[$this->yyidx + -1]->minor.'\']').']'; + } +#line 2780 "smarty_internal_templateparser.php" +#line 901 "smarty_internal_templateparser.y" + function yy_r141(){ + $this->_retvalue = '[]'; + } +#line 2785 "smarty_internal_templateparser.php" +#line 914 "smarty_internal_templateparser.y" + function yy_r143(){ + $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor.'.'.$this->yystack[$this->yyidx + 0]->minor; + } +#line 2790 "smarty_internal_templateparser.php" +#line 919 "smarty_internal_templateparser.y" + function yy_r144(){ + $this->_retvalue = '\''.$this->yystack[$this->yyidx + 0]->minor.'\''; + } +#line 2795 "smarty_internal_templateparser.php" +#line 924 "smarty_internal_templateparser.y" + function yy_r145(){ + $this->_retvalue = '('.$this->yystack[$this->yyidx + -1]->minor.')'; + } +#line 2800 "smarty_internal_templateparser.php" +#line 931 "smarty_internal_templateparser.y" + function yy_r146(){ + if ($this->yystack[$this->yyidx + -1]->minor['var'] == '\'smarty\'') { + $this->_retvalue = $this->compiler->compileTag('private_special_variable',array(),$this->yystack[$this->yyidx + -1]->minor['smarty_internal_index']).$this->yystack[$this->yyidx + 0]->minor; + } else { + $this->_retvalue = $this->compileVariable($this->yystack[$this->yyidx + -1]->minor['var']).$this->yystack[$this->yyidx + -1]->minor['smarty_internal_index'].$this->yystack[$this->yyidx + 0]->minor; + } + } +#line 2809 "smarty_internal_templateparser.php" +#line 940 "smarty_internal_templateparser.y" + function yy_r147(){ + $this->_retvalue = $this->yystack[$this->yyidx + 0]->minor; + } +#line 2814 "smarty_internal_templateparser.php" +#line 945 "smarty_internal_templateparser.y" + function yy_r148(){ + $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor; + } +#line 2819 "smarty_internal_templateparser.php" +#line 950 "smarty_internal_templateparser.y" + function yy_r149(){ + if ($this->security && substr($this->yystack[$this->yyidx + -1]->minor,0,1) == '_') { + $this->compiler->trigger_template_error (self::Err1); + } + $this->_retvalue = '->'.$this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor; + } +#line 2827 "smarty_internal_templateparser.php" +#line 957 "smarty_internal_templateparser.y" + function yy_r150(){ + if ($this->security) { + $this->compiler->trigger_template_error (self::Err2); + } + $this->_retvalue = '->{'.$this->compileVariable($this->yystack[$this->yyidx + -1]->minor).$this->yystack[$this->yyidx + 0]->minor.'}'; + } +#line 2835 "smarty_internal_templateparser.php" +#line 964 "smarty_internal_templateparser.y" + function yy_r151(){ + if ($this->security) { + $this->compiler->trigger_template_error (self::Err2); + } + $this->_retvalue = '->{'.$this->yystack[$this->yyidx + -2]->minor.$this->yystack[$this->yyidx + 0]->minor.'}'; + } +#line 2843 "smarty_internal_templateparser.php" +#line 971 "smarty_internal_templateparser.y" + function yy_r152(){ + if ($this->security) { + $this->compiler->trigger_template_error (self::Err2); + } + $this->_retvalue = '->{\''.$this->yystack[$this->yyidx + -4]->minor.'\'.'.$this->yystack[$this->yyidx + -2]->minor.$this->yystack[$this->yyidx + 0]->minor.'}'; + } +#line 2851 "smarty_internal_templateparser.php" +#line 979 "smarty_internal_templateparser.y" + function yy_r153(){ + $this->_retvalue = '->'.$this->yystack[$this->yyidx + 0]->minor; + } +#line 2856 "smarty_internal_templateparser.php" +#line 987 "smarty_internal_templateparser.y" + function yy_r154(){ + if (!$this->security || $this->smarty->security_policy->isTrustedPhpFunction($this->yystack[$this->yyidx + -3]->minor, $this->compiler)) { + if (strcasecmp($this->yystack[$this->yyidx + -3]->minor,'isset') === 0 || strcasecmp($this->yystack[$this->yyidx + -3]->minor,'empty') === 0 || strcasecmp($this->yystack[$this->yyidx + -3]->minor,'array') === 0 || is_callable($this->yystack[$this->yyidx + -3]->minor)) { + $func_name = strtolower($this->yystack[$this->yyidx + -3]->minor); + if ($func_name == 'isset') { + if (count($this->yystack[$this->yyidx + -1]->minor) == 0) { + $this->compiler->trigger_template_error ('Illegal number of paramer in "isset()"'); + } + $par = implode(',',$this->yystack[$this->yyidx + -1]->minor); + if (strncasecmp($par,'$_smarty_tpl->getConfigVariable',strlen('$_smarty_tpl->getConfigVariable')) === 0) { + self::$prefix_number++; + $this->compiler->prefix_code[] = ''; + $isset_par = '$_tmp'.self::$prefix_number; + } else { + $isset_par=str_replace("')->value","',null,true,false)->value",$par); + } + $this->_retvalue = $this->yystack[$this->yyidx + -3]->minor . "(". $isset_par .")"; + } elseif (in_array($func_name,array('empty','reset','current','end','prev','next'))){ + if (count($this->yystack[$this->yyidx + -1]->minor) != 1) { + $this->compiler->trigger_template_error ('Illegal number of paramer in "empty()"'); + } + if ($func_name == 'empty') { + $this->_retvalue = $func_name.'('.str_replace("')->value","',null,true,false)->value",$this->yystack[$this->yyidx + -1]->minor[0]).')'; + } else { + $this->_retvalue = $func_name.'('.$this->yystack[$this->yyidx + -1]->minor[0].')'; + } + } else { + $this->_retvalue = $this->yystack[$this->yyidx + -3]->minor . "(". implode(',',$this->yystack[$this->yyidx + -1]->minor) .")"; + } + } else { + $this->compiler->trigger_template_error ("unknown function \"" . $this->yystack[$this->yyidx + -3]->minor . "\""); + } + } + } +#line 2892 "smarty_internal_templateparser.php" +#line 1025 "smarty_internal_templateparser.y" + function yy_r155(){ + if ($this->security && substr($this->yystack[$this->yyidx + -3]->minor,0,1) == '_') { + $this->compiler->trigger_template_error (self::Err1); + } + $this->_retvalue = $this->yystack[$this->yyidx + -3]->minor . "(". implode(',',$this->yystack[$this->yyidx + -1]->minor) .")"; + } +#line 2900 "smarty_internal_templateparser.php" +#line 1032 "smarty_internal_templateparser.y" + function yy_r156(){ + if ($this->security) { + $this->compiler->trigger_template_error (self::Err2); + } + self::$prefix_number++; + $this->compiler->prefix_code[] = 'compileVariable("'".$this->yystack[$this->yyidx + -3]->minor."'").';?>'; + $this->_retvalue = '$_tmp'.self::$prefix_number.'('. implode(',',$this->yystack[$this->yyidx + -1]->minor) .')'; + } +#line 2910 "smarty_internal_templateparser.php" +#line 1043 "smarty_internal_templateparser.y" + function yy_r157(){ + $this->_retvalue = array_merge($this->yystack[$this->yyidx + -2]->minor,array($this->yystack[$this->yyidx + 0]->minor)); + } +#line 2915 "smarty_internal_templateparser.php" +#line 1060 "smarty_internal_templateparser.y" + function yy_r160(){ + $this->_retvalue = array_merge($this->yystack[$this->yyidx + -2]->minor,array(array_merge($this->yystack[$this->yyidx + -1]->minor,$this->yystack[$this->yyidx + 0]->minor))); + } +#line 2920 "smarty_internal_templateparser.php" +#line 1064 "smarty_internal_templateparser.y" + function yy_r161(){ + $this->_retvalue = array(array_merge($this->yystack[$this->yyidx + -1]->minor,$this->yystack[$this->yyidx + 0]->minor)); + } +#line 2925 "smarty_internal_templateparser.php" +#line 1072 "smarty_internal_templateparser.y" + function yy_r163(){ + $this->_retvalue = array($this->yystack[$this->yyidx + 0]->minor); + } +#line 2930 "smarty_internal_templateparser.php" +#line 1080 "smarty_internal_templateparser.y" + function yy_r164(){ + $this->_retvalue = array_merge($this->yystack[$this->yyidx + -1]->minor,$this->yystack[$this->yyidx + 0]->minor); + } +#line 2935 "smarty_internal_templateparser.php" +#line 1114 "smarty_internal_templateparser.y" + function yy_r171(){ + $this->_retvalue = '$'.$this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor; + } +#line 2940 "smarty_internal_templateparser.php" +#line 1119 "smarty_internal_templateparser.y" + function yy_r172(){ + $this->_retvalue = '$'.$this->yystack[$this->yyidx + -2]->minor.$this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor; + } +#line 2945 "smarty_internal_templateparser.php" +#line 1125 "smarty_internal_templateparser.y" + function yy_r173(){ + $this->_retvalue = '=='; + } +#line 2950 "smarty_internal_templateparser.php" +#line 1129 "smarty_internal_templateparser.y" + function yy_r174(){ + $this->_retvalue = '!='; + } +#line 2955 "smarty_internal_templateparser.php" +#line 1133 "smarty_internal_templateparser.y" + function yy_r175(){ + $this->_retvalue = '>'; + } +#line 2960 "smarty_internal_templateparser.php" +#line 1137 "smarty_internal_templateparser.y" + function yy_r176(){ + $this->_retvalue = '<'; + } +#line 2965 "smarty_internal_templateparser.php" +#line 1141 "smarty_internal_templateparser.y" + function yy_r177(){ + $this->_retvalue = '>='; + } +#line 2970 "smarty_internal_templateparser.php" +#line 1145 "smarty_internal_templateparser.y" + function yy_r178(){ + $this->_retvalue = '<='; + } +#line 2975 "smarty_internal_templateparser.php" +#line 1149 "smarty_internal_templateparser.y" + function yy_r179(){ + $this->_retvalue = '==='; + } +#line 2980 "smarty_internal_templateparser.php" +#line 1153 "smarty_internal_templateparser.y" + function yy_r180(){ + $this->_retvalue = '!=='; + } +#line 2985 "smarty_internal_templateparser.php" +#line 1157 "smarty_internal_templateparser.y" + function yy_r181(){ + $this->_retvalue = '%'; + } +#line 2990 "smarty_internal_templateparser.php" +#line 1161 "smarty_internal_templateparser.y" + function yy_r182(){ + $this->_retvalue = '&&'; + } +#line 2995 "smarty_internal_templateparser.php" +#line 1165 "smarty_internal_templateparser.y" + function yy_r183(){ + $this->_retvalue = '||'; + } +#line 3000 "smarty_internal_templateparser.php" +#line 1169 "smarty_internal_templateparser.y" + function yy_r184(){ + $this->_retvalue = ' XOR '; + } +#line 3005 "smarty_internal_templateparser.php" +#line 1176 "smarty_internal_templateparser.y" + function yy_r185(){ + $this->_retvalue = 'array('.$this->yystack[$this->yyidx + -1]->minor.')'; + } +#line 3010 "smarty_internal_templateparser.php" +#line 1184 "smarty_internal_templateparser.y" + function yy_r187(){ + $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.','.$this->yystack[$this->yyidx + 0]->minor; + } +#line 3015 "smarty_internal_templateparser.php" +#line 1192 "smarty_internal_templateparser.y" + function yy_r189(){ + $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.'=>'.$this->yystack[$this->yyidx + 0]->minor; + } +#line 3020 "smarty_internal_templateparser.php" +#line 1196 "smarty_internal_templateparser.y" + function yy_r190(){ + $this->_retvalue = '\''.$this->yystack[$this->yyidx + -2]->minor.'\'=>'.$this->yystack[$this->yyidx + 0]->minor; + } +#line 3025 "smarty_internal_templateparser.php" +#line 1208 "smarty_internal_templateparser.y" + function yy_r192(){ + $this->_retvalue = "''"; + } +#line 3030 "smarty_internal_templateparser.php" +#line 1212 "smarty_internal_templateparser.y" + function yy_r193(){ + $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor->to_smarty_php(); + } +#line 3035 "smarty_internal_templateparser.php" +#line 1217 "smarty_internal_templateparser.y" + function yy_r194(){ + $this->yystack[$this->yyidx + -1]->minor->append_subtree($this->yystack[$this->yyidx + 0]->minor); + $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor; + } +#line 3041 "smarty_internal_templateparser.php" +#line 1222 "smarty_internal_templateparser.y" + function yy_r195(){ + $this->_retvalue = new _smarty_doublequoted($this, $this->yystack[$this->yyidx + 0]->minor); + } +#line 3046 "smarty_internal_templateparser.php" +#line 1226 "smarty_internal_templateparser.y" + function yy_r196(){ + $this->_retvalue = new _smarty_code($this, '(string)'.$this->yystack[$this->yyidx + -1]->minor); + } +#line 3051 "smarty_internal_templateparser.php" +#line 1234 "smarty_internal_templateparser.y" + function yy_r198(){ + $this->_retvalue = new _smarty_code($this, '(string)$_smarty_tpl->tpl_vars[\''. substr($this->yystack[$this->yyidx + 0]->minor,1) .'\']->value'); + } +#line 3056 "smarty_internal_templateparser.php" +#line 1242 "smarty_internal_templateparser.y" + function yy_r200(){ + $this->_retvalue = new _smarty_code($this, '(string)('.$this->yystack[$this->yyidx + -1]->minor.')'); + } +#line 3061 "smarty_internal_templateparser.php" +#line 1246 "smarty_internal_templateparser.y" + function yy_r201(){ + $this->_retvalue = new _smarty_tag($this, $this->yystack[$this->yyidx + -1]->minor); + } +#line 3066 "smarty_internal_templateparser.php" +#line 1250 "smarty_internal_templateparser.y" + function yy_r202(){ + $this->_retvalue = new _smarty_dq_content($this, $this->yystack[$this->yyidx + 0]->minor); + } +#line 3071 "smarty_internal_templateparser.php" + + private $_retvalue; + + public function yy_reduce($yyruleno) + { + $yymsp = $this->yystack[$this->yyidx]; + if (self::$yyTraceFILE && $yyruleno >= 0 + && $yyruleno < count(self::$yyRuleName)) { + fprintf(self::$yyTraceFILE, "%sReduce (%d) [%s].\n", + self::$yyTracePrompt, $yyruleno, + self::$yyRuleName[$yyruleno]); + } + + $this->_retvalue = $yy_lefthand_side = null; + if (array_key_exists($yyruleno, self::$yyReduceMap)) { + // call the action + $this->_retvalue = null; + $this->{'yy_r' . self::$yyReduceMap[$yyruleno]}(); + $yy_lefthand_side = $this->_retvalue; + } + $yygoto = self::$yyRuleInfo[$yyruleno]['lhs']; + $yysize = self::$yyRuleInfo[$yyruleno]['rhs']; + $this->yyidx -= $yysize; + for ($i = $yysize; $i; $i--) { + // pop all of the right-hand side parameters + array_pop($this->yystack); + } + $yyact = $this->yy_find_reduce_action($this->yystack[$this->yyidx]->stateno, $yygoto); + if ($yyact < self::YYNSTATE) { + if (!self::$yyTraceFILE && $yysize) { + $this->yyidx++; + $x = new TP_yyStackEntry; + $x->stateno = $yyact; + $x->major = $yygoto; + $x->minor = $yy_lefthand_side; + $this->yystack[$this->yyidx] = $x; + } else { + $this->yy_shift($yyact, $yygoto, $yy_lefthand_side); + } + } elseif ($yyact == self::YYNSTATE + self::YYNRULE + 1) { + $this->yy_accept(); + } + } + + public function yy_parse_failed() + { + if (self::$yyTraceFILE) { + fprintf(self::$yyTraceFILE, "%sFail!\n", self::$yyTracePrompt); + } while ($this->yyidx >= 0) { + $this->yy_pop_parser_stack(); + } + } + + public function yy_syntax_error($yymajor, $TOKEN) + { +#line 78 "smarty_internal_templateparser.y" + + $this->internalError = true; + $this->yymajor = $yymajor; + $this->compiler->trigger_template_error(); +#line 3133 "smarty_internal_templateparser.php" + } + + public function yy_accept() + { + if (self::$yyTraceFILE) { + fprintf(self::$yyTraceFILE, "%sAccept!\n", self::$yyTracePrompt); + } while ($this->yyidx >= 0) { + $stack = $this->yy_pop_parser_stack(); + } +#line 70 "smarty_internal_templateparser.y" + + $this->successful = !$this->internalError; + $this->internalError = false; + $this->retvalue = $this->_retvalue; + //echo $this->retvalue."\n\n"; +#line 3150 "smarty_internal_templateparser.php" + } + + public function doParse($yymajor, $yytokenvalue) + { + $yyerrorhit = 0; /* True if yymajor has invoked an error */ + + if ($this->yyidx === null || $this->yyidx < 0) { + $this->yyidx = 0; + $this->yyerrcnt = -1; + $x = new TP_yyStackEntry; + $x->stateno = 0; + $x->major = 0; + $this->yystack = array(); + array_push($this->yystack, $x); + } + $yyendofinput = ($yymajor==0); + + if (self::$yyTraceFILE) { + fprintf(self::$yyTraceFILE, "%sInput %s\n", + self::$yyTracePrompt, $this->yyTokenName[$yymajor]); + } + + do { + $yyact = $this->yy_find_shift_action($yymajor); + if ($yymajor < self::YYERRORSYMBOL && + !$this->yy_is_expected_token($yymajor)) { + // force a syntax error + $yyact = self::YY_ERROR_ACTION; + } + if ($yyact < self::YYNSTATE) { + $this->yy_shift($yyact, $yymajor, $yytokenvalue); + $this->yyerrcnt--; + if ($yyendofinput && $this->yyidx >= 0) { + $yymajor = 0; + } else { + $yymajor = self::YYNOCODE; + } + } elseif ($yyact < self::YYNSTATE + self::YYNRULE) { + $this->yy_reduce($yyact - self::YYNSTATE); + } elseif ($yyact == self::YY_ERROR_ACTION) { + if (self::$yyTraceFILE) { + fprintf(self::$yyTraceFILE, "%sSyntax Error!\n", + self::$yyTracePrompt); + } + if (self::YYERRORSYMBOL) { + if ($this->yyerrcnt < 0) { + $this->yy_syntax_error($yymajor, $yytokenvalue); + } + $yymx = $this->yystack[$this->yyidx]->major; + if ($yymx == self::YYERRORSYMBOL || $yyerrorhit) { + if (self::$yyTraceFILE) { + fprintf(self::$yyTraceFILE, "%sDiscard input token %s\n", + self::$yyTracePrompt, $this->yyTokenName[$yymajor]); + } + $this->yy_destructor($yymajor, $yytokenvalue); + $yymajor = self::YYNOCODE; + } else { + while ($this->yyidx >= 0 && + $yymx != self::YYERRORSYMBOL && + ($yyact = $this->yy_find_shift_action(self::YYERRORSYMBOL)) >= self::YYNSTATE + ){ + $this->yy_pop_parser_stack(); + } + if ($this->yyidx < 0 || $yymajor==0) { + $this->yy_destructor($yymajor, $yytokenvalue); + $this->yy_parse_failed(); + $yymajor = self::YYNOCODE; + } elseif ($yymx != self::YYERRORSYMBOL) { + $u2 = 0; + $this->yy_shift($yyact, self::YYERRORSYMBOL, $u2); + } + } + $this->yyerrcnt = 3; + $yyerrorhit = 1; + } else { + if ($this->yyerrcnt <= 0) { + $this->yy_syntax_error($yymajor, $yytokenvalue); + } + $this->yyerrcnt = 3; + $this->yy_destructor($yymajor, $yytokenvalue); + if ($yyendofinput) { + $this->yy_parse_failed(); + } + $yymajor = self::YYNOCODE; + } + } else { + $this->yy_accept(); + $yymajor = self::YYNOCODE; + } + } while ($yymajor != self::YYNOCODE && $this->yyidx >= 0); + } +} \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_utility.php b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_utility.php similarity index 95% rename from lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_utility.php rename to lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_utility.php index 0bec8db1..140fdaf7 100644 --- a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_utility.php +++ b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_utility.php @@ -31,19 +31,18 @@ * @version 3-SVN$Rev: 3286 $ */ - /** * Utility class * * @package Smarty * @subpackage Security */ -class Smarty_Internal_Utility { - +class Smarty_Internal_Utility +{ /** * private constructor to prevent calls creation of new instances */ - private final function __construct() + final private function __construct() { // intentionally left blank } @@ -51,11 +50,11 @@ class Smarty_Internal_Utility { /** * Compile all template files * - * @param string $extension template file name extension - * @param bool $force_compile force all to recompile - * @param int $time_limit set maximum execution time - * @param int $max_errors set maximum allowed errors - * @param Smarty $smarty Smarty instance + * @param string $extension template file name extension + * @param bool $force_compile force all to recompile + * @param int $time_limit set maximum execution time + * @param int $max_errors set maximum allowed errors + * @param Smarty $smarty Smarty instance * @return integer number of template files compiled */ public static function compileAllTemplates($extension, $force_compile, $time_limit, $max_errors, Smarty $smarty) @@ -68,7 +67,7 @@ class Smarty_Internal_Utility { $_count = 0; $_error_count = 0; // loop over array of template directories - foreach($smarty->getTemplateDir() as $_dir) { + foreach ($smarty->getTemplateDir() as $_dir) { $_compileDirs = new RecursiveDirectoryIterator($_dir); $_compile = new RecursiveIteratorIterator($_compileDirs); foreach ($_compile as $_fileinfo) { @@ -94,8 +93,7 @@ class Smarty_Internal_Utility { echo ' is up to date'; flush(); } - } - catch (Exception $e) { + } catch (Exception $e) { echo 'Error: ', $e->getMessage(), ""; $_error_count++; } @@ -109,17 +107,18 @@ class Smarty_Internal_Utility { } } } + return $_count; } /** * Compile all config files * - * @param string $extension config file name extension - * @param bool $force_compile force all to recompile - * @param int $time_limit set maximum execution time - * @param int $max_errors set maximum allowed errors - * @param Smarty $smarty Smarty instance + * @param string $extension config file name extension + * @param bool $force_compile force all to recompile + * @param int $time_limit set maximum execution time + * @param int $max_errors set maximum allowed errors + * @param Smarty $smarty Smarty instance * @return integer number of config files compiled */ public static function compileAllConfig($extension, $force_compile, $time_limit, $max_errors, Smarty $smarty) @@ -132,7 +131,7 @@ class Smarty_Internal_Utility { $_count = 0; $_error_count = 0; // loop over array of template directories - foreach($smarty->getConfigDir() as $_dir) { + foreach ($smarty->getConfigDir() as $_dir) { $_compileDirs = new RecursiveDirectoryIterator($_dir); $_compile = new RecursiveIteratorIterator($_compileDirs); foreach ($_compile as $_fileinfo) { @@ -158,8 +157,7 @@ class Smarty_Internal_Utility { echo ' is up to date'; flush(); } - } - catch (Exception $e) { + } catch (Exception $e) { echo 'Error: ', $e->getMessage(), ""; $_error_count++; } @@ -169,16 +167,17 @@ class Smarty_Internal_Utility { } } } + return $_count; } /** * Delete compiled template file * - * @param string $resource_name template name - * @param string $compile_id compile id - * @param integer $exp_time expiration time - * @param Smarty $smarty Smarty instance + * @param string $resource_name template name + * @param string $compile_id compile id + * @param integer $exp_time expiration time + * @param Smarty $smarty Smarty instance * @return integer number of template files deleted */ public static function clearCompiledTemplate($resource_name, $compile_id, $exp_time, Smarty $smarty) @@ -266,31 +265,32 @@ class Smarty_Internal_Utility { // clear compiled cache Smarty_Resource::$sources = array(); Smarty_Resource::$compileds = array(); + return $_count; } /** * Return array of tag/attributes of all tags used by an template * - * @param Smarty_Internal_Template $templae template object - * @return array of tag/attributes + * @param Smarty_Internal_Template $templae template object + * @return array of tag/attributes */ public static function getTags(Smarty_Internal_Template $template) { $template->smarty->get_used_tags = true; $template->compileTemplateSource(); + return $template->used_tags; } - /** * diagnose Smarty setup * * If $errors is secified, the diagnostic report will be appended to the array, rather than being output. * - * @param Smarty $smarty Smarty instance to test - * @param array $errors array to push results into rather than outputting them - * @return bool status, true if everything is fine, false else + * @param Smarty $smarty Smarty instance to test + * @param array $errors array to push results into rather than outputting them + * @return bool status, true if everything is fine, false else */ public static function testInstall(Smarty $smarty, &$errors=null) { @@ -305,7 +305,7 @@ class Smarty_Internal_Utility { $_stream_resolve_include_path = function_exists('stream_resolve_include_path'); // test if all registered template_dir are accessible - foreach($smarty->getTemplateDir() as $template_dir) { + foreach ($smarty->getTemplateDir() as $template_dir) { $_template_dir = $template_dir; $template_dir = realpath($template_dir); // resolve include_path or fail existence @@ -371,7 +371,6 @@ class Smarty_Internal_Utility { } } - if ($errors === null) { echo "Testing compile directory...\n"; } @@ -417,7 +416,6 @@ class Smarty_Internal_Utility { } } - if ($errors === null) { echo "Testing plugins directory...\n"; } @@ -426,7 +424,7 @@ class Smarty_Internal_Utility { // and if core plugins directory is still registered $_core_plugins_dir = realpath(dirname(__FILE__) .'/../plugins'); $_core_plugins_available = false; - foreach($smarty->getPluginsDir() as $plugin_dir) { + foreach ($smarty->getPluginsDir() as $plugin_dir) { $_plugin_dir = $plugin_dir; $plugin_dir = realpath($plugin_dir); // resolve include_path or fail existence @@ -510,7 +508,6 @@ class Smarty_Internal_Utility { echo "Testing cache directory...\n"; } - // test if all registered cache_dir is accessible $__cache_dir = $smarty->getCacheDir(); $_cache_dir = realpath($__cache_dir); @@ -552,13 +549,12 @@ class Smarty_Internal_Utility { } } - if ($errors === null) { echo "Testing configs directory...\n"; } // test if all registered config_dir are accessible - foreach($smarty->getConfigDir() as $config_dir) { + foreach ($smarty->getConfigDir() as $config_dir) { $_config_dir = $config_dir; $config_dir = realpath($config_dir); // resolve include_path or fail existence @@ -624,7 +620,6 @@ class Smarty_Internal_Utility { } } - if ($errors === null) { echo "Testing sysplugin files...\n"; } @@ -826,5 +821,3 @@ class Smarty_Internal_Utility { } } - -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_write_file.php b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_write_file.php similarity index 92% rename from lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_write_file.php rename to lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_write_file.php index e5d19ce8..a62fa947 100644 --- a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_internal_write_file.php +++ b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_internal_write_file.php @@ -13,14 +13,14 @@ * @package Smarty * @subpackage PluginsInternal */ -class Smarty_Internal_Write_File { - +class Smarty_Internal_Write_File +{ /** * Writes file in a safe way to disk * - * @param string $_filepath complete filepath - * @param string $_contents file content - * @param Smarty $smarty smarty instance + * @param string $_filepath complete filepath + * @param string $_contents file content + * @param Smarty $smarty smarty instance * @return boolean true */ public static function writeFile($_filepath, $_contents, Smarty $smarty) @@ -42,13 +42,14 @@ class Smarty_Internal_Write_File { if (!file_put_contents($_tmp_file, $_contents)) { error_reporting($_error_reporting); throw new SmartyException("unable to write file {$_tmp_file}"); + return false; } - + /* * Windows' rename() fails if the destination exists, * Linux' rename() properly handles the overwrite. - * Simply unlink()ing a file might cause other processes + * Simply unlink()ing a file might cause other processes * currently reading that file to fail, but linux' rename() * seems to be smart enough to handle that for us. */ @@ -71,6 +72,7 @@ class Smarty_Internal_Write_File { if (!$success) { error_reporting($_error_reporting); throw new SmartyException("unable to write file {$_filepath}"); + return false; } @@ -80,9 +82,8 @@ class Smarty_Internal_Write_File { umask($old_umask); } error_reporting($_error_reporting); + return true; } } - -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_resource.php b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_resource.php similarity index 86% rename from lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_resource.php rename to lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_resource.php index 0a563dfc..0cb4ce0b 100644 --- a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_resource.php +++ b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_resource.php @@ -15,7 +15,8 @@ * @package Smarty * @subpackage TemplateResources */ -abstract class Smarty_Resource { +abstract class Smarty_Resource +{ /** * cache for Smarty_Template_Source instances * @var array @@ -67,19 +68,19 @@ abstract class Smarty_Resource { * * {@internal The loaded source is assigned to $_template->source->content directly.}} * - * @param Smarty_Template_Source $source source object - * @return string template source - * @throws SmartyException if source cannot be loaded + * @param Smarty_Template_Source $source source object + * @return string template source + * @throws SmartyException if source cannot be loaded */ - public abstract function getContent(Smarty_Template_Source $source); + abstract public function getContent(Smarty_Template_Source $source); /** * populate Source Object with meta data from Resource * - * @param Smarty_Template_Source $source source object - * @param Smarty_Internal_Template $_template template object + * @param Smarty_Template_Source $source source object + * @param Smarty_Internal_Template $_template template object */ - public abstract function populate(Smarty_Template_Source $source, Smarty_Internal_Template $_template=null); + abstract public function populate(Smarty_Template_Source $source, Smarty_Internal_Template $_template=null); /** * populate Source Object with timestamp and exists from Resource @@ -91,17 +92,21 @@ abstract class Smarty_Resource { // intentionally left blank } - /** * modify resource_name according to resource handlers specifications * - * @param Smarty $smarty Smarty instance - * @param string $resource_name resource_name to make unique + * @param Smarty $smarty Smarty instance + * @param string $resource_name resource_name to make unique + * @param boolean $is_config flag for config resource * @return string unique resource name */ - protected function buildUniqueResourceName(Smarty $smarty, $resource_name) + protected function buildUniqueResourceName(Smarty $smarty, $resource_name, $is_config = false) { - return get_class($this) . '#' . $smarty->joined_template_dir . '#' . $resource_name; + if ($is_config) { + return get_class($this) . '#' . $smarty->joined_config_dir . '#' . $resource_name; + } else { + return get_class($this) . '#' . $smarty->joined_template_dir . '#' . $resource_name; + } } /** @@ -144,13 +149,13 @@ abstract class Smarty_Resource { $compiled->filepath = $_compile_dir . $_filepath . '.' . $compiled->source->type . $_basename . $_cache . '.php'; } - + /** - * Normalize Paths "foo/../bar" to "bar" + * Normalize Paths "foo/../bar" to "bar" * - * @param string $_path path to normalize - * @param boolean $ds respect windows directory separator - * @return string normalized path + * @param string $_path path to normalize + * @param boolean $ds respect windows directory separator + * @return string normalized path */ protected function normalizePath($_path, $ds=true) { @@ -158,45 +163,45 @@ abstract class Smarty_Resource { // don't we all just love windows? $_path = str_replace('\\', '/', $_path); } - + $offset = 0; - + // resolve simples - $_path = preg_replace('#(/\./(\./)*)|/{2,}#', '/', $_path); + $_path = preg_replace('#/\./(\./)*#', '/', $_path); // resolve parents while (true) { $_parent = strpos($_path, '/../', $offset); if (!$_parent) { break; - } else if ($_path[$_parent - 1] === '.') { + } elseif ($_path[$_parent - 1] === '.') { $offset = $_parent + 3; continue; } - + $_pos = strrpos($_path, '/', $_parent - strlen($_path) - 1); if ($_pos === false) { // don't we all just love windows? $_pos = $_parent; } - + $_path = substr_replace($_path, '', $_pos, $_parent + 3 - $_pos); } - + if ($ds && DS != '/') { // don't we all just love windows? $_path = str_replace('/', '\\', $_path); } - + return $_path; } - + /** * build template filepath by traversing the template_dir array * - * @param Smarty_Template_Source $source source object - * @param Smarty_Internal_Template $_template template object - * @return string fully qualified filepath - * @throws SmartyException if default template handler is registered but not callable + * @param Smarty_Template_Source $source source object + * @param Smarty_Internal_Template $_template template object + * @return string fully qualified filepath + * @throws SmartyException if default template handler is registered but not callable */ protected function buildFilepath(Smarty_Template_Source $source, Smarty_Internal_Template $_template=null) { @@ -258,7 +263,7 @@ abstract class Smarty_Resource { // try string indexes if (isset($_directories[$match['key']])) { $_directory = $_directories[$match['key']]; - } else if (is_numeric($match['key'])) { + } elseif (is_numeric($match['key'])) { // try numeric index $match['key'] = (int) $match['key']; if (isset($_directories[$match['key']])) { @@ -324,11 +329,13 @@ abstract class Smarty_Resource { if (is_string($_return)) { $source->timestamp = @filemtime($_return); $source->exists = !!$source->timestamp; + return $_return; } elseif ($_return === true) { $source->content = $_content; $source->timestamp = $_timestamp; $source->exists = true; + return $_filepath; } } @@ -340,13 +347,14 @@ abstract class Smarty_Resource { /** * test is file exists and save timestamp * - * @param Smarty_Template_Source $source source object - * @param string $file file name - * @return bool true if file exists + * @param Smarty_Template_Source $source source object + * @param string $file file name + * @return bool true if file exists */ protected function fileExists(Smarty_Template_Source $source, $file) { - $source->timestamp = @filemtime($file); + $source->timestamp = is_file($file) ? @filemtime($file) : false; + return $source->exists = !!$source->timestamp; } @@ -354,8 +362,8 @@ abstract class Smarty_Resource { /** * Determine basename for compiled filename * - * @param Smarty_Template_Source $source source object - * @return string resource's basename + * @param Smarty_Template_Source $source source object + * @return string resource's basename */ protected function getBasename(Smarty_Template_Source $source) { @@ -365,8 +373,8 @@ abstract class Smarty_Resource { /** * Load Resource Handler * - * @param Smarty $smarty smarty object - * @param string $type name of the resource + * @param Smarty $smarty smarty object + * @param string $type name of the resource * @return Smarty_Resource Resource Handler */ public static function load(Smarty $smarty, $type) @@ -400,6 +408,7 @@ abstract class Smarty_Resource { $_resource_class = 'Smarty_Internal_Resource_' . ucfirst($type); self::$resources[$type] = new $_resource_class(); } + return $smarty->_resource_handlers[$type] = self::$resources[$type]; } @@ -412,6 +421,7 @@ abstract class Smarty_Resource { if (class_exists($_resource_class, false)) { self::$resources[$type] = new $_resource_class(); + return $smarty->_resource_handlers[$type] = self::$resources[$type]; } else { $smarty->registerResource($type, array( @@ -436,6 +446,7 @@ abstract class Smarty_Resource { if (!isset(self::$resources['stream'])) { self::$resources['stream'] = new Smarty_Internal_Resource_Stream(); } + return $smarty->_resource_handlers[$type] = self::$resources['stream']; } @@ -449,10 +460,10 @@ abstract class Smarty_Resource { * extract resource_type and resource_name from template_resource and config_resource * * @note "C:/foo.tpl" was forced to file resource up till Smarty 3.1.3 (including). - * @param string $resource_name template_resource or config_resource to parse - * @param string $default_resource the default resource_type defined in $smarty - * @param string &$name the parsed resource name - * @param string &$type the parsed resource type + * @param string $resource_name template_resource or config_resource to parse + * @param string $default_resource the default resource_type defined in $smarty + * @param string &$name the parsed resource name + * @param string &$type the parsed resource type * @return void */ protected static function parseResourceName($resource_name, $default_resource, &$name, &$type) @@ -469,20 +480,19 @@ abstract class Smarty_Resource { } } - /** * modify resource_name according to resource handlers specifications * - * @param Smarty $smarty Smarty instance - * @param string $resource_name resource_name to make unique + * @param Smarty $smarty Smarty instance + * @param string $resource_name resource_name to make unique * @return string unique resource name */ /** * modify template_resource according to resource handlers specifications * - * @param string $smarty Smarty instance - * @param string $template_resource template_resource to extracate resource handler and name of + * @param string $smarty Smarty instance + * @param string $template_resource template_resource to extracate resource handler and name of * @return string unique resource name */ public static function getUniqueTemplateName($smarty, $template_resource) @@ -490,6 +500,7 @@ abstract class Smarty_Resource { self::parseResourceName($template_resource, $smarty->default_resource_type, $name, $type); // TODO: optimize for Smarty's internal resource types $resource = Smarty_Resource::load($smarty, $type); + return $resource->buildUniqueResourceName($smarty, $name); } @@ -498,10 +509,10 @@ abstract class Smarty_Resource { * * Either [$_template] or [$smarty, $template_resource] must be specified * - * @param Smarty_Internal_Template $_template template object - * @param Smarty $smarty smarty object - * @param string $template_resource resource identifier - * @return Smarty_Template_Source Source Object + * @param Smarty_Internal_Template $_template template object + * @param Smarty $smarty smarty object + * @param string $template_resource resource identifier + * @return Smarty_Template_Source Source Object */ public static function source(Smarty_Internal_Template $_template=null, Smarty $smarty=null, $template_resource=null) { @@ -530,14 +541,15 @@ abstract class Smarty_Resource { // runtime cache self::$sources[$_cache_key] = $source; + return $source; } /** * initialize Config Source Object for given resource * - * @param Smarty_Internal_Config $_config config object - * @return Smarty_Config_Source Source Object + * @param Smarty_Internal_Config $_config config object + * @return Smarty_Config_Source Source Object */ public static function config(Smarty_Internal_Config $_config) { @@ -555,7 +567,7 @@ abstract class Smarty_Resource { // load resource handler, identify unique resource name $resource = Smarty_Resource::load($smarty, $type); - $unique_resource_name = $resource->buildUniqueResourceName($smarty, $name); + $unique_resource_name = $resource->buildUniqueResourceName($smarty, $name, true); // check runtime cache $_cache_key = 'config|' . $unique_resource_name; @@ -569,6 +581,7 @@ abstract class Smarty_Resource { // runtime cache self::$sources[$_cache_key] = $source; + return $source; } @@ -588,8 +601,8 @@ abstract class Smarty_Resource { * @property boolean $template Extended Template reference * @property string $content Source Content */ -class Smarty_Template_Source { - +class Smarty_Template_Source +{ /** * Name of the Class to compile this resource's contents with * @var string @@ -677,12 +690,12 @@ class Smarty_Template_Source { /** * create Source Object container * - * @param Smarty_Resource $handler Resource Handler this source object communicates with - * @param Smarty $smarty Smarty instance this source object belongs to - * @param string $resource full template_resource - * @param string $type type of resource - * @param string $name resource name - * @param string $unique_resource unqiue resource name + * @param Smarty_Resource $handler Resource Handler this source object communicates with + * @param Smarty $smarty Smarty instance this source object belongs to + * @param string $resource full template_resource + * @param string $type type of resource + * @param string $name resource name + * @param string $unique_resource unqiue resource name */ public function __construct(Smarty_Resource $handler, Smarty $smarty, $resource, $type, $name, $unique_resource) { @@ -704,7 +717,7 @@ class Smarty_Template_Source { /** * get a Compiled Object of this source * - * @param Smarty_Internal_Template $_template template objet + * @param Smarty_Internal_Template $_template template objet * @return Smarty_Template_Compiled compiled object */ public function getCompiled(Smarty_Internal_Template $_template) @@ -739,8 +752,8 @@ class Smarty_Template_Source { /** * <> Generic Setter. * - * @param string $property_name valid: timestamp, exists, content, template - * @param mixed $value new value (is not checked) + * @param string $property_name valid: timestamp, exists, content, template + * @param mixed $value new value (is not checked) * @throws SmartyException if $property_name is not valid */ public function __set($property_name, $value) @@ -763,7 +776,7 @@ class Smarty_Template_Source { /** * <> Generic getter. * - * @param string $property_name valid: timestamp, exists, content + * @param string $property_name valid: timestamp, exists, content * @return mixed * @throws SmartyException if $property_name is not valid */ @@ -773,6 +786,7 @@ class Smarty_Template_Source { case 'timestamp': case 'exists': $this->handler->populateTimestamp($this); + return $this->$property_name; case 'content': @@ -796,8 +810,8 @@ class Smarty_Template_Source { * * @property string $content compiled content */ -class Smarty_Template_Compiled { - +class Smarty_Template_Compiled +{ /** * Compiled Filepath * @var string @@ -853,5 +867,3 @@ class Smarty_Template_Compiled { } } - -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_resource_custom.php b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_resource_custom.php similarity index 83% rename from lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_resource_custom.php rename to lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_resource_custom.php index 9ec1f356..bf5c4ea6 100644 --- a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_resource_custom.php +++ b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_resource_custom.php @@ -15,8 +15,8 @@ * @package Smarty * @subpackage TemplateResources */ -abstract class Smarty_Resource_Custom extends Smarty_Resource { - +abstract class Smarty_Resource_Custom extends Smarty_Resource +{ /** * fetch template and its modification time from data source * @@ -24,7 +24,7 @@ abstract class Smarty_Resource_Custom extends Smarty_Resource { * @param string &$source template source * @param integer &$mtime template modification timestamp (epoch) */ - protected abstract function fetch($name, &$source, &$mtime); + abstract protected function fetch($name, &$source, &$mtime); /** * Fetch template's modification timestamp from data source @@ -32,7 +32,7 @@ abstract class Smarty_Resource_Custom extends Smarty_Resource { * {@internal implementing this method is optional. * Only implement it if modification times can be accessed faster than loading the complete template source.}} * - * @param string $name template name + * @param string $name template name * @return integer|boolean timestamp (epoch) the template was modified, or false if not found */ protected function fetchTimestamp($name) @@ -66,9 +66,9 @@ abstract class Smarty_Resource_Custom extends Smarty_Resource { /** * Load template's source into current template object * - * @param Smarty_Template_Source $source source object - * @return string template source - * @throws SmartyException if source cannot be loaded + * @param Smarty_Template_Source $source source object + * @return string template source + * @throws SmartyException if source cannot be loaded */ public function getContent(Smarty_Template_Source $source) { @@ -83,8 +83,8 @@ abstract class Smarty_Resource_Custom extends Smarty_Resource { /** * Determine basename for compiled filename * - * @param Smarty_Template_Source $source source object - * @return string resource's basename + * @param Smarty_Template_Source $source source object + * @return string resource's basename */ protected function getBasename(Smarty_Template_Source $source) { @@ -92,5 +92,3 @@ abstract class Smarty_Resource_Custom extends Smarty_Resource { } } - -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_resource_recompiled.php b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_resource_recompiled.php similarity index 83% rename from lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_resource_recompiled.php rename to lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_resource_recompiled.php index ab55b93a..06581389 100644 --- a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_resource_recompiled.php +++ b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_resource_recompiled.php @@ -15,13 +15,13 @@ * @package Smarty * @subpackage TemplateResources */ -abstract class Smarty_Resource_Recompiled extends Smarty_Resource { - +abstract class Smarty_Resource_Recompiled extends Smarty_Resource +{ /** * populate Compiled Object with compiled filepath * - * @param Smarty_Template_Compiled $compiled compiled object - * @param Smarty_Internal_Template $_template template object + * @param Smarty_Template_Compiled $compiled compiled object + * @param Smarty_Internal_Template $_template template object * @return void */ public function populateCompiledFilepath(Smarty_Template_Compiled $compiled, Smarty_Internal_Template $_template) @@ -32,5 +32,3 @@ abstract class Smarty_Resource_Recompiled extends Smarty_Resource { } } - -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_resource_uncompiled.php b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_resource_uncompiled.php similarity index 79% rename from lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_resource_uncompiled.php rename to lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_resource_uncompiled.php index ea802350..808f3a30 100644 --- a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_resource_uncompiled.php +++ b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_resource_uncompiled.php @@ -15,16 +15,16 @@ * @package Smarty * @subpackage TemplateResources */ -abstract class Smarty_Resource_Uncompiled extends Smarty_Resource { - +abstract class Smarty_Resource_Uncompiled extends Smarty_Resource +{ /** * Render and output the template (without using the compiler) * - * @param Smarty_Template_Source $source source object - * @param Smarty_Internal_Template $_template template object - * @throws SmartyException on failure + * @param Smarty_Template_Source $source source object + * @param Smarty_Internal_Template $_template template object + * @throws SmartyException on failure */ - public abstract function renderUncompiled(Smarty_Template_Source $source, Smarty_Internal_Template $_template); + abstract public function renderUncompiled(Smarty_Template_Source $source, Smarty_Internal_Template $_template); /** * populate compiled object with compiled filepath @@ -40,5 +40,3 @@ abstract class Smarty_Resource_Uncompiled extends Smarty_Resource { } } - -?> \ No newline at end of file diff --git a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_security.php b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_security.php similarity index 89% rename from lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_security.php rename to lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_security.php index 58f33787..7263a011 100644 --- a/lib/classes/Smarty-3.1.14/libs/sysplugins/smarty_security.php +++ b/lib/classes/Smarty-3.1.15/libs/sysplugins/smarty_security.php @@ -6,21 +6,21 @@ * @subpackage Security * @author Uwe Tews */ - + /* * FIXME: Smarty_Security API * - getter and setter instead of public properties would allow cultivating an internal cache properly * - current implementation of isTrustedResourceDir() assumes that Smarty::$template_dir and Smarty::$config_dir are immutable * the cache is killed every time either of the variables change. That means that two distinct Smarty objects with differing - * $template_dir or $config_dir should NOT share the same Smarty_Security instance, - * as this would lead to (severe) performance penalty! how should this be handled? + * $template_dir or $config_dir should NOT share the same Smarty_Security instance, + * as this would lead to (severe) performance penalty! how should this be handled? */ /** * This class does contain the security settings */ -class Smarty_Security { - +class Smarty_Security +{ /** * This determines how Smarty handles "" tags in templates. * possible values: @@ -164,8 +164,7 @@ class Smarty_Security { * @var array */ protected $_trusted_dir = null; - - + /** * @param Smarty $smarty */ @@ -173,13 +172,13 @@ class Smarty_Security { { $this->smarty = $smarty; } - + /** * Check if PHP function is trusted. * - * @param string $function_name - * @param object $compiler compiler object - * @return boolean true if function is trusted + * @param string $function_name + * @param object $compiler compiler object + * @return boolean true if function is trusted * @throws SmartyCompilerException if php function is not trusted */ public function isTrustedPhpFunction($function_name, $compiler) @@ -189,15 +188,16 @@ class Smarty_Security { } $compiler->trigger_template_error("PHP function '{$function_name}' not allowed by security setting"); + return false; // should not, but who knows what happens to the compiler in the future? } /** * Check if static class is trusted. * - * @param string $class_name - * @param object $compiler compiler object - * @return boolean true if class is trusted + * @param string $class_name + * @param object $compiler compiler object + * @return boolean true if class is trusted * @throws SmartyCompilerException if static class is not trusted */ public function isTrustedStaticClass($class_name, $compiler) @@ -207,15 +207,16 @@ class Smarty_Security { } $compiler->trigger_template_error("access to static class '{$class_name}' not allowed by security setting"); + return false; // should not, but who knows what happens to the compiler in the future? } /** * Check if PHP modifier is trusted. * - * @param string $modifier_name - * @param object $compiler compiler object - * @return boolean true if modifier is trusted + * @param string $modifier_name + * @param object $compiler compiler object + * @return boolean true if modifier is trusted * @throws SmartyCompilerException if modifier is not trusted */ public function isTrustedPhpModifier($modifier_name, $compiler) @@ -225,15 +226,16 @@ class Smarty_Security { } $compiler->trigger_template_error("modifier '{$modifier_name}' not allowed by security setting"); + return false; // should not, but who knows what happens to the compiler in the future? } /** * Check if tag is trusted. * - * @param string $tag_name - * @param object $compiler compiler object - * @return boolean true if tag is trusted + * @param string $tag_name + * @param object $compiler compiler object + * @return boolean true if tag is trusted * @throws SmartyCompilerException if modifier is not trusted */ public function isTrustedTag($tag_name, $compiler) @@ -250,20 +252,21 @@ class Smarty_Security { } else { $compiler->trigger_template_error("tag '{$tag_name}' disabled by security setting", $compiler->lex->taglineno); } - } else if (in_array($tag_name, $this->allowed_tags) && !in_array($tag_name, $this->disabled_tags)) { + } elseif (in_array($tag_name, $this->allowed_tags) && !in_array($tag_name, $this->disabled_tags)) { return true; } else { $compiler->trigger_template_error("tag '{$tag_name}' not allowed by security setting", $compiler->lex->taglineno); } + return false; // should not, but who knows what happens to the compiler in the future? } /** * Check if modifier plugin is trusted. * - * @param string $modifier_name - * @param object $compiler compiler object - * @return boolean true if tag is trusted + * @param string $modifier_name + * @param object $compiler compiler object + * @return boolean true if tag is trusted * @throws SmartyCompilerException if modifier is not trusted */ public function isTrustedModifier($modifier_name, $compiler) @@ -279,19 +282,20 @@ class Smarty_Security { } else { $compiler->trigger_template_error("modifier '{$modifier_name}' disabled by security setting", $compiler->lex->taglineno); } - } else if (in_array($modifier_name, $this->allowed_modifiers) && !in_array($modifier_name, $this->disabled_modifiers)) { + } elseif (in_array($modifier_name, $this->allowed_modifiers) && !in_array($modifier_name, $this->disabled_modifiers)) { return true; } else { $compiler->trigger_template_error("modifier '{$modifier_name}' not allowed by security setting", $compiler->lex->taglineno); } + return false; // should not, but who knows what happens to the compiler in the future? } /** * Check if stream is trusted. * - * @param string $stream_name - * @return boolean true if stream is trusted + * @param string $stream_name + * @return boolean true if stream is trusted * @throws SmartyException if stream is not trusted */ public function isTrustedStream($stream_name) @@ -306,8 +310,8 @@ class Smarty_Security { /** * Check if directory of file resource is trusted. * - * @param string $filepath - * @return boolean true if directory is trusted + * @param string $filepath + * @return boolean true if directory is trusted * @throws SmartyException if directory is not trusted */ public function isTrustedResourceDir($filepath) @@ -367,6 +371,7 @@ class Smarty_Security { if (isset($this->_resource_dir[$directory])) { // merge sub directories of current $directory into _resource_dir to speed up subsequent lookups $this->_resource_dir = array_merge($this->_resource_dir, $_directory); + return true; } // abort if we've reached root @@ -380,15 +385,15 @@ class Smarty_Security { // give up throw new SmartyException("directory '{$_filepath}' not allowed by security setting"); } - + /** * Check if URI (e.g. {fetch} or {html_image}) is trusted * * To simplify things, isTrustedUri() resolves all input to "{$PROTOCOL}://{$HOSTNAME}". * So "http://username:password@hello.world.example.org:8080/some-path?some=query-string" * is reduced to "http://hello.world.example.org" prior to applying the patters from {@link $trusted_uri}. - * @param string $uri - * @return boolean true if URI is trusted + * @param string $uri + * @return boolean true if URI is trusted * @throws SmartyException if URI is not trusted * @uses $trusted_uri for list of patterns to match against $uri */ @@ -403,15 +408,15 @@ class Smarty_Security { } } } - + throw new SmartyException("URI '{$uri}' not allowed by security setting"); } - + /** * Check if directory of file resource is trusted. * - * @param string $filepath - * @return boolean true if directory is trusted + * @param string $filepath + * @return boolean true if directory is trusted * @throws SmartyException if PHP directory is not trusted */ public function isTrustedPHPDir($filepath) @@ -441,6 +446,7 @@ class Smarty_Security { if (isset($this->_php_resource_dir[$directory])) { // merge sub directories of current $directory into _resource_dir to speed up subsequent lookups $this->_php_resource_dir = array_merge($this->_php_resource_dir, $_directory); + return true; } // abort if we've reached root @@ -455,5 +461,3 @@ class Smarty_Security { } } - -?> \ No newline at end of file
* - 1.0 initial release @@ -37,19 +37,19 @@ require_once(SMARTY_PLUGINS_DIR . 'shared.make_timestamp.php'); * dropdown to include given date unless explicitly set (Monte) * - 1.3.4 fix behaviour of 0000-00-00 00:00:00 dates to match that * of 0000-00-00 dates (cybot, boots) - * - 2.0 complete rewrite for performance, + * - 2.0 complete rewrite for performance, * added attributes month_names, *_id *