aboutsummaryrefslogtreecommitdiffstats
path: root/library/Smarty/libs/sysplugins/smarty_internal_compilebase.php
diff options
context:
space:
mode:
authorThomas Willingham <beardyunixer@beardyunixer.com>2014-12-11 20:15:27 +0000
committerThomas Willingham <beardyunixer@beardyunixer.com>2014-12-11 20:15:27 +0000
commit967ab871b836f618107fe144978bd1453c3c6634 (patch)
tree1bcb1b4bb1b25c904a2bc06f5c6d526d29909eaa /library/Smarty/libs/sysplugins/smarty_internal_compilebase.php
parent960c35bad3a0dbaa7a1f2191aef60ad014d926ca (diff)
downloadvolse-hubzilla-967ab871b836f618107fe144978bd1453c3c6634.tar.gz
volse-hubzilla-967ab871b836f618107fe144978bd1453c3c6634.tar.bz2
volse-hubzilla-967ab871b836f618107fe144978bd1453c3c6634.zip
Update Smarty
Diffstat (limited to 'library/Smarty/libs/sysplugins/smarty_internal_compilebase.php')
-rw-r--r--library/Smarty/libs/sysplugins/smarty_internal_compilebase.php48
1 files changed, 23 insertions, 25 deletions
diff --git a/library/Smarty/libs/sysplugins/smarty_internal_compilebase.php b/library/Smarty/libs/sysplugins/smarty_internal_compilebase.php
index 5fb56f371..f78f15f40 100644
--- a/library/Smarty/libs/sysplugins/smarty_internal_compilebase.php
+++ b/library/Smarty/libs/sysplugins/smarty_internal_compilebase.php
@@ -2,19 +2,19 @@
/**
* Smarty Internal Plugin CompileBase
*
- * @package Smarty
+ * @package Smarty
* @subpackage Compiler
- * @author Uwe Tews
+ * @author Uwe Tews
*/
/**
* This class does extend all internal compile plugins
*
- * @package Smarty
+ * @package Smarty
* @subpackage Compiler
*/
-abstract class Smarty_Internal_CompileBase {
-
+abstract class Smarty_Internal_CompileBase
+{
/**
* Array of names of required attribute required by tag
*
@@ -43,15 +43,15 @@ abstract class Smarty_Internal_CompileBase {
/**
* This function checks if the attributes passed are valid
- *
* The attributes passed for the tag to compile are checked against the list of required and
* optional attributes. Required attributes must be present. Optional attributes are check against
* 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 {
@@ -105,7 +105,7 @@ abstract class Smarty_Internal_CompileBase {
$compiler->trigger_template_error("missing \"" . $attr . "\" attribute", $compiler->lex->taglineno);
}
}
- // check for unallowed attributes
+ // check for not allowed attributes
if ($this->optional_attributes != array('_any')) {
$tmp_array = array_merge($this->required_attributes, $this->optional_attributes, $this->option_flags);
foreach ($_indexed_attr as $key => $dummy) {
@@ -126,12 +126,11 @@ abstract class Smarty_Internal_CompileBase {
/**
* Push opening tag name on stack
- *
* 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)
{
@@ -140,12 +139,12 @@ abstract class Smarty_Internal_CompileBase {
/**
* Pop closing tag
- *
* 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 +162,13 @@ 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