Changeset 7655 for trunk/workflow/inc/smarty/Smarty_Compiler.class.php
- Timestamp:
- 12/14/12 14:30:35 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/workflow/inc/smarty/Smarty_Compiler.class.php
r795 r7655 277 277 278 278 /* loop through text blocks */ 279 for ($curr_tb = 0, $for_max = count($text_blocks); $curr_tb < $for_max; $curr_tb++) {279 for ($curr_tb = 0, $for_max = count($text_blocks); $curr_tb < $for_max; ++$curr_tb) { 280 280 /* match anything resembling php tags */ 281 281 if (preg_match_all('~(<\?(?:\w+|=)?|\?>|language\s*=\s*[\"\']?\s*php\s*[\"\']?)~is', $text_blocks[$curr_tb], $sp_match)) { … … 283 283 $sp_match[1] = array_unique($sp_match[1]); 284 284 usort($sp_match[1], '_smarty_sort_length'); 285 for ($curr_sp = 0, $for_max2 = count($sp_match[1]); $curr_sp < $for_max2; $curr_sp++) {285 for ($curr_sp = 0, $for_max2 = count($sp_match[1]); $curr_sp < $for_max2; ++$curr_sp) { 286 286 $text_blocks[$curr_tb] = str_replace($sp_match[1][$curr_sp],'%%%SMARTYSP'.$curr_sp.'%%%',$text_blocks[$curr_tb]); 287 287 } 288 288 /* process each one */ 289 for ($curr_sp = 0, $for_max2 = count($sp_match[1]); $curr_sp < $for_max2; $curr_sp++) {289 for ($curr_sp = 0, $for_max2 = count($sp_match[1]); $curr_sp < $for_max2; ++$curr_sp) { 290 290 if ($this->php_handling == SMARTY_PHP_PASSTHRU) { 291 291 /* echo php contents */ … … 308 308 /* Compile the template tags into PHP code. */ 309 309 $compiled_tags = array(); 310 for ($i = 0, $for_max = count($template_tags); $i < $for_max; $i++) {310 for ($i = 0, $for_max = count($template_tags); $i < $for_max; ++$i) { 311 311 $this->_current_line_no += substr_count($text_blocks[$i], "\n"); 312 312 $compiled_tags[] = $this->_compile_tag($template_tags[$i]); … … 331 331 if ($strip) { 332 332 /* strip all $text_blocks before the next '/strip' */ 333 for ($j = $i + 1; $j < $for_max; $j++) {333 for ($j = $i + 1; $j < $for_max; ++$j) { 334 334 /* remove leading and trailing whitespaces of each line */ 335 335 $text_blocks[$j] = preg_replace('![\t ]*[\r\n]+[\t ]*!', '', $text_blocks[$j]); … … 354 354 355 355 /* Interleave the compiled contents and text blocks to get the final result. */ 356 for ($i = 0, $for_max = count($compiled_tags); $i < $for_max; $i++) {356 for ($i = 0, $for_max = count($compiled_tags); $i < $for_max; ++$i) { 357 357 if ($compiled_tags[$i] == '') { 358 358 // tag result empty, remove first newline from following text block … … 1279 1279 1280 1280 $is_arg_stack = array(); 1281 1282 for ($i = 0; $i < count($tokens); $i++) { 1281 $tokens_count = count($tokens); 1282 1283 for ($i = 0; $i < $tokens_count; ++$i) { 1283 1284 1284 1285 $token = &$tokens[$i]; … … 1470 1471 case 'even': 1471 1472 if (isset($tokens[$expr_end]) && $tokens[$expr_end] == 'by') { 1472 $expr_end++;1473 ++$expr_end; 1473 1474 $expr_arg = $tokens[$expr_end++]; 1474 1475 $expr = "!(1 & ($is_arg / " . $this->_parse_var_props($expr_arg) . "))"; … … 1479 1480 case 'odd': 1480 1481 if (isset($tokens[$expr_end]) && $tokens[$expr_end] == 'by') { 1481 $expr_end++;1482 ++$expr_end; 1482 1483 $expr_arg = $tokens[$expr_end++]; 1483 1484 $expr = "(1 & ($is_arg / " . $this->_parse_var_props($expr_arg) . "))"; … … 1488 1489 case 'div': 1489 1490 if (@$tokens[$expr_end] == 'by') { 1490 $expr_end++;1491 ++$expr_end; 1491 1492 $expr_arg = $tokens[$expr_end++]; 1492 1493 $expr = "!($is_arg % " . $this->_parse_var_props($expr_arg) . ")"; … … 1843 1844 $this->_parse_vars_props($match); 1844 1845 $replace = array(); 1845 for ($i = 0, $count = count($match); $i < $count; $i++) {1846 for ($i = 0, $count = count($match); $i < $count; ++$i) { 1846 1847 $replace[$orig_vals[$i]] = $match[$i]; 1847 1848 } … … 1905 1906 list(, $_modifiers, $modifier_arg_strings) = $_match; 1906 1907 1907 for ($_i = 0, $_for_max = count($_modifiers); $_i < $_for_max; $_i++) {1908 for ($_i = 0, $_for_max = count($_modifiers); $_i < $_for_max; ++$_i) { 1908 1909 $_modifier_name = $_modifiers[$_i]; 1909 1910
Note: See TracChangeset
for help on using the changeset viewer.