aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions_template.php
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes/functions_template.php')
-rw-r--r--phpBB/includes/functions_template.php55
1 files changed, 1 insertions, 54 deletions
diff --git a/phpBB/includes/functions_template.php b/phpBB/includes/functions_template.php
index 5becb2458b..ba3b1ab106 100644
--- a/phpBB/includes/functions_template.php
+++ b/phpBB/includes/functions_template.php
@@ -526,60 +526,7 @@ class template_compile
}
}
- // Try to combine some tokens...
- $new_tokens = array();
- $j = 0;
-
- for ($i = 0, $size = sizeof($tokens); $i < $size; $i++)
- {
- $token = &$tokens[$i];
-
- if ($token != '&&' && $token != '||')
- {
- $new_tokens[$j][] = $token;
- continue;
- }
-
- $this->_merge_tokens(' ', $new_tokens[$j]);
- $new_tokens[$j++] .= $token;
- }
-
- if (!sizeof($new_tokens))
- {
- $new_tokens[$j] = &$tokens;
- }
-
- if (isset($new_tokens[$j]) && is_array($new_tokens[$j]))
- {
- $this->_merge_tokens('', $new_tokens[$j]);
- }
-
- return (($elseif) ? '} else if (' : 'if (') . (implode(' ', $new_tokens) . ') { ');
- }
-
- /**
- * Merge tokens from IF expression, correctly adding isset() calls.
- * @access private
- */
- function _merge_tokens($suffix, &$tokens)
- {
- for ($i = 0, $size = sizeof($tokens); $i < $size; $i++)
- {
- $token = &$tokens[$i];
-
- if (strpos($token, '$this') === 0)
- {
- $token = '(isset(' . $token . ') && ' . $token;
- $suffix = ')' . $suffix;
- }
- else if (strpos($token, 'sizeof(') === 0)
- {
- $token = '(isset(' . substr($token, 7, -1) . ') && ' . $token;
- $suffix = ')' . $suffix;
- }
- }
-
- $tokens = implode(' ', $tokens) . $suffix;
+ return (($elseif) ? '} else if (' : 'if (') . (implode(' ', $tokens) . ') { ');
}
/**