| Conditions | 2 |
| Paths | 2 |
| Total Lines | 19 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 46 | 2 | public function repair($content) |
|
| 47 | { |
||
| 48 | 2 | if (!$content) { |
|
| 49 | 1 | return ''; |
|
| 50 | } |
||
| 51 | |||
| 52 | 1 | $content = iconv('windows-1251', 'utf-8', $content); |
|
| 53 | |||
| 54 | // clean content |
||
| 55 | 1 | $this->tidy->parseString($content, $this->config, 'utf8'); |
|
| 56 | 1 | $this->tidy->cleanRepair(); |
|
| 57 | 1 | $content = $this->tidy->root()->value; |
|
| 58 | |||
| 59 | // ignore blocks |
||
| 60 | 1 | $content = preg_replace('/<noembed>.*?<\/noembed>/is', '', $content); |
|
| 61 | 1 | $content = preg_replace('/<noindex>.*?<\/noindex>/is', '', $content); |
|
| 62 | |||
| 63 | 1 | return $content; |
|
| 64 | } |
||
| 65 | } |
||
| 66 |