X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=inc%2Fpoche%2FUrl.class.php;h=3c74fb434bb1b7f14cd0f0934874893c44cb578c;hb=0269cd821311500acffed61edb1bc168d3fb5ec8;hp=77ed53985ac336719999082977d40d4c5cd1cfbc;hpb=2bf93dc0345e304656ed9a931f9941fd7117ddfe;p=github%2Fwallabag%2Fwallabag.git diff --git a/inc/poche/Url.class.php b/inc/poche/Url.class.php old mode 100644 new mode 100755 index 77ed5398..3c74fb43 --- a/inc/poche/Url.class.php +++ b/inc/poche/Url.class.php @@ -65,13 +65,14 @@ class Url $tidy = tidy_parse_string($html, array(), 'UTF8'); $tidy->cleanRepair(); - //Warning: tidy might fail so, ensure there is still a content - $body = $tidy->body(); + //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; + //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(); @@ -84,7 +85,7 @@ class Url if($readability->init()) { $content = $readability->articleContent->innerHTML; - $parameters['title'] = $readability->articleTitle->innerHTML; + $parameters['title'] = ($readability->articleTitle->innerHTML != '' ? $readability->articleTitle->innerHTML : _('Untitled')); $parameters['content'] = $content; return $parameters;