mirror of
https://github.com/wallabag/wallabag.git
synced 2024-12-23 08:06:33 +00:00
Fix #149
This commit is contained in:
parent
7ba37bd91a
commit
2bf93dc034
1 changed files with 9 additions and 2 deletions
|
@ -64,7 +64,14 @@ class Url
|
||||||
if (function_exists('tidy_parse_string')) {
|
if (function_exists('tidy_parse_string')) {
|
||||||
$tidy = tidy_parse_string($html, array(), 'UTF8');
|
$tidy = tidy_parse_string($html, array(), 'UTF8');
|
||||||
$tidy->cleanRepair();
|
$tidy->cleanRepair();
|
||||||
$html = $tidy->value;
|
|
||||||
|
//Warning: tidy might fail so, ensure there is still a content
|
||||||
|
$body = $tidy->body();
|
||||||
|
|
||||||
|
//hasChildren does not seem to work, just check the string
|
||||||
|
//returned (and do not forget to clean the white spaces)
|
||||||
|
if (preg_replace('/\s+/', '', $body->value) !== "<body></body>")
|
||||||
|
$html = $tidy->value;
|
||||||
}
|
}
|
||||||
|
|
||||||
$parameters = array();
|
$parameters = array();
|
||||||
|
|
Loading…
Reference in a new issue