@@ -27,8 +27,9 @@ |
||
27 | 27 | { |
28 | 28 | $params = $compiler->getCompiledParams($params); |
29 | 29 | $parsedParams = array(); |
30 | - if (!isset($params['*'])) |
|
31 | - $params['*'] = array(); |
|
30 | + if (!isset($params['*'])) { |
|
31 | + $params['*'] = array(); |
|
32 | + } |
|
32 | 33 | foreach ($params['*'] as $param=>$defValue) { |
33 | 34 | if (is_numeric($param)) { |
34 | 35 | $param = $defValue; |
@@ -87,12 +87,24 @@ |
||
87 | 87 | // adds foreach properties |
88 | 88 | if ($usesAny) { |
89 | 89 | $pre .= "\n".'$this->globals["loop"]['.$name.'] = array'."\n("; |
90 | - if ($usesIndex) $pre .="\n\t".'"index" => 0,'; |
|
91 | - if ($usesIteration) $pre .="\n\t".'"iteration" => 1,'; |
|
92 | - if ($usesFirst) $pre .="\n\t".'"first" => null,'; |
|
93 | - if ($usesLast) $pre .="\n\t".'"last" => null,'; |
|
94 | - if ($usesShow) $pre .="\n\t".'"show" => $this->isTraversable($_loop'.$cnt.'_data, true),'; |
|
95 | - if ($usesTotal) $pre .="\n\t".'"total" => $this->count($_loop'.$cnt.'_data),'; |
|
90 | + if ($usesIndex) { |
|
91 | + $pre .="\n\t".'"index" => 0,'; |
|
92 | + } |
|
93 | + if ($usesIteration) { |
|
94 | + $pre .="\n\t".'"iteration" => 1,'; |
|
95 | + } |
|
96 | + if ($usesFirst) { |
|
97 | + $pre .="\n\t".'"first" => null,'; |
|
98 | + } |
|
99 | + if ($usesLast) { |
|
100 | + $pre .="\n\t".'"last" => null,'; |
|
101 | + } |
|
102 | + if ($usesShow) { |
|
103 | + $pre .="\n\t".'"show" => $this->isTraversable($_loop'.$cnt.'_data, true),'; |
|
104 | + } |
|
105 | + if ($usesTotal) { |
|
106 | + $pre .="\n\t".'"total" => $this->count($_loop'.$cnt.'_data),'; |
|
107 | + } |
|
96 | 108 | $pre.="\n);\n".'$_loop'.$cnt.'_glob =& $this->globals["loop"]['.$name.'];'; |
97 | 109 | } |
98 | 110 | // checks if the loop must be looped |
@@ -47,8 +47,9 @@ |
||
47 | 47 | case 'hexentity': |
48 | 48 | $out = ''; |
49 | 49 | $cnt = strlen((string) $value); |
50 | - for ($i=0; $i < $cnt; $i++) |
|
51 | - $out .= '&#x' . bin2hex((string) $value[$i]) . ';'; |
|
50 | + for ($i=0; $i < $cnt; $i++) { |
|
51 | + $out .= '&#x' . bin2hex((string) $value[$i]) . ';'; |
|
52 | + } |
|
52 | 53 | return $out; |
53 | 54 | case 'javascript': |
54 | 55 | return strtr((string) $value, array('\\'=>'\\\\',"'"=>"\\'",'"'=>'\\"',"\r"=>'\\r',"\n"=>'\\n','</'=>'<\/')); |