@@ 188-198 (lines=11) @@ | ||
185 | foreach($this->chunks as $id => $chunk){ |
|
186 | // |
|
187 | $keep_chunk=true; |
|
188 | if(!empty($pattern_keep)){ |
|
189 | $pattern_found=false; |
|
190 | foreach($pattern_keep as $pattern){ |
|
191 | if($is_regex){ |
|
192 | $pattern_found=($pattern_found OR preg_match($pattern,$chunk,$matches)); |
|
193 | } else { |
|
194 | $pattern_found=($pattern_found OR strstr($chunk,$pattern)); |
|
195 | } |
|
196 | } |
|
197 | $keep_chunk=($keep_chunk AND $pattern_found); |
|
198 | } |
|
199 | if(!empty($pattern_remove)){ |
|
200 | $pattern_found=false; |
|
201 | foreach($pattern_remove as $pattern){ |
|
@@ 199-209 (lines=11) @@ | ||
196 | } |
|
197 | $keep_chunk=($keep_chunk AND $pattern_found); |
|
198 | } |
|
199 | if(!empty($pattern_remove)){ |
|
200 | $pattern_found=false; |
|
201 | foreach($pattern_remove as $pattern){ |
|
202 | if($is_regex){ |
|
203 | $pattern_found=($pattern_found OR preg_match($pattern,$chunk,$matches)); |
|
204 | } else { |
|
205 | $pattern_found=($pattern_found OR strstr($chunk,$pattern)); |
|
206 | } |
|
207 | } |
|
208 | $keep_chunk=($keep_chunk AND !$pattern_found); |
|
209 | } |
|
210 | if(!$keep_chunk){ |
|
211 | unset($this->chunks[$id]); |
|
212 | } |