Index: trunk/extensions/DoubleWiki/DoubleWiki_body.php |
— | — | @@ -124,7 +124,8 @@ |
125 | 125 | $left_chunk = ''; |
126 | 126 | $right_chunk = ''; |
127 | 127 | |
128 | | - for ( $i=0 ; $i < count( $left_slices ); $i++ ) { |
| 128 | + $leftSliceCount = count( $left_slices ); |
| 129 | + for ( $i=0 ; $i < $leftSliceCount; $i++ ) { |
129 | 130 | |
130 | 131 | // some slices might be empty |
131 | 132 | if( $left_slices[$i] == '' ) { |
— | — | @@ -171,7 +172,8 @@ |
172 | 173 | |
173 | 174 | $left_chunk = ''; |
174 | 175 | $right_chunk = ''; |
175 | | - for($l=0; $l < count( $left_bits ) ; $l++ ) { |
| 176 | + $leftBitCount = count( $left_bits ); |
| 177 | + for($l=0; $l < $leftBitCount ; $l++ ) { |
176 | 178 | $body .= |
177 | 179 | "<tr><td valign=\"top\" style=\"vertical-align:100%;padding-right: 0.5em\" lang=\"{$left_lang}\">" |
178 | 180 | ."<div style=\"width:35em; margin:0px auto\">\n".$left_bits[$l]."</div>" |
— | — | @@ -206,7 +208,8 @@ |
207 | 209 | preg_match_all( $this->tags, $text, $m, PREG_SET_ORDER); |
208 | 210 | $counter = 0; |
209 | 211 | $out = ''; |
210 | | - for( $i = 0; $i < count( $m ); $i++ ){ |
| 212 | + $matchCount = count( $m ); |
| 213 | + for( $i = 0; $i < $matchCount; $i++ ){ |
211 | 214 | $t = $m[$i][0]; |
212 | 215 | if( substr( $t, 0, 2) != "</" ) { |
213 | 216 | $counter++; |
— | — | @@ -261,7 +264,8 @@ |
262 | 265 | $m = array(); |
263 | 266 | preg_match_all( $this->tags, $left_slices[$i], $m, PREG_SET_ORDER); |
264 | 267 | $counter = 0; |
265 | | - for($k=0 ; $k < count($m) ; $k++) { |
| 268 | + $matchCount = count( $m ); |
| 269 | + for($k=0 ; $k < $matchCount ; $k++) { |
266 | 270 | $t = $m[$k]; |
267 | 271 | if( substr( $t[0], 0, 2) != "</" ) { |
268 | 272 | $counter++; |