X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=inc%2Fpoche%2FUrl.class.php;h=77ed53985ac336719999082977d40d4c5cd1cfbc;hb=64fa45e262d24f75740b0df267bb2fc4cdf83fa2;hp=00b0b25758236ac03d4c3e6927e167aa7d3b7749;hpb=7ba37bd91a43321196e6d867caf9e298e82c6d6c;p=github%2Fwallabag%2Fwallabag.git diff --git a/inc/poche/Url.class.php b/inc/poche/Url.class.php index 00b0b257..77ed5398 100644 --- a/inc/poche/Url.class.php +++ b/inc/poche/Url.class.php @@ -64,8 +64,15 @@ class Url if (function_exists('tidy_parse_string')) { $tidy = tidy_parse_string($html, array(), 'UTF8'); $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) !== "") + $html = $tidy->value; + } $parameters = array(); if (isset($html) and strlen($html) > 0)