| Conditions | 2 |
| Paths | 2 |
| Total Lines | 19 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 15 | public static function repair($xml) |
||
| 16 | { |
||
| 17 | if (class_exists("Tidy") === false) { |
||
| 18 | throw new Exception("Tidy Class not found", 500); |
||
| 19 | } |
||
| 20 | |||
| 21 | $config = [ |
||
| 22 | 'indent' => true, |
||
| 23 | 'input-xml' => true, |
||
| 24 | 'output-xml' => true, |
||
| 25 | 'wrap' => false |
||
| 26 | ]; |
||
| 27 | |||
| 28 | $xml_repaired = new Tidy(); |
||
| 29 | $xml_repaired->parseString($xml, $config, 'utf8'); |
||
| 30 | $xml_repaired->cleanRepair(); |
||
| 31 | |||
| 32 | return $xml_repaired; |
||
| 33 | } |
||
| 34 | } |
||
| 35 |